public Task StartAsync(StartInstanceRequest request) =>
 _context.StartAsync(
     new StartInstance(
         this.GetActorId().GetGuidId(), request.ServiceTypeUri, request.IsServiceStateful,
         request.HasPersistedState, request.MinReplicas, request.TargetReplicas,
         (PartitionSchemeDescription)Enum.Parse(typeof(PartitionSchemeDescription), request.PartitionScheme.ToString()),
         request.ExpirationQuanta),
     _cancellation);
        public async Task <Guid> StartAsync(StartInstanceRequest request)
        {
            var rvalue = _guidGetter.GetAGuid();

            await GetProxy(rvalue).StartAsync(request);

            return(rvalue);
        }
예제 #3
0
        public void BadFormatTypeTest()
        {
            var request = new StartInstanceRequest();

            request.InstanceId = "ttt";

            var exceptionMsg = Assert.Throws <ClientException>(() =>
            {
                var response = client.GetAcsResponse(request);
            });

            Assert.Equal("The specified InstanceId does not exist.", exceptionMsg.ErrorMessage);
            Assert.Equal("InvalidInstanceId.NotFound", exceptionMsg.ErrorCode);
        }
예제 #4
0
        public static void StartInstance()
        {
            IClientProfile   profile = DefaultProfile.GetProfile("cn-hangzhou", "<accessKeyId>", "<accessSecret>");
            DefaultAcsClient client  = new DefaultAcsClient(profile);

            var request = new StartInstanceRequest();

            request.InstanceId = "ECS实例ID";
            try {
                var response = client.GetAcsResponse(request);
                Console.WriteLine(System.Text.Encoding.Default.GetString(response.HttpResponse.Content));
            }
            catch (ServerException e)
            {
                Console.WriteLine(e);
            }
            catch (ClientException e)
            {
                Console.WriteLine(e);
            }
        }
예제 #5
0
 /// <summary>
 ///  当实例状态为stop时可以调用,开启es实例访问
 /// </summary>
 /// <param name="request">请求参数信息</param>
 /// <returns>请求结果信息</returns>
 public async Task <StartInstanceResponse> StartInstance(StartInstanceRequest request)
 {
     return(await new StartInstanceExecutor().Client(this).Execute <StartInstanceResponse, StartInstanceResult, StartInstanceRequest>(request).ConfigureAwait(false));
 }
예제 #6
0
 /// <summary>
 ///  当实例状态为stop时可以调用,开启es实例访问
 /// </summary>
 /// <param name="request">请求参数信息</param>
 /// <returns>请求结果信息</returns>
 public StartInstanceResponse StartInstance(StartInstanceRequest request)
 {
     return(new StartInstanceExecutor().Client(this).Execute <StartInstanceResponse, StartInstanceResult, StartInstanceRequest>(request));
 }