Retrieves configuration and metadata for a specified bucket.
Prerequisites
Before you begin, ensure that you have:
Bucket owner access to the target bucket
The
oss:GetBucketInfopermission. For details, see Attach a custom policy to a RAM user
Syntax
ossutil api get-bucket-info --bucket <value> [--output-format <value>] [flags]Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
--bucket | string | Yes | — | The name of the bucket. |
For global flags (such as --profile, --endpoint, and --region), see Command-line options.
Examples
Query bucket information in the default table format:
ossutil api get-bucket-info --bucket examplebucketQuery bucket information in JSON format:
ossutil api get-bucket-info --bucket examplebucket --output-format jsonQuery bucket information in YAML format:
ossutil api get-bucket-info --bucket examplebucket --output-format yamlUsage notes
Only the bucket owner can query bucket information. You can run this command from any Object Storage Service (OSS) endpoint.