Baidu AI Cloud
中国站

百度智能云

Object Storage

Delete Bucket

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:

Example

Below are the example codes for Java SDK:

public void deletebucket (BosClient client, String bucketName) { 
    // Delete bucket. 
    client.deletebucket(BucketName); 
} 
Previous
Create Bucket
Next
Acquisition of Bucket Region Information