Ejemplo n.º 1
0
        // DeleteScalingPolicy
        private static void DeleteScalingPolicy(AsClient asClient)
        {
            var deleteScalingPolicyRequest = new DeleteScalingPolicyRequest
            {
                ScalingPolicyId = "2e216c3a-406e-4c35-bc41-237664357932"
            };

            try
            {
                var deleteScalingPolicyResponse = asClient.DeleteScalingPolicy(deleteScalingPolicyRequest);
                Console.WriteLine(deleteScalingPolicyResponse.HttpStatusCode);
            }
            catch (RequestTimeoutException requestTimeoutException)
            {
                Console.WriteLine(requestTimeoutException.ErrorMessage);
            }
            catch (ServiceResponseException clientRequestException)
            {
                Console.WriteLine(clientRequestException.HttpStatusCode);
                Console.WriteLine(clientRequestException.ErrorCode);
                Console.WriteLine(clientRequestException.ErrorMsg);
            }
            catch (ConnectionException connectionException)
            {
                Console.WriteLine(connectionException.ErrorMessage);
            }
        }
        internal DeleteScalingPolicyResponse DeleteScalingPolicy(DeleteScalingPolicyRequest request)
        {
            var marshaller   = new DeleteScalingPolicyRequestMarshaller();
            var unmarshaller = DeleteScalingPolicyResponseUnmarshaller.Instance;

            return(Invoke <DeleteScalingPolicyRequest, DeleteScalingPolicyResponse>(request, marshaller, unmarshaller));
        }
        /// <summary>
        /// Initiates the asynchronous execution of the DeleteScalingPolicy operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DeleteScalingPolicy 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/DeleteScalingPolicy">REST API Reference for DeleteScalingPolicy Operation</seealso>
        public Task <DeleteScalingPolicyResponse> DeleteScalingPolicyAsync(DeleteScalingPolicyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new DeleteScalingPolicyRequestMarshaller();
            var unmarshaller = DeleteScalingPolicyResponseUnmarshaller.Instance;

            return(InvokeAsync <DeleteScalingPolicyRequest, DeleteScalingPolicyResponse>(request, marshaller,
                                                                                         unmarshaller, cancellationToken));
        }
        /// <summary>
        /// Initiates the asynchronous execution of the DeleteScalingPolicy operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DeleteScalingPolicy 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 EndDeleteScalingPolicy
        ///         operation.</returns>
        public IAsyncResult BeginDeleteScalingPolicy(DeleteScalingPolicyRequest request, AsyncCallback callback, object state)
        {
            var marshaller   = new DeleteScalingPolicyRequestMarshaller();
            var unmarshaller = DeleteScalingPolicyResponseUnmarshaller.Instance;

            return(BeginInvoke <DeleteScalingPolicyRequest>(request, marshaller, unmarshaller,
                                                            callback, state));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Initiates the asynchronous execution of the DeleteScalingPolicy operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DeleteScalingPolicy 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/DeleteScalingPolicy">REST API Reference for DeleteScalingPolicy Operation</seealso>
        public virtual Task <DeleteScalingPolicyResponse> DeleteScalingPolicyAsync(DeleteScalingPolicyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DeleteScalingPolicyRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DeleteScalingPolicyResponseUnmarshaller.Instance;

            return(InvokeAsync <DeleteScalingPolicyResponse>(request, options, cancellationToken));
        }
Ejemplo n.º 6
0
        internal virtual DeleteScalingPolicyResponse DeleteScalingPolicy(DeleteScalingPolicyRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DeleteScalingPolicyRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DeleteScalingPolicyResponseUnmarshaller.Instance;

            return(Invoke <DeleteScalingPolicyResponse>(request, options));
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 删除弹性伸缩策略
        /// </summary>
        public DeleteScalingPolicyResponse DeleteScalingPolicy(DeleteScalingPolicyRequest deleteScalingPolicyRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("scaling_policy_id", deleteScalingPolicyRequest.ScalingPolicyId.ToString());
            string      urlPath  = HttpUtils.AddUrlPath("/autoscaling-api/v1/{project_id}/scaling_policy/{scaling_policy_id}", urlParam);
            SdkRequest  request  = HttpUtils.InitSdkRequest(urlPath, deleteScalingPolicyRequest);
            SdkResponse response = DoHttpRequest("DELETE", request);

            return(JsonUtils.DeSerializeNull <DeleteScalingPolicyResponse>(response));
        }
        /// <summary>
        /// 删除弹性伸缩策略
        /// </summary>
        public async Task <DeleteScalingPolicyResponse> DeleteScalingPolicyAsync(DeleteScalingPolicyRequest deleteScalingPolicyRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("scaling_policy_id", deleteScalingPolicyRequest.ScalingPolicyId.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/autoscaling-api/v1/{project_id}/scaling_policy/{scaling_policy_id}", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, "application/json", deleteScalingPolicyRequest);
            HttpResponseMessage response = await DoHttpRequestAsync("DELETE", request);

            return(JsonUtils.DeSerializeNull <DeleteScalingPolicyResponse>(response));
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 用于删除扩缩容配置
        /// </summary>
        /// <param name="req"><see cref="DeleteScalingPolicyRequest"/></param>
        /// <returns><see cref="DeleteScalingPolicyResponse"/></returns>
        public DeleteScalingPolicyResponse DeleteScalingPolicySync(DeleteScalingPolicyRequest req)
        {
            JsonResponseModel <DeleteScalingPolicyResponse> rsp = null;

            try
            {
                var strResp = this.InternalRequestSync(req, "DeleteScalingPolicy");
                rsp = JsonConvert.DeserializeObject <JsonResponseModel <DeleteScalingPolicyResponse> >(strResp);
            }
            catch (JsonSerializationException e)
            {
                throw new TencentCloudSDKException(e.Message);
            }
            return(rsp.Response);
        }
 public void DeleteScalingPolicyAsync(DeleteScalingPolicyRequest request, AmazonServiceCallback <DeleteScalingPolicyRequest, DeleteScalingPolicyResponse> callback, AsyncOptions options = null)
 {
     throw new System.NotImplementedException();
 }