exam questions

Exam AWS Certified Developer Associate All Questions

View all questions & answers for the AWS Certified Developer Associate exam

Exam AWS Certified Developer Associate topic 1 question 246 discussion

Exam question from Amazon's AWS Certified Developer Associate
Question #: 246
Topic #: 1
[All AWS Certified Developer Associate Questions]

A developer uses the Amazon S3 ListObjectsV2 API call to retrieve and list object keys from an S3 bucket. The list can contain thousands of keys, and the retrieval often returns more than the max-keys maximum value. The code must handle any number of returned results.

How can the developer modify the code to handle any number of returns?

  • A. Set max-keys in the ListObjectsV2 API call to the expected number of returned objects.
  • B. Set max-keys in the ListObjectsV2 API call to -1.
  • C. Run an S3 Select query to retrieve and list object keys from the bucket.
  • D. When applicable, repeat the ListObjectsV2 API call by using NextContinuationToken.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
k1kavi1
Highly Voted 2 years, 7 months ago
Selected Answer: D
Choosing D - code must handle any number of returned results
upvoted 5 times
...
rcaliandro
Most Recent 2 years ago
I didn't know that
upvoted 1 times
...
pranay_2406
2 years, 1 month ago
Selected Answer: D
D. When applicable, repeat the ListObjectsV2 API call by using NextContinuationToken. The ListObjectsV2 API call in Amazon S3 returns a maximum of 1000 objects per response. If there are more objects in the bucket, the response will include a NextContinuationToken. To retrieve the remaining objects, you need to make subsequent ListObjectsV2 API calls using the NextContinuationToken provided in the previous response. By using the NextContinuationToken in subsequent API calls, you can handle any number of returned results efficiently, regardless of the total number of objects in the S3 bucket.
upvoted 4 times
...
Ankit1010
2 years, 4 months ago
D. When applicable, repeat the ListObjectsV2 API call by using NextContinuationToken. To handle any number of returned results from the ListObjectsV2 API call, the developer can use pagination. Amazon S3 supports pagination of responses through the use of a continuation token, which enables the listing of more objects beyond the number specified in the initial request. The NextContinuationToken is a token that is returned in the response of the ListObjectsV2 API call when there are more objects to retrieve. The token can be used to retrieve the next set of objects until all the objects in the bucket have been listed. Therefore, the developer should modify the code to repeat the ListObjectsV2 API call, using the NextContinuationToken returned in each response until all the objects have been listed. The max-keys parameter should be set to a reasonable value that is less than or equal to the expected number of returned objects. This ensures that the API response is not overwhelming and helps the developer to manage the data more efficiently.
upvoted 1 times
...
fswklotto1
2 years, 7 months ago
Selected Answer: D
Vote for D
upvoted 2 times
...
lrom
2 years, 7 months ago
Selected Answer: D
It asks to "to handle any number of returns" , I think is D: NextContinuationToken is sent when isTruncated is true, which means there are more keys in the bucket that can be listed. The next list requests to Amazon S3 can be continued with this NextContinuationToken. https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html
upvoted 3 times
...
michaldavid
2 years, 7 months ago
Selected Answer: A
max-keys sets the maximum number of keys returned in the response. By default the action returns up to 1,000 key names. The response might contain fewer keys but will never contain more.
upvoted 1 times
...
kapil206001
2 years, 7 months ago
A https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...