예제 #1
0
        /// <summary>
        /// Deletes an application using an &#x60;applicationId&#x60;.
        ///
        /// </summary>
        /// <param name="request">The request object containing the details to send. Required.</param>
        /// <param name="retryConfiguration">The retry configuration that will be used by to send this request. Optional.</param>
        /// <param name="cancellationToken">The cancellation token to cancel this operation. Optional.</param>
        /// <returns>A response object containing details about the completed operation</returns>
        public async Task <DeleteApplicationResponse> DeleteApplication(DeleteApplicationRequest request, RetryConfiguration retryConfiguration = null, CancellationToken cancellationToken = default)
        {
            logger.Trace("Called deleteApplication");
            Uri                uri            = new Uri(this.restClient.GetEndpoint(), System.IO.Path.Combine(basePathWithoutHost, "/applications/{applicationId}".Trim('/')));
            HttpMethod         method         = new HttpMethod("Delete");
            HttpRequestMessage requestMessage = Converter.ToHttpRequestMessage(uri, method, request);

            requestMessage.Headers.Add("Accept", "application/json");
            GenericRetrier      retryingClient = Retrier.GetPreferredRetrier(retryConfiguration, this.retryConfiguration);
            HttpResponseMessage responseMessage;

            try
            {
                if (retryingClient != null)
                {
                    responseMessage = await retryingClient.MakeRetryingCall(this.restClient.HttpSend, requestMessage, cancellationToken);
                }
                else
                {
                    responseMessage = await this.restClient.HttpSend(requestMessage);
                }

                return(Converter.FromHttpResponseMessage <DeleteApplicationResponse>(responseMessage));
            }
            catch (Exception e)
            {
                logger.Error($"DeleteApplication failed with error: {e.Message}");
                throw;
            }
        }
        protected override void ProcessRecord()
        {
            base.ProcessRecord();

            if (!ConfirmDelete("OCIDataflowApplication", "Remove"))
            {
                return;
            }

            DeleteApplicationRequest request;

            try
            {
                request = new DeleteApplicationRequest
                {
                    ApplicationId = ApplicationId,
                    OpcRequestId  = OpcRequestId,
                    IfMatch       = IfMatch
                };

                response = client.DeleteApplication(request).GetAwaiter().GetResult();
                WriteOutput(response);
                FinishProcessing(response);
            }
            catch (Exception ex)
            {
                TerminatingErrorDuringExecution(ex);
            }
        }
예제 #3
0
        public async Task <IActionResult> DeleteApplication(int id)
        {
            var request  = new DeleteApplicationRequest(id);
            var response = await _mediator.Send(request);

            return(Ok(response));
        }
        /// <summary>
        /// <para> Deletes the specified application along with all associated versions and configurations. </para> <para><b>NOTE:</b>You cannot delete
        /// an application that has a running environment. </para>
        /// </summary>
        ///
        /// <param name="deleteApplicationRequest">Container for the necessary parameters to execute the DeleteApplication service method on
        ///           AmazonElasticBeanstalk.</param>
        ///
        public DeleteApplicationResponse DeleteApplication(DeleteApplicationRequest deleteApplicationRequest)
        {
            IRequest <DeleteApplicationRequest> request  = new DeleteApplicationRequestMarshaller().Marshall(deleteApplicationRequest);
            DeleteApplicationResponse           response = Invoke <DeleteApplicationRequest, DeleteApplicationResponse> (request, this.signer, DeleteApplicationResponseUnmarshaller.GetInstance());

            return(response);
        }
예제 #5
0
        internal DeleteApplicationResponse DeleteApplication(DeleteApplicationRequest request)
        {
            var marshaller   = new DeleteApplicationRequestMarshaller();
            var unmarshaller = DeleteApplicationResponseUnmarshaller.Instance;

            return(Invoke <DeleteApplicationRequest, DeleteApplicationResponse>(request, marshaller, unmarshaller));
        }
예제 #6
0
        private static void deleteApplication(IoTDAClient client)
        {
            DeleteApplicationRequest req = new DeleteApplicationRequest
            {
                AppId      = "b761d59418fd4221871137e486f64d22",
                InstanceId = "1a7ffc5c-d89c-44dd-8265-b1653d951ce0"
            };

            try
            {
                var resp = client.DeleteApplication(req);
                Console.WriteLine(resp.HttpStatusCode);
                Console.WriteLine(resp);
            }
            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);
            }
        }
예제 #7
0
        /// <summary>
        /// Initiates the asynchronous execution of the DeleteApplication operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DeleteApplication 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 <DeleteApplicationResponse> DeleteApplicationAsync(DeleteApplicationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new DeleteApplicationRequestMarshaller();
            var unmarshaller = DeleteApplicationResponseUnmarshaller.Instance;

            return(InvokeAsync <DeleteApplicationRequest, DeleteApplicationResponse>(request, marshaller,
                                                                                     unmarshaller, cancellationToken));
        }
