Updated on 2026-08-21 GMT+08:00

Listing Buckets

When an account contains a large number of buckets, manual management becomes inefficient and error-prone. The bucket listing function allows you to obtain a list of all buckets under your account, making it easier to perform tasks such as bucket counting, batch operations, and permission audits. This improves both the efficiency and accuracy of bucket management.

Important Notes

Bucket listing requests default to the CN North-Beijing1 region. Therefore, the costs for the ListAllMyBucketsOperation requests are billed to this region. Listing buckets may also involve data transfer, which incurs traffic charges. For details, see Data Transfer.

Constraints

To list all buckets in an account, you must have the obs:bucket:ListAllMyBuckets permission for all buckets. For details, see Using IAM Roles or Policies to Grant Access to OBS. The following example shows an IAM policy that grants the obs:bucket:ListAllMyBuckets permission for all buckets.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
{
    "Version": "5.0",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "obs:bucket:ListAllMyBuckets"
            ],
            "Resource": [
                "obs:*:*:bucket:*"
            ]
        }
    ]
}

ListAllMyBuckets is considered high-risk because it may expose bucket names. Exercise caution when granting or using this permission.

Ways to List Buckets

You can use OBS Console, APIs, SDKs, OBS Browser+, or obsutil to list buckets.

Logging and Monitoring

OBS provides logging and monitoring features that help you detect and handle deletion operations promptly. CTS can trace bucket-listing operations, including listAllMyBuckets and REST.GET.SERVICE. Bucket-listing logs provide detailed records for auditing or further analysis. For configuration details, see Monitoring and Logging.