Container for the parameters to the DeleteMountTarget operation. Deletes the specified mount target.

This operation forcibly breaks any mounts of the file system via the mount target that is 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 via another mount target.

This operation requires permissions for the following action on the file system:

  • elasticfilesystem:DeleteMountTarget

The DeleteMountTarget call returns while the mount target state is still deleting. You can check the mount target deletion by calling the DescribeMountTargets operation, which returns a list of mount target descriptions for the given file system.

The operation also requires permissions for the following Amazon EC2 action on the mount target's network interface:

  • ec2:DeleteNetworkInterface

Inheritance: AmazonElasticFileSystemRequest
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.ElasticFileSystem.Model.DeleteMountTargetRequest();

            if (cmdletContext.MountTargetId != null)
            {
                request.MountTargetId = cmdletContext.MountTargetId;
            }

            CmdletOutput output;

            // issue call
            var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);

            try
            {
                var    response       = CallAWSServiceOperation(client, request);
                object pipelineOutput = null;
                pipelineOutput = cmdletContext.Select(response, this);
                output         = new CmdletOutput
                {
                    PipelineOutput  = pipelineOutput,
                    ServiceResponse = response
                };
            }
            catch (Exception e)
            {
                output = new CmdletOutput {
                    ErrorResponse = e
                };
            }

            return(output);
        }
        /// <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);
        }
        internal DeleteMountTargetResponse DeleteMountTarget(DeleteMountTargetRequest request)
        {
            var marshaller = new DeleteMountTargetRequestMarshaller();
            var unmarshaller = DeleteMountTargetResponseUnmarshaller.Instance;

            return Invoke<DeleteMountTargetRequest,DeleteMountTargetResponse>(request, marshaller, unmarshaller);
        }
 /// <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);
 }
        /// <summary>
        /// Initiates the asynchronous execution of the DeleteMountTarget operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DeleteMountTarget operation on AmazonElasticFileSystemClient.</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 EndDeleteMountTarget
        ///         operation.</returns>
        public IAsyncResult BeginDeleteMountTarget(DeleteMountTargetRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new DeleteMountTargetRequestMarshaller();
            var unmarshaller = DeleteMountTargetResponseUnmarshaller.Instance;

            return BeginInvoke<DeleteMountTargetRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
 /// <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>
 /// 
 /// <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 is found in the caller's
 /// account.
 /// </exception>
 public DeleteMountTargetResponse DeleteMountTarget(string mountTargetId)
 {
     var request = new DeleteMountTargetRequest();
     request.MountTargetId = mountTargetId;
     return DeleteMountTarget(request);
 }
 private Amazon.ElasticFileSystem.Model.DeleteMountTargetResponse CallAWSServiceOperation(IAmazonElasticFileSystem client, Amazon.ElasticFileSystem.Model.DeleteMountTargetRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Elastic File System", "DeleteMountTarget");
     try
     {
         #if DESKTOP
         return(client.DeleteMountTarget(request));
         #elif CORECLR
         return(client.DeleteMountTargetAsync(request).GetAwaiter().GetResult());
         #else
                 #error "Unknown build edition"
         #endif
     }
     catch (AmazonServiceException exc)
     {
         var webException = exc.InnerException as System.Net.WebException;
         if (webException != null)
         {
             throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
         }
         throw;
     }
 }