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

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

            DescribeAcceleratorsResponse resp = new DescribeAcceleratorsResponse();

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

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

                foreach (var obj in resp.AcceleratorSet)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
        /// <summary>
        /// Describes information over a provided set of accelerators belonging to an account.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the DescribeAccelerators service method.</param>
        ///
        /// <returns>The response from the DescribeAccelerators service method, as returned by ElasticInference.</returns>
        /// <exception cref="Amazon.ElasticInference.Model.BadRequestException">
        /// Raised when a malformed input has been provided to the API.
        /// </exception>
        /// <exception cref="Amazon.ElasticInference.Model.InternalServerException">
        /// Raised when an unexpected error occurred during request processing.
        /// </exception>
        /// <exception cref="Amazon.ElasticInference.Model.ResourceNotFoundException">
        /// Raised when the requested resource cannot be found.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elastic-inference-2017-07-25/DescribeAccelerators">REST API Reference for DescribeAccelerators Operation</seealso>
        public virtual DescribeAcceleratorsResponse DescribeAccelerators(DescribeAcceleratorsRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DescribeAcceleratorsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DescribeAcceleratorsResponseUnmarshaller.Instance;

            return(Invoke <DescribeAcceleratorsResponse>(request, options));
        }
        /// <summary>
        /// Describes information over a provided set of accelerators belonging to an account.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the DescribeAccelerators service method.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        ///
        /// <returns>The response from the DescribeAccelerators service method, as returned by ElasticInference.</returns>
        /// <exception cref="Amazon.ElasticInference.Model.BadRequestException">
        /// Raised when a malformed input has been provided to the API.
        /// </exception>
        /// <exception cref="Amazon.ElasticInference.Model.InternalServerException">
        /// Raised when an unexpected error occurred during request processing.
        /// </exception>
        /// <exception cref="Amazon.ElasticInference.Model.ResourceNotFoundException">
        /// Raised when the requested resource cannot be found.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elastic-inference-2017-07-25/DescribeAccelerators">REST API Reference for DescribeAccelerators Operation</seealso>
        public virtual Task <DescribeAcceleratorsResponse> DescribeAcceleratorsAsync(DescribeAcceleratorsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DescribeAcceleratorsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DescribeAcceleratorsResponseUnmarshaller.Instance;

            return(InvokeAsync <DescribeAcceleratorsResponse>(request, options, cancellationToken));
        }
Example #4
0
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeAccelerators operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DescribeAccelerators operation on AmazonElasticInferenceClient.</param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
        ///          procedure using the AsyncState property.</param>
        ///
        /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeAccelerators
        ///         operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elastic-inference-2017-07-25/DescribeAccelerators">REST API Reference for DescribeAccelerators Operation</seealso>
        public virtual IAsyncResult BeginDescribeAccelerators(DescribeAcceleratorsRequest request, AsyncCallback callback, object state)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DescribeAcceleratorsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DescribeAcceleratorsResponseUnmarshaller.Instance;

            return(BeginInvoke(request, options, callback, state));
        }