/// <summary> /// The GetConnectors API returns a list of connectors that are registered with the Server /// Migration Service. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetConnectors service method.</param> /// /// <returns>The response from the GetConnectors service method, as returned by ServerMigrationService.</returns> /// <exception cref="Amazon.ServerMigrationService.Model.UnauthorizedOperationException"> /// This user does not have permissions to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/sms-2016-10-24/GetConnectors">REST API Reference for GetConnectors Operation</seealso> public virtual GetConnectorsResponse GetConnectors(GetConnectorsRequest request) { var marshaller = new GetConnectorsRequestMarshaller(); var unmarshaller = GetConnectorsResponseUnmarshaller.Instance; return(Invoke <GetConnectorsRequest, GetConnectorsResponse>(request, marshaller, unmarshaller)); }
public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonServerMigrationServiceConfig config = new AmazonServerMigrationServiceConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonServerMigrationServiceClient client = new AmazonServerMigrationServiceClient(creds, config); GetConnectorsResponse resp = new GetConnectorsResponse(); do { GetConnectorsRequest req = new GetConnectorsRequest { NextToken = resp.NextToken , MaxResults = maxItems }; resp = client.GetConnectors(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.ConnectorList) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }
/// <summary> /// Initiates the asynchronous execution of the GetConnectors operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetConnectors operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/sms-2016-10-24/GetConnectors">REST API Reference for GetConnectors Operation</seealso> public virtual Task <GetConnectorsResponse> GetConnectorsAsync(GetConnectorsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new GetConnectorsRequestMarshaller(); var unmarshaller = GetConnectorsResponseUnmarshaller.Instance; return(InvokeAsync <GetConnectorsRequest, GetConnectorsResponse>(request, marshaller, unmarshaller, cancellationToken)); }