Skip to content

Commit

Permalink
Merge pull request #3918 from orf/patch-1
Browse files Browse the repository at this point in the history
Use list_objects_v2 in the boto3 paginators docs
  • Loading branch information
nateprewitt authored Dec 7, 2023
2 parents 4e454c2 + 2dc6f80 commit 1fc9bf0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/source/guide/paginators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ underlying API operation. The ``paginate`` method then returns an iterable
client = boto3.client('s3', region_name='us-west-2')

# Create a reusable Paginator
paginator = client.get_paginator('list_objects')
paginator = client.get_paginator('list_objects_v2')

# Create a PageIterator from the Paginator
page_iterator = paginator.paginate(Bucket='my-bucket')
Expand All @@ -46,7 +46,7 @@ the pages of API operation results. The ``paginate`` method accepts a
``PaginationConfig`` named argument that can be used to customize the
pagination::

paginator = client.get_paginator('list_objects')
paginator = client.get_paginator('list_objects_v2')
page_iterator = paginator.paginate(Bucket='my-bucket',
PaginationConfig={'MaxItems': 10})

Expand Down Expand Up @@ -81,7 +81,7 @@ to the client::
import boto3
client = boto3.client('s3', region_name='us-west-2')
paginator = client.get_paginator('list_objects')
paginator = client.get_paginator('list_objects_v2')
operation_parameters = {'Bucket': 'my-bucket',
'Prefix': 'foo/baz'}
page_iterator = paginator.paginate(**operation_parameters)
Expand All @@ -102,7 +102,7 @@ JMESPath expressions that are applied to each page of results through the
import boto3
client = boto3.client('s3', region_name='us-west-2')
paginator = client.get_paginator('list_objects')
paginator = client.get_paginator('list_objects_v2')
page_iterator = paginator.paginate(Bucket='my-bucket')
filtered_iterator = page_iterator.search("Contents[?Size > `100`][]")
for key_data in filtered_iterator:
Expand Down

0 comments on commit 1fc9bf0

Please sign in to comment.