- Documentation
Torch Object Storage
SDK Reference
Python
Bucket interface
Basic bucket interface
Delete bucket (Python SDK)
Basic bucket interface
Delete bucket (Python SDK)
Delete bucket (Python SDK)
When you no longer need to keep a bucket, you can delete it to avoid incurring additional charges.
Precautions
- After the bucket is deleted, it cannot be recovered. Please proceed with caution.
- Before you can delete a bucket, you must have the tos: DeleteBucketpermission. For specific operations, please refer to Overview.
Prerequisite
Before deleting a bucket, make sure you have deleted all the data in the bucket.
- If the bucket has version control turned on, make sure that all current version and history objects in the current bucket have been deleted. For specific operations, please refer to Permanently deleting a file.
- If there are unmerged shardings in the bucket, make sure to delete all sharding data. For details, see Managing Parts.
- If there are many objects in the bucket, you can set the bulk deletion of objects through the life cycle rule. For specific operations, please refer to Setting Lifecycle Rules.
Sample code
The following code is used to remove bucket-test.
Related documentation
For API documentation on deleting buckets, see DeleteBucket.
Last updated: 2025.09.17 18:22:12