public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonBatchConfig config = new AmazonBatchConfig();

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

            DescribeComputeEnvironmentsResponse resp = new DescribeComputeEnvironmentsResponse();

            do
            {
                DescribeComputeEnvironmentsRequest req = new DescribeComputeEnvironmentsRequest
                {
                    NextToken = resp.NextToken
                    ,
                    MaxResults = maxItems
                };

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

                foreach (var obj in resp.ComputeEnvironments)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
Esempio n. 2
0
        internal DescribeComputeEnvironmentsResponse DescribeComputeEnvironments(DescribeComputeEnvironmentsRequest request)
        {
            var marshaller   = new DescribeComputeEnvironmentsRequestMarshaller();
            var unmarshaller = DescribeComputeEnvironmentsResponseUnmarshaller.Instance;

            return(Invoke <DescribeComputeEnvironmentsRequest, DescribeComputeEnvironmentsResponse>(request, marshaller, unmarshaller));
        }
Esempio n. 3
0
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeComputeEnvironments operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DescribeComputeEnvironments 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/batch-2016-08-10/DescribeComputeEnvironments">REST API Reference for DescribeComputeEnvironments Operation</seealso>
        public virtual Task <DescribeComputeEnvironmentsResponse> DescribeComputeEnvironmentsAsync(DescribeComputeEnvironmentsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DescribeComputeEnvironmentsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DescribeComputeEnvironmentsResponseUnmarshaller.Instance;

            return(InvokeAsync <DescribeComputeEnvironmentsResponse>(request, options, cancellationToken));
        }
Esempio n. 4
0
        internal virtual DescribeComputeEnvironmentsResponse DescribeComputeEnvironments(DescribeComputeEnvironmentsRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DescribeComputeEnvironmentsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DescribeComputeEnvironmentsResponseUnmarshaller.Instance;

            return(Invoke <DescribeComputeEnvironmentsResponse>(request, options));
        }
Esempio n. 5
0
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeComputeEnvironments operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DescribeComputeEnvironments 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/batch-2016-08-10/DescribeComputeEnvironments">REST API Reference for DescribeComputeEnvironments Operation</seealso>
        public Task <DescribeComputeEnvironmentsResponse> DescribeComputeEnvironmentsAsync(DescribeComputeEnvironmentsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new DescribeComputeEnvironmentsRequestMarshaller();
            var unmarshaller = DescribeComputeEnvironmentsResponseUnmarshaller.Instance;

            return(InvokeAsync <DescribeComputeEnvironmentsRequest, DescribeComputeEnvironmentsResponse>(request, marshaller,
                                                                                                         unmarshaller, cancellationToken));
        }