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); }
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); }
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); } }
/// <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)); }
/// <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)); }