Fetching user defined object metadata in ListObjectsV2 or one request

0

I have objects uploaded to S3 with user defined object metadata: https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingMetadata.html#UserMetadata I want to get a list of all the object key names along with their custom metadata given a key prefix. I am using ListObjectsV2 command with the given prefix to first get all the object keys and then making a request to HeadObject given the specific key to get the user defined object metadata.

Is there a way to get the user defined object metadata with only one request given key prefix and bucket name?

Additional notes: I am using the Javascript SDK. I am able to get the user defined metadata on the object by making a request to https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/s3/command/ListObjectsV2Command/ and then using the keys from the result, make the https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/s3/command/HeadObjectCommand/ request to get the user defined metadata. I am looking for a way to do this in one request instead because ListObjectsV2Command is returning some metadata already like LastModified, Size, StorageClass and ETag, just not user defined obj metadata

No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions