Ejemplo n.º 1
0
        internal DescribeConnectionsResponse DescribeConnections(DescribeConnectionsRequest request)
        {
            var marshaller   = new DescribeConnectionsRequestMarshaller();
            var unmarshaller = DescribeConnectionsResponseUnmarshaller.Instance;

            return(Invoke <DescribeConnectionsRequest, DescribeConnectionsResponse>(request, marshaller, unmarshaller));
        }
        /// <summary>
        /// <para>Displays all connections in this region.</para> <para>If a connection ID is provided, it will only return this particular
        /// connection.</para>
        /// </summary>
        ///
        /// <param name="describeConnectionsRequest">Container for the necessary parameters to execute the DescribeConnections service method on
        /// AmazonDirectConnect.</param>
        ///
        /// <returns>The response from the DescribeConnections service method, as returned by AmazonDirectConnect.</returns>
        ///
        /// <exception cref="T:Amazon.DirectConnect.Model.DirectConnectServerException" />
        /// <exception cref="T:Amazon.DirectConnect.Model.DirectConnectClientException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        public Task <DescribeConnectionsResponse> DescribeConnectionsAsync(DescribeConnectionsRequest describeConnectionsRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new DescribeConnectionsRequestMarshaller();
            var unmarshaller = DescribeConnectionsResponseUnmarshaller.GetInstance();

            return(Invoke <IRequest, DescribeConnectionsRequest, DescribeConnectionsResponse>(describeConnectionsRequest, marshaller, unmarshaller, signer, cancellationToken));
        }
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonDatabaseMigrationServiceConfig config = new AmazonDatabaseMigrationServiceConfig();

            config.RegionEndpoint = region;
            ConfigureClient(config);
            AmazonDatabaseMigrationServiceClient client = new AmazonDatabaseMigrationServiceClient(creds, config);

            DescribeConnectionsResponse resp = new DescribeConnectionsResponse();

            do
            {
                DescribeConnectionsRequest req = new DescribeConnectionsRequest
                {
                    Marker = resp.Marker
                    ,
                    MaxRecords = maxItems
                };

                resp = client.DescribeConnections(req);
                CheckError(resp.HttpStatusCode, "200");

                foreach (var obj in resp.Connections)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.Marker));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeConnections operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DescribeConnections 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>
        public Task <DescribeConnectionsResponse> DescribeConnectionsAsync(DescribeConnectionsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new DescribeConnectionsRequestMarshaller();
            var unmarshaller = DescribeConnectionsResponseUnmarshaller.Instance;

            return(InvokeAsync <DescribeConnectionsRequest, DescribeConnectionsResponse>(request, marshaller,
                                                                                         unmarshaller, cancellationToken));
        }
        internal DescribeConnectionsResponse DescribeConnections(DescribeConnectionsRequest request)
        {
            var task = DescribeConnectionsAsync(request);

            try
            {
                return(task.Result);
            }
            catch (AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return(null);
            }
        }
Ejemplo n.º 6
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonDirectConnectConfig config = new AmazonDirectConnectConfig();

            config.RegionEndpoint = region;
            ConfigureClient(config);
            AmazonDirectConnectClient client = new AmazonDirectConnectClient(creds, config);

            DescribeConnectionsResponse resp = new DescribeConnectionsResponse();
            DescribeConnectionsRequest  req  = new DescribeConnectionsRequest
            {
            };

            resp = client.DescribeConnections(req);
            CheckError(resp.HttpStatusCode, "200");

            foreach (var obj in resp.Connections)
            {
                AddObject(obj);
            }
        }