Quantcast
Channel: Active questions tagged amazon-s3 - DevOps Stack Exchange
Viewing all articles
Browse latest Browse all 73

S3 ListObjectsV2 api call not returning contents

$
0
0

According to the ListObjectsV2 documentation in https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html#:~:text=Prefix%3E%0A%20%20%3C/CommonPrefixes%3E%0A%3C/ListBucketResult%3E-,Sample%20Request,-The%20following%20request, when I specify a prefix and a delimiter, I should get a contents element in the response with an ETag for the prefix.

<Contents><Key>photos/2006/</Key><LastModified>2016-04-30T23:51:29.000Z</LastModified><ETag>"d41d8cd98f00b204e9800998ecf8427e"</ETag><Size>0</Size><StorageClass>STANDARD</StorageClass></Contents>

I have tried to run this using the python sdk (boto3).

client.list_objects_v2(Bucket='bucketname', Prefix = "folder1-folder2-", Delimiter = "-")

But in the response dict, I dont find a contents key. All the others fields as per the response in the example are present.

dict_keys(['ResponseMetadata', 'IsTruncated', 'Name', 'Prefix', 'Delimiter', 'MaxKeys', 'CommonPrefixes', 'EncodingType', 'KeyCount'])

Is this something which is no longer in the response of the API call. Or is this something the SDK doenst show.And a follow up question, if it is something on the sdk side, how do I make an api call that returns me this field.


Viewing all articles
Browse latest Browse all 73

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>