예제 #8
0
        public async Task <DeleteApplicationResponse> Delete(DeleteApplicationRequest o)
        {
            var result = new DeleteApplicationResponse(o.RequestId);

            result.Deleted = await Server.Delete(o.Id);

            return(result);
        }
예제 #9
0
        internal virtual DeleteApplicationResponse DeleteApplication(DeleteApplicationRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DeleteApplicationRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DeleteApplicationResponseUnmarshaller.Instance;

            return(Invoke <DeleteApplicationResponse>(request, options));
        }
예제 #10
0
        /// <summary>
        /// Deletes the specified application.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the DeleteApplication 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 DeleteApplication service method, as returned by ServerlessApplicationRepository.</returns>
        /// <exception cref="Amazon.ServerlessApplicationRepository.Model.BadRequestException">
        /// One of the parameters in the request is invalid.
        /// </exception>
        /// <exception cref="Amazon.ServerlessApplicationRepository.Model.ConflictException">
        /// The resource already exists.
        /// </exception>
        /// <exception cref="Amazon.ServerlessApplicationRepository.Model.ForbiddenException">
        /// The client is not authenticated.
        /// </exception>
        /// <exception cref="Amazon.ServerlessApplicationRepository.Model.InternalServerErrorException">
        /// The AWS Serverless Application Repository service encountered an internal error.
        /// </exception>
        /// <exception cref="Amazon.ServerlessApplicationRepository.Model.NotFoundException">
        /// The resource (for example, an access policy statement) specified in the request doesn't
        /// exist.
        /// </exception>
        /// <exception cref="Amazon.ServerlessApplicationRepository.Model.TooManyRequestsException">
        /// The client is sending more than the allowed number of requests per unit of time.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/serverlessrepo-2017-09-08/DeleteApplication">REST API Reference for DeleteApplication Operation</seealso>
        public virtual Task <DeleteApplicationResponse> DeleteApplicationAsync(DeleteApplicationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DeleteApplicationRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DeleteApplicationResponseUnmarshaller.Instance;

            return(InvokeAsync <DeleteApplicationResponse>(request, options, cancellationToken));
        }
예제 #11
0
        /// <summary>
        /// Initiates the asynchronous execution of the DeleteApplication operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DeleteApplication operation on AmazonIoTFleetHubClient.</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 EndDeleteApplication
        ///         operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotfleethub-2020-11-03/DeleteApplication">REST API Reference for DeleteApplication Operation</seealso>
        public virtual IAsyncResult BeginDeleteApplication(DeleteApplicationRequest request, AsyncCallback callback, object state)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DeleteApplicationRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DeleteApplicationResponseUnmarshaller.Instance;

            return(BeginInvoke(request, options, callback, state));
        }
