Skip to content

delete_volume async

delete_volume(
    *,
    config_overrides: Optional[AsyncFSxClientConfig] = None,
    client_request_token: Optional[ClientRequestToken] = None,
    volume_id: Optional[VolumeId] = None,
    ontap_configuration: Optional[DeleteVolumeOntapConfiguration] = None,
    open_zfs_configuration: Optional[DeleteVolumeOpenZFSConfiguration] = None,
) -> DeleteVolumeResponse

Deletes an Amazon FSx for NetApp ONTAP or Amazon FSx for OpenZFS volume.

Parameters:

  • volume_id (Optional[VolumeId], default: None ) –

    The ID of the volume that you are deleting.

  • ontap_configuration (Optional[DeleteVolumeOntapConfiguration], default: None ) –

    For Amazon FSx for ONTAP volumes, specify whether to take a final backup of the volume and apply tags to the backup. To apply tags to the backup, you must have the fsx:TagResource permission.

  • open_zfs_configuration (Optional[DeleteVolumeOpenZFSConfiguration], default: None ) –

    For Amazon FSx for OpenZFS volumes, specify whether to delete all child volumes and snapshots.

Raises:

  • BadRequest –

    A generic error indicating a failure with a client request.

  • IncompatibleParameterError –

    The error returned when a second request is received with the same client request token but different parameters settings. A client request token should always uniquely identify a single request.

  • InternalServerError –

    A generic error indicating a server-side failure.

  • ServiceLimitExceeded –

    An error indicating that a particular service limit was exceeded. You can increase some service limits by contacting Amazon Web Services Support.

  • VolumeNotFound –

    No Amazon FSx volumes were found based upon the supplied parameters.

  • UnknownServiceError –

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

Source code in docs_src/capo_fsx/_services/async_f_sx.py
async def delete_volume(
    self,
    *,
    config_overrides: Optional[AsyncFSxClientConfig] = None,
    client_request_token: Optional[
        "capo_fsx.types.client_request_token.ClientRequestToken"
    ] = None,
    volume_id: Optional["capo_fsx.types.volume_id.VolumeId"] = None,
    ontap_configuration: Optional[
        "capo_fsx.types.delete_volume_ontap_configuration.DeleteVolumeOntapConfiguration"
    ] = None,
    open_zfs_configuration: Optional[
        "capo_fsx.types.delete_volume_open_zfs_configuration.DeleteVolumeOpenZFSConfiguration"
    ] = None,
) -> "capo_fsx.types.delete_volume_response.DeleteVolumeResponse":
    """<p>Deletes an Amazon FSx for NetApp ONTAP or Amazon FSx for OpenZFS volume.</p>

    Args:
        volume_id: <p>The ID of the volume that you are deleting.</p>
        ontap_configuration: <p>For Amazon FSx for ONTAP volumes, specify whether to take a final backup of the volume and apply tags to the backup. To apply tags to the backup, you must have the <code>fsx:TagResource</code> permission.</p>
        open_zfs_configuration: <p>For Amazon FSx for OpenZFS volumes, specify whether to delete all child volumes and snapshots.</p>

    Raises:
        capo_fsx.errors.bad_request.BadRequest: <p>A generic error indicating a failure with a client request.</p>
        capo_fsx.errors.incompatible_parameter_error.IncompatibleParameterError: <p>The error returned when a second request is received with the same client request token but different parameters settings. A client request token should always uniquely identify a single request.</p>
        capo_fsx.errors.internal_server_error.InternalServerError: <p>A generic error indicating a server-side failure.</p>
        capo_fsx.errors.service_limit_exceeded.ServiceLimitExceeded: <p>An error indicating that a particular service limit was exceeded. You can increase some service limits by contacting Amazon Web Services Support.</p>
        capo_fsx.errors.volume_not_found.VolumeNotFound: <p>No Amazon FSx volumes were found based upon the supplied parameters.</p>
        capo_fsx.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_fsx.types.delete_volume_request.DeleteVolumeRequest]",
    ) -> AsyncOperationResponse[
        "capo_fsx.types.delete_volume_response.DeleteVolumeResponse"
    ]:
        import capo_fsx._operations.aws_simba_api_service_v20180301.delete_volume

        (
            output,
            http_response,
        ) = await capo_fsx._operations.aws_simba_api_service_v20180301.delete_volume.async_delete_volume(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteVolume")
    )
    input_: capo_fsx.types.delete_volume_request.DeleteVolumeRequest = {}
    if client_request_token is None:
        client_request_token = str(uuid.uuid4())
    input_["client_request_token"] = client_request_token
    if volume_id is not None:
        input_["volume_id"] = volume_id
    if ontap_configuration is not None:
        input_["ontap_configuration"] = ontap_configuration
    if open_zfs_configuration is not None:
        input_["open_zfs_configuration"] = open_zfs_configuration

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