Skip to content

delete_mount_target async

delete_mount_target(
    mount_target_id: MountTargetId,
    *,
    config_overrides: Optional[AsyncEFSClientConfig] = None,
) -> None

Deletes the specified mount target.

This operation forcibly breaks any mounts of the file system by using 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 might 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 by using 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

Parameters:

  • mount_target_id (MountTargetId) –

    The ID of the mount target to delete (String).

Raises:

  • BadRequest –

    Returned if the request is malformed or contains an error such as an invalid parameter value or a missing required parameter.

  • DependencyTimeout –

    The service timed out trying to fulfill the request, and the client should try the call again.

  • InternalServerError –

    Returned if an error occurred on the server side.

  • MountTargetNotFound –

    Returned if there is no mount target with the specified ID found in the caller's Amazon Web Services account.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

To delete a mount target This operation deletes a mount target.

>>> await client.delete_mount_target(mount_target_id='fsmt-12340abc')
Source code in docs_src/capo_efs/_services/async_efs.py
async def delete_mount_target(
    self,
    mount_target_id: "capo_efs.types.mount_target_id.MountTargetId",
    *,
    config_overrides: Optional[AsyncEFSClientConfig] = None,
) -> None:
    """<p>Deletes the specified mount target.</p> <p>This operation forcibly breaks any mounts of the file system by using 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 might 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 by using another mount target.</p> <p>This operation requires permissions for the following action on the file system:</p> <ul> <li> <p> <code>elasticfilesystem:DeleteMountTarget</code> </p> </li> </ul> <note> <p>The <code>DeleteMountTarget</code> call returns while the mount target state is still <code>deleting</code>. You can check the mount target deletion by calling the <a>DescribeMountTargets</a> operation, which returns a list of mount target descriptions for the given file system. </p> </note> <p>The operation also requires permissions for the following Amazon EC2 action on the mount target's network interface:</p> <ul> <li> <p> <code>ec2:DeleteNetworkInterface</code> </p> </li> </ul>

    Args:
        mount_target_id: <p>The ID of the mount target to delete (String).</p>

    Raises:
        capo_efs.errors.bad_request.BadRequest: <p>Returned if the request is malformed or contains an error such as an invalid parameter value or a missing required parameter.</p>
        capo_efs.errors.dependency_timeout.DependencyTimeout: <p>The service timed out trying to fulfill the request, and the client should try the call again.</p>
        capo_efs.errors.internal_server_error.InternalServerError: <p>Returned if an error occurred on the server side.</p>
        capo_efs.errors.mount_target_not_found.MountTargetNotFound: <p>Returned if there is no mount target with the specified ID found in the caller's Amazon Web Services account.</p>
        capo_efs.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To delete a mount target
        This operation deletes a mount target.

        >>> await client.delete_mount_target(mount_target_id='fsmt-12340abc')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_efs.types.delete_mount_target_request.DeleteMountTargetRequest]",
    ) -> AsyncOperationResponse[None]:
        import capo_efs._operations.magnolio_api_service_v20150201.delete_mount_target

        (
            output,
            http_response,
        ) = await capo_efs._operations.magnolio_api_service_v20150201.delete_mount_target.async_delete_mount_target(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteMountTarget")
    )
    input_: capo_efs.types.delete_mount_target_request.DeleteMountTargetRequest = {
        "mount_target_id": mount_target_id
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output