예제 #12
0
        /**
         * Deletes an Application and waits for it to be deleted.
         *
         * @param fnManagementClient the service client to use to delete the Application.
         * @param applicationId the Application to delete.
         */
        private static async Task DeleteApplication(FunctionsManagementClient fnManagementClient, string applicationId)
        {
            // Delete the specified Application
            var deleteApplicationRequest = new DeleteApplicationRequest
            {
                ApplicationId = applicationId
            };
            await fnManagementClient.DeleteApplication(deleteApplicationRequest);

            logger.Info($"Application deleted: {AppName}");
        }
        /// <summary>
        /// 删除资源空间
        /// </summary>
        public DeleteApplicationResponse DeleteApplication(DeleteApplicationRequest deleteApplicationRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("app_id", deleteApplicationRequest.AppId.ToString());
            string                    urlPath  = HttpUtils.AddUrlPath("/v5/iot/{project_id}/apps/{app_id}", urlParam);
            SdkRequest                request  = HttpUtils.InitSdkRequest(urlPath, deleteApplicationRequest);
            HttpResponseMessage       response = DoHttpRequestSync("DELETE", request);
            DeleteApplicationResponse deleteApplicationResponse = JsonUtils.DeSerializeNull <DeleteApplicationResponse>(response);

            return(deleteApplicationResponse);
        }
        /// <summary>
        /// 服务删除
        ///   - 停止当前运行服务
        ///   - 删除服务相关资源
        ///   - 删除服务
        /// </summary>
        /// <param name="req"><see cref="DeleteApplicationRequest"/></param>
        /// <returns><see cref="DeleteApplicationResponse"/></returns>
        public DeleteApplicationResponse DeleteApplicationSync(DeleteApplicationRequest req)
        {
            JsonResponseModel <DeleteApplicationResponse> rsp = null;

            try
            {
                var strResp = this.InternalRequestSync(req, "DeleteApplication");
                rsp = JsonConvert.DeserializeObject <JsonResponseModel <DeleteApplicationResponse> >(strResp);
            }
            catch (JsonSerializationException e)
            {
                throw new TencentCloudSDKException(e.Message);
            }
            return(rsp.Response);
        }
        /// <summary>Snippet for DeleteApplication</summary>
        public void DeleteApplicationRequestObject()
        {
            // Snippet: DeleteApplication(DeleteApplicationRequest, CallSettings)
            // Create client
            ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.Create();
            // Initialize request argument(s)
            DeleteApplicationRequest request = new DeleteApplicationRequest
            {
                ApplicationName = ApplicationName.FromProjectTenantProfileApplication("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]"),
            };

            // Make the request
            applicationServiceClient.DeleteApplication(request);
            // End snippet
        }
        public void DeleteApplicationResourceNames()
        {
            moq::Mock <ApplicationService.ApplicationServiceClient> mockGrpcClient = new moq::Mock <ApplicationService.ApplicationServiceClient>(moq::MockBehavior.Strict);
            DeleteApplicationRequest request = new DeleteApplicationRequest
            {
                ApplicationName = ApplicationName.FromProjectTenantProfileApplication("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]"),
            };
            wkt::Empty expectedResponse = new wkt::Empty {
            };

            mockGrpcClient.Setup(x => x.DeleteApplication(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            ApplicationServiceClient client = new ApplicationServiceClientImpl(mockGrpcClient.Object, null);

            client.DeleteApplication(request.ApplicationName);
            mockGrpcClient.VerifyAll();
        }
        public void DeleteApplication2()
        {
            Mock <ApplicationService.ApplicationServiceClient> mockGrpcClient = new Mock <ApplicationService.ApplicationServiceClient>(MockBehavior.Strict);
            DeleteApplicationRequest request = new DeleteApplicationRequest
            {
                ApplicationName = new ApplicationName("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]"),
            };
            Empty expectedResponse = new Empty();

            mockGrpcClient.Setup(x => x.DeleteApplication(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            ApplicationServiceClient client = new ApplicationServiceClientImpl(mockGrpcClient.Object, null);

            client.DeleteApplication(request);
            mockGrpcClient.VerifyAll();
        }
        public async Task DeleteApplicationAsync2()
        {
            Mock <ApplicationService.ApplicationServiceClient> mockGrpcClient = new Mock <ApplicationService.ApplicationServiceClient>(MockBehavior.Strict);
            DeleteApplicationRequest request = new DeleteApplicationRequest
            {
                ApplicationName = new ApplicationName("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]"),
            };
            Empty expectedResponse = new Empty();

            mockGrpcClient.Setup(x => x.DeleteApplicationAsync(request, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <Empty>(Task.FromResult(expectedResponse), null, null, null, null));
            ApplicationServiceClient client = new ApplicationServiceClientImpl(mockGrpcClient.Object, null);
            await client.DeleteApplicationAsync(request);

            mockGrpcClient.VerifyAll();
        }
예제 #19
0
        public async Task <IActionResult> Delete([FromRoute] DeleteApplicationRequest request)
        {
            IActionResult result = null;

            var deleted = await Server.Delete(request.Id);

            if (deleted)
            {
                result = Factory.CreateSuccessResponse(deleted);
            }
            else
            {
                result = Factory.CreateNoContentResponse();
            }

            return(result);
        }
        /// <summary>Snippet for DeleteApplicationAsync</summary>
        public async Task DeleteApplicationRequestObjectAsync()
        {
            // Snippet: DeleteApplicationAsync(DeleteApplicationRequest, CallSettings)
            // Additional: DeleteApplicationAsync(DeleteApplicationRequest, CancellationToken)
            // Create client
            ApplicationServiceClient applicationServiceClient = await ApplicationServiceClient.CreateAsync();

            // Initialize request argument(s)
            DeleteApplicationRequest request = new DeleteApplicationRequest
            {
                ApplicationName = ApplicationName.FromProjectTenantProfileApplication("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]"),
            };
            // Make the request
            await applicationServiceClient.DeleteApplicationAsync(request);

            // End snippet
        }
        public async stt::Task DeleteApplicationResourceNamesAsync()
        {
            moq::Mock <ApplicationService.ApplicationServiceClient> mockGrpcClient = new moq::Mock <ApplicationService.ApplicationServiceClient>(moq::MockBehavior.Strict);
            DeleteApplicationRequest request = new DeleteApplicationRequest
            {
                ApplicationName = ApplicationName.FromProjectTenantProfileApplication("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]"),
            };
            wkt::Empty expectedResponse = new wkt::Empty {
            };

            mockGrpcClient.Setup(x => x.DeleteApplicationAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <wkt::Empty>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            ApplicationServiceClient client = new ApplicationServiceClientImpl(mockGrpcClient.Object, null);
            await client.DeleteApplicationAsync(request.ApplicationName, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            await client.DeleteApplicationAsync(request.ApplicationName, st::CancellationToken.None);

            mockGrpcClient.VerifyAll();
        }
 public void DeleteApplication(DeleteApplicationRequest request)
 {
     throw new NotImplementedException();
 }