Retrieve/List objects using metadata in s3 - aws sdk

耗尽温柔 提交于 2020-01-23 10:03:42

问题


I have used User-Defined Metadata data to store the file in S3 bucket. Lets say my meta data would be like

metaData = {
    "title": "some random user title", 
    "description": "some random user description"
}

I understand that i can download file using the object key and the bucket name. I am looking whether there any way/options to get/retrieve/list the file by passing only the bucket name and User-Defined Metadata used for the object to upload in S3.

And also to know the actual usage of User-Defined Metadata

Any guidance or suggestions would greatly helpful.!


回答1:


There is no native operation in Amazon S3 that can locate/retrieve objects via Metadata.

Metadata can be retrieved from objects, but cannot be used to search for objects. Also, only limited Metadata can be retrieved as part of an object listing.

An alternative would be to use Amazon S3 Inventory - Amazon Simple Storage Service. This only provides the listing once per day, but it can include metadata. You could use these files to locate objects based on metadata.

See:

  • Amazon S3 : Listing Obejct with Metadata in single request
  • Building and Maintaining an Amazon S3 Metadata Index without Servers | AWS Big Data Blog


来源:https://stackoverflow.com/questions/50174803/retrieve-list-objects-using-metadata-in-s3-aws-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!