get-object-tagging
The command get-object-tagging is used to query the tags of an object.
Usage notes
-
By default, an Alibaba Cloud account has the permissions to query the tags of an object. Making query requests as a RAM user or by using Security Token Service (STS) requires
oss:GetObjectTaggingpermissions. For more information, see Grant a custom policy. -
By default, the command get-object-tagging queries the tags of the current version of an object. You can specify a version ID in the request to query tags of a specified version.
Command syntax
ossutil api get-object-tagging --bucket value --key value [flags]
|
Parameter |
Type |
Description |
|
--bucket |
string |
Bucket name. |
|
--key |
string |
Full path of the object. |
|
--version-id |
string |
Version ID of the object. |
-
The get-object-tagging command corresponds to the GetObjectTagging operation. For more information about the parameters in the GetObjectTagging operation, see GetObjectTagging.
-
For more information about supported global command-line options, see Command-line options.
Examples
-
Query the tags of
examplebucket.ossutil api get-object-tagging --bucket examplebucket --key exampleobject -
Query the tags of
examplebucketand display the result in the JSON format.ossutil api get-object-tagging --bucket examplebucket --key exampleobject --output-format json -
Query the tags of
examplebucketand display the result in the YAML format.ossutil api get-object-tagging --bucket examplebucket --key exampleobject --output-format yaml