Skip to content

delete_file_share async

delete_file_share(
    file_share_arn: FileShareARN,
    *,
    config_overrides: Optional[AsyncStorageGatewayClientConfig] = None,
    force_delete: Optional[Boolean2] = None,
) -> DeleteFileShareOutput

Deletes a file share from an S3 File Gateway. This operation is only supported for S3 File Gateways.

Parameters:

  • file_share_arn (FileShareARN) –

    The Amazon Resource Name (ARN) of the file share to be deleted.

  • force_delete (Optional[Boolean2], default: None ) –

    If this value is set to true, the operation deletes a file share immediately and aborts all data uploads to Amazon Web Services. Otherwise, the file share is not deleted until all data is uploaded to Amazon Web Services. This process aborts the data upload process, and the file share enters the FORCE_DELETING status.

    Valid Values: true | false

Raises:

  • InternalServerError –

    An internal server error has occurred during the request. For more information, see the error and message fields.

  • InvalidGatewayRequestException –

    An exception occurred because an invalid gateway request was issued to the service. For more information, see the error and message fields.

  • UnknownServiceError –

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

Source code in docs_src/capo_storage_gateway/_services/async_storage_gateway.py
async def delete_file_share(
    self,
    file_share_arn: "capo_storage_gateway.types.file_share_arn.FileShareARN",
    *,
    config_overrides: Optional[AsyncStorageGatewayClientConfig] = None,
    force_delete: Optional["capo_storage_gateway.types.boolean2.Boolean2"] = None,
) -> "capo_storage_gateway.types.delete_file_share_output.DeleteFileShareOutput":
    """<p>Deletes a file share from an S3 File Gateway. This operation is only supported for S3 File Gateways.</p>

    Args:
        file_share_arn: <p>The Amazon Resource Name (ARN) of the file share to be deleted.</p>
        force_delete: <p>If this value is set to <code>true</code>, the operation deletes a file share immediately and aborts all data uploads to Amazon Web Services. Otherwise, the file share is not deleted until all data is uploaded to Amazon Web Services. This process aborts the data upload process, and the file share enters the <code>FORCE_DELETING</code> status.</p> <p>Valid Values: <code>true</code> | <code>false</code> </p>

    Raises:
        capo_storage_gateway.errors.internal_server_error.InternalServerError: <p>An internal server error has occurred during the request. For more information, see the error and message fields.</p>
        capo_storage_gateway.errors.invalid_gateway_request_exception.InvalidGatewayRequestException: <p>An exception occurred because an invalid gateway request was issued to the service. For more information, see the error and message fields.</p>
        capo_storage_gateway.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_storage_gateway.types.delete_file_share_input.DeleteFileShareInput]",
    ) -> AsyncOperationResponse[
        "capo_storage_gateway.types.delete_file_share_output.DeleteFileShareOutput"
    ]:
        import capo_storage_gateway._operations.storage_gateway_20130630.delete_file_share

        (
            output,
            http_response,
        ) = await capo_storage_gateway._operations.storage_gateway_20130630.delete_file_share.async_delete_file_share(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteFileShare")
    )
    input_: capo_storage_gateway.types.delete_file_share_input.DeleteFileShareInput = {
        "file_share_arn": file_share_arn
    }
    if force_delete is not None:
        input_["force_delete"] = force_delete

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