IPWorks Cloud 2020 Python Edition

Questions / Feedback?

delete_file Method

Deletes all versions of a file.

Syntax

def delete_file(bucket_id: str, file_name: str) -> None: ...

Remarks

This method deletes all versions of the file named FileName from the bucket specified by BucketId. If the latest "version" of the specified file is an incomplete multipart upload, the multipart upload is aborted.

The currently-authenticated application key must have the listFiles and deleteFiles capabilities to call this method successfully, otherwise the server will return an error. Refer to the account_capabilities property for more information.

Note: This method is offered as a convenience, as the Backblaze B2 REST API does not technically provide a way to delete all versions of a file using a single request. When this method is called, the class uses list_file_versions to obtain a list of all versions of the specified file, and then uses delete_file_version to delete each one, in order from oldest to newest. If any one request made during this process fails, this method will fail immediately. This process does not alter the File* or file_marker properties, nor does it cause the on_file_list event to fire.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks Cloud 2020 Python Edition - Version 20.0 [Build 8265]