Queries the tags configured for a bucket.
Usage notes
By default, an Alibaba Cloud account has the permissions to query the tags of a bucket. If you want to use a RAM user or Security Token Service (STS) to query the tags of a bucket, you must have the oss:GetBucketTags permission. For more information, see Attach a custom policy to a RAM user.
Command syntax
ossutil api get-bucket-tags --bucket value [flags]Parameter | Type | Description |
--bucket | string | The name of the bucket whose tags you want to query. |
The get-bucket-tags command corresponds to the GetBucketTags operation. For more information about the parameters in the GetBucketTags operation, see GetBucketTags.
For more information about supported global command-line options, see Global command-line options.
Examples
Run the following command to obtain the tags of a bucket named examplebucket:
ossutil api get-bucket-tags --bucket examplebucketRun the following command to obtain the tags of a bucket named examplebucket and display the tags in the JSON format:
ossutil api get-bucket-tags --bucket examplebucket --output-format jsonRun the following command to obtain the tags of a bucket named examplebucket and display the tags in the YAML format:
ossutil api get-bucket-tags --bucket examplebucket --output-format yaml