Retrieving object metadata from directory buckets
The following AWS SDK and AWS CLI examples show how to use the HeadObject and GetObjectAttributes
API operation to retrieve metadata from an object in an Amazon S3 directory bucket without
returning the object itself.
The following head-object example command shows how you can use the AWS CLI to
retrieve metadata from an object. To run this command, replace the
with your own information.user input placeholders
aws s3api head-object --bucketbucket-base-name--zone-id--x-s3 --keyKEY_NAME
For more information, see head-object
The following get-object-attributes example command shows how you can use the AWS CLI to
retrieve metadata from an object. To run this command, replace the
with your own information.user input placeholders
aws s3api get-object-attributes --bucketbucket-base-name--zone-id--x-s3 --keyKEY_NAME--object-attributes "StorageClass" "ETag" "ObjectSize"
For more information, see get-object-attributes