Delete Bucket
Last Updated:2020-10-21
Basic Introduction
Due to limited quota (100 currently) of bucket created by a user, if a certain bucket is no longer used, the user can delete such bucket to release the quota.
Note
- Deleting a bucket may affect related users and services, please be prudent.
- You can only delete a bucket when the present bucket is empty, that is, does not contain any object and uncompleted three-step upload Part, otherwise you will see a corresponding prompt. To directly delete a non-empty bucket, you can use the force delete command through CLI Tools.
bce bos rb bos:/<bucket-name> --force
Operation Method
BOS supports deleting a bucket through both API and SDK, as shown below:
- Delete a Bucket through DeleteBucket API Interface
-
Delete a bucket through SDK
Example
Below are the example codes for Java SDK:
public void deletebucket (BosClient client, String bucketName) {
// Delete bucket.
client.deletebucket(BucketName);
}