Esempio n. 1
0
        /// <summary>
        /// Deletes the specified mount target.
        ///
        ///
        /// <para>
        ///  This operation forcibly breaks any mounts of the file system via the mount target
        /// being deleted, which might disrupt instances or applications using those mounts. To
        /// avoid applications getting cut off abruptly, you might consider unmounting any mounts
        /// of the mount target, if feasible. The operation also deletes the associated network
        /// interface. Uncommitted writes may be lost, but breaking a mount target using this
        /// operation does not corrupt the file system itself. The file system you created remains.
        /// You can mount an EC2 instance in your VPC using another mount target.
        /// </para>
        ///
        /// <para>
        ///  This operation requires permission for the following action on the file system:
        /// </para>
        ///  <ul> <li> <code>elasticfilesystem:DeleteMountTarget</code> </li> </ul> <note>The
        /// <code>DeleteMountTarget</code> call returns while the mount target state is still
        /// "deleting". You can check the mount target deletion by calling the <a>DescribeMountTargets</a>
        /// API, which returns a list of mount target descriptions for the given file system.
        /// </note>
        /// <para>
        /// The operation also requires permission for the following Amazon EC2 action on the
        /// mount target's network interface:
        /// </para>
        ///  <ul> <li> <code>ec2:DeleteNetworkInterface</code> </li> </ul>
        /// </summary>
        /// <param name="mountTargetId">String. The ID of the mount target to delete.</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 DeleteMountTarget service method, as returned by ElasticFileSystem.</returns>
        /// <exception cref="Amazon.ElasticFileSystem.Model.BadRequestException">
        /// Returned if the request is malformed or contains an error such as an invalid parameter
        /// value or a missing required parameter.
        /// </exception>
        /// <exception cref="Amazon.ElasticFileSystem.Model.DependencyTimeoutException">
        /// The service timed out trying to fulfill the request, and the client should try the
        /// call again.
        /// </exception>
        /// <exception cref="Amazon.ElasticFileSystem.Model.InternalServerErrorException">
        /// Returned if an error occurred on the server side.
        /// </exception>
        /// <exception cref="Amazon.ElasticFileSystem.Model.MountTargetNotFoundException">
        /// Returned if there is no mount target with the specified ID found in the caller's account.
        /// </exception>
        public Task <DeleteMountTargetResponse> DeleteMountTargetAsync(string mountTargetId, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var request = new DeleteMountTargetRequest();

            request.MountTargetId = mountTargetId;
            return(DeleteMountTargetAsync(request, cancellationToken));
        }
Esempio n. 2
0
        internal DeleteMountTargetResponse DeleteMountTarget(DeleteMountTargetRequest request)
        {
            var marshaller   = new DeleteMountTargetRequestMarshaller();
            var unmarshaller = DeleteMountTargetResponseUnmarshaller.Instance;

            return(Invoke <DeleteMountTargetRequest, DeleteMountTargetResponse>(request, marshaller, unmarshaller));
        }
Esempio n. 3
0
        /// <summary>
        /// Initiates the asynchronous execution of the DeleteMountTarget operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DeleteMountTarget 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 <DeleteMountTargetResponse> DeleteMountTargetAsync(DeleteMountTargetRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new DeleteMountTargetRequestMarshaller();
            var unmarshaller = DeleteMountTargetResponseUnmarshaller.Instance;

            return(InvokeAsync <DeleteMountTargetRequest, DeleteMountTargetResponse>(request, marshaller,
                                                                                     unmarshaller, cancellationToken));
        }
Esempio n. 4
0
        /// <summary>
        /// DeleteMountTarget接口的同步版本,本接口(DeleteMountTarget)用于删除挂载点
        /// </summary>
        /// <param name="req">参考<see cref="DeleteMountTargetRequest"/></param>
        /// <returns>参考<see cref="DeleteMountTargetResponse"/>实例</returns>
        public DeleteMountTargetResponse DeleteMountTargetSync(DeleteMountTargetRequest req)
        {
            JsonResponseModel <DeleteMountTargetResponse> rsp = null;

            try
            {
                var strResp = this.InternalRequestSync(req, "DeleteMountTarget");
                rsp = JsonConvert.DeserializeObject <JsonResponseModel <DeleteMountTargetResponse> >(strResp);
            }
            catch (JsonSerializationException e)
            {
                throw new TencentCloudSDKException(e.Message);
            }
            return(rsp.Response);
        }
        /**
         * Deletes a mount target and waits for it to be deleted.
         *
         * @param fsClient the service client used to communicate with the File Storage service
         * @param mountTarget the mount target to delete
         */
        private static async Task DeleteMountTarget(FileStorageClient fsClient, MountTarget mountTarget)
        {
            logger.Info("Deleting mount target");

            DeleteMountTargetRequest deleteRequest = new DeleteMountTargetRequest
            {
                MountTargetId = mountTarget.Id
            };
            await fsClient.DeleteMountTarget(deleteRequest);

            WaiterConfiguration waiterConfiguration = new WaiterConfiguration
            {
                MaxAttempts           = 20,
                GetNextDelayInSeconds = DelayStrategy.GetExponentialDelayInSeconds
            };
            GetMountTargetRequest getRequest = new GetMountTargetRequest
            {
                MountTargetId = mountTarget.Id
            };

            fsClient.Waiters.ForMountTarget(getRequest, waiterConfiguration, MountTarget.LifecycleStateEnum.Deleted).Execute();
        }
Esempio n. 6
0
 /// <summary>
 ///  -   删除挂载目标的同时会删除相关的网络接口。
 ///
 /// </summary>
 /// <param name="request">请求参数信息</param>
 /// <returns>请求结果信息</returns>
 public async Task <DeleteMountTargetResponse> DeleteMountTarget(DeleteMountTargetRequest request)
 {
     return(await new DeleteMountTargetExecutor().Client(this).Execute <DeleteMountTargetResponse, DeleteMountTargetResult, DeleteMountTargetRequest>(request).ConfigureAwait(false));
 }
Esempio n. 7
0
 /// <summary>
 ///  -   删除挂载目标的同时会删除相关的网络接口。
 ///
 /// </summary>
 /// <param name="request">请求参数信息</param>
 /// <returns>请求结果信息</returns>
 public DeleteMountTargetResponse DeleteMountTarget(DeleteMountTargetRequest request)
 {
     return(new DeleteMountTargetExecutor().Client(this).Execute <DeleteMountTargetResponse, DeleteMountTargetResult, DeleteMountTargetRequest>(request));
 }