Ejemplo n.º 1
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonGameLiftConfig config = new AmazonGameLiftConfig();

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

            DescribeScalingPoliciesResponse resp = new DescribeScalingPoliciesResponse();

            do
            {
                DescribeScalingPoliciesRequest req = new DescribeScalingPoliciesRequest
                {
                    NextToken = resp.NextToken
                    ,
                    Limit = maxItems
                };

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

                foreach (var obj in resp.ScalingPolicies)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
        internal DescribeScalingPoliciesResponse DescribeScalingPolicies(DescribeScalingPoliciesRequest request)
        {
            var marshaller   = new DescribeScalingPoliciesRequestMarshaller();
            var unmarshaller = DescribeScalingPoliciesResponseUnmarshaller.Instance;

            return(Invoke <DescribeScalingPoliciesRequest, DescribeScalingPoliciesResponse>(request, marshaller, unmarshaller));
        }
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeScalingPolicies operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DescribeScalingPolicies 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/application-autoscaling-2016-02-06/DescribeScalingPolicies">REST API Reference for DescribeScalingPolicies Operation</seealso>
        public Task <DescribeScalingPoliciesResponse> DescribeScalingPoliciesAsync(DescribeScalingPoliciesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new DescribeScalingPoliciesRequestMarshaller();
            var unmarshaller = DescribeScalingPoliciesResponseUnmarshaller.Instance;

            return(InvokeAsync <DescribeScalingPoliciesRequest, DescribeScalingPoliciesResponse>(request, marshaller,
                                                                                                 unmarshaller, cancellationToken));
        }
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeScalingPolicies operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DescribeScalingPolicies operation on AmazonApplicationAutoScalingClient.</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 EndDescribeScalingPolicies
        ///         operation.</returns>
        public IAsyncResult BeginDescribeScalingPolicies(DescribeScalingPoliciesRequest request, AsyncCallback callback, object state)
        {
            var marshaller   = new DescribeScalingPoliciesRequestMarshaller();
            var unmarshaller = DescribeScalingPoliciesResponseUnmarshaller.Instance;

            return(BeginInvoke <DescribeScalingPoliciesRequest>(request, marshaller, unmarshaller,
                                                                callback, state));
        }
Ejemplo n.º 5
0
        internal virtual DescribeScalingPoliciesResponse DescribeScalingPolicies(DescribeScalingPoliciesRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DescribeScalingPoliciesRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DescribeScalingPoliciesResponseUnmarshaller.Instance;

            return(Invoke <DescribeScalingPoliciesResponse>(request, options));
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 用于查询服务部署的动态扩缩容配置
        /// </summary>
        /// <param name="req"><see cref="DescribeScalingPoliciesRequest"/></param>
        /// <returns><see cref="DescribeScalingPoliciesResponse"/></returns>
        public DescribeScalingPoliciesResponse DescribeScalingPoliciesSync(DescribeScalingPoliciesRequest req)
        {
            JsonResponseModel <DescribeScalingPoliciesResponse> rsp = null;

            try
            {
                var strResp = this.InternalRequestSync(req, "DescribeScalingPolicies");
                rsp = JsonConvert.DeserializeObject <JsonResponseModel <DescribeScalingPoliciesResponse> >(strResp);
            }
            catch (JsonSerializationException e)
            {
                throw new TencentCloudSDKException(e.Message);
            }
            return(rsp.Response);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeScalingPolicies operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DescribeScalingPolicies 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/application-autoscaling-2016-02-06/DescribeScalingPolicies">REST API Reference for DescribeScalingPolicies Operation</seealso>
        public virtual Task <DescribeScalingPoliciesResponse> DescribeScalingPoliciesAsync(DescribeScalingPoliciesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DescribeScalingPoliciesRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DescribeScalingPoliciesResponseUnmarshaller.Instance;

            return(InvokeAsync <DescribeScalingPoliciesResponse>(request, options, cancellationToken));
        }
 public void DescribeScalingPoliciesAsync(DescribeScalingPoliciesRequest request, AmazonServiceCallback <DescribeScalingPoliciesRequest, DescribeScalingPoliciesResponse> callback, AsyncOptions options = null)
 {
     throw new System.NotImplementedException();
 }