get-object-meta
The get-object-meta command is used to query the metadata of an object, which includes ETag, Size, and LastModified. The content of the object is not returned.
Usage notes
-
By default, an Alibaba Cloud account has the permissions to query the metadata of an object. Making query requests as a RAM user or by using Security Token Service (STS) requires
oss:GetObjectpermission. For more information, see Grant a custom policy. -
The metadata of an object includes ETag, Size, and LastModified. The content of the object is not returned. If the object is a symbolic link, the information about the symbolic link is returned.
Command syntax
ossutil api get-object-meta --bucket value --key value [flags]
|
Parameter |
Type |
Description |
|
--bucket |
string |
Name of the bucket. |
|
--key |
string |
Full path of the object. |
|
--version-id |
string |
Version ID of the metadata of the object. |
-
The get-object-meta command corresponds to the GetObjectMeta operation. For more information about the parameters in the GetObjectMeta operation, see GetObjectMeta.
-
For more information about supported global command-line options, see Command-line options.
Examples
-
Query a portion of the metadata of
exampleobject.ossutil api get-object-meta --bucket examplebucket --key exampleobject -
Query a portion of the metadata of
exampleobjectand display the output in the JSON format.ossutil api get-object-meta --bucket examplebucket --key exampleobject --output-format json -
Query a portion of the metadata of
exampleobject, whose version ID is 123.ossutil api get-object-meta --bucket examplebucket --key exampleobject --version-id 123