Skip to content

delete_file_share

delete_file_share(
    file_share_arn: FileShareARN,
    *,
    config_overrides: Optional[StorageGatewayClientConfig] = 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/storage_gateway.py
def delete_file_share(
    self,
    file_share_arn: "capo_storage_gateway.types.file_share_arn.FileShareARN",
    *,
    config_overrides: Optional[StorageGatewayClientConfig] = 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.
    """

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

        output, http_response = (
            capo_storage_gateway._operations.storage_gateway_20130630.delete_file_share.delete_file_share(
                req.options, req.input
            )
        )
        return OperationResponse(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 = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output