View Bucket List
Last Updated:2020-11-11
Basic Introduction
After creating a bucket, you can view a list of all buckets you own.
Operation Method
BOS supports listing the bucket through the console, SDK, and API, as shown below:
-
List buckets through the console
- Log in to the MMC and enter "Storage and CDN > Baidu Object Storage".
- You can view all buckets you own in "Storage Management" on the left side of the console page.
-
List buckets through SDK
- List all Buckets through ListBucket Interface
Example
Below are the example codes for Java SDK:
public void listbuckets (BosClient client) {
// Get the user's bucket list.
List<BucketSummary> buckets = client.listBuckets().getBuckets();
// Traverse all buckets.
for (BucketSummary bucket : buckets) {
System.out.println(bucket.getName());
}
}