- Documentation
Torch Object Storage
SDK Reference
C++
Bucket Interface
Basic Bucket Interface
Deleting a Bucket (C++ SDK)
Basic Bucket Interface
Deleting a Bucket (C++ SDK)
Deleting a Bucket (C++ SDK)
When you no longer need to retain a bucket (Bucket), you may delete it to avoid incurring additional charges.
Precautions
- Once a bucket is deleted, it cannot be restored. Please proceed with caution.
- Before deleting a bucket, you must have the tos:DeleteBucket permission. For detailed instructions, please refer to the Permission Configuration Guide.
Prerequisites
Before deleting a bucket, ensure that all data within the bucket has been removed.
- If versioning is enabled for the bucket, please ensure that all current and historical version objects within the bucket have been deleted. For detailed instructions, see Delete Object.
- If there are unmerged shards in the bucket, ensure that all shard data is deleted. For specific operations, refer to Delete Shard.
- If your bucket contains a large number of objects, you can configure lifecycle rules to enable batch deletion of objects. For detailed instructions, please refer to Setting Lifecycle Rules.
Sample Code
The following code is used to delete the bucket examplebucket.
Relevant Documentation
For API documentation on deleting buckets, refer to DeleteBucket. Last updated: 2025.09.25 14:22:45