All Products
Search
Document Center

Object Storage Service:get-bucket-tags

Last Updated:Mar 20, 2026

Retrieves the tags configured for a bucket.

Usage notes

By default, an Alibaba Cloud account has the permissions to query the tags of a bucket. To run this command as a RAM user or using Security Token Service (STS), attach a policy that grants the oss:GetBucketTags permission. For details, see Attach a custom policy to a RAM user.

Syntax

ossutil api get-bucket-tags --bucket <value> [flags]

Parameters

ParameterTypeRequiredDescription
--bucketstringYesThe name of the bucket.
For global flags supported by all ossutil commands, see Global command-line options.

This command maps to the GetBucketTags API operation. For the full parameter reference, see GetBucketTags.

Examples

Get bucket tags (default output)

ossutil api get-bucket-tags --bucket examplebucket

Get bucket tags in JSON format

ossutil api get-bucket-tags --bucket examplebucket --output-format json

Get bucket tags in YAML format

ossutil api get-bucket-tags --bucket examplebucket --output-format yaml