Skip to content

Commit

Permalink
Altered pagination to use more_results.
Browse files Browse the repository at this point in the history
  • Loading branch information
toastdriven committed Feb 13, 2014
1 parent 2009432 commit 024af41
Show file tree
Hide file tree
Showing 18 changed files with 417 additions and 135 deletions.
16 changes: 8 additions & 8 deletions botocore/data/aws/cloudfront.json
Original file line number Diff line number Diff line change
Expand Up @@ -5298,7 +5298,7 @@
"Marker"
],
"limit_key": "MaxItems",
"more_key": "IsTruncated",
"more_results": "IsTruncated",
"output_token": [
"NextMarker"
],
Expand Down Expand Up @@ -6001,7 +6001,7 @@
"Marker"
],
"limit_key": "MaxItems",
"more_key": "IsTruncated",
"more_results": "IsTruncated",
"output_token": [
"NextMarker"
],
Expand Down Expand Up @@ -6162,7 +6162,7 @@
"Marker"
],
"limit_key": "MaxItems",
"more_key": "IsTruncated",
"more_results": "IsTruncated",
"output_token": [
"NextMarker"
],
Expand Down Expand Up @@ -6397,7 +6397,7 @@
"Marker"
],
"limit_key": "MaxItems",
"more_key": "IsTruncated",
"more_results": "IsTruncated",
"output_token": [
"NextMarker"
],
Expand Down Expand Up @@ -8895,7 +8895,7 @@
"Marker"
],
"limit_key": "MaxItems",
"more_key": "IsTruncated",
"more_results": "IsTruncated",
"output_token": [
"NextMarker"
],
Expand All @@ -8909,7 +8909,7 @@
"Marker"
],
"limit_key": "MaxItems",
"more_key": "IsTruncated",
"more_results": "IsTruncated",
"output_token": [
"NextMarker"
],
Expand All @@ -8923,7 +8923,7 @@
"Marker"
],
"limit_key": "MaxItems",
"more_key": "IsTruncated",
"more_results": "IsTruncated",
"output_token": [
"NextMarker"
],
Expand All @@ -8937,7 +8937,7 @@
"Marker"
],
"limit_key": "MaxItems",
"more_key": "IsTruncated",
"more_results": "IsTruncated",
"output_token": [
"NextMarker"
],
Expand Down
64 changes: 32 additions & 32 deletions botocore/data/aws/iam.json

Large diffs are not rendered by default.

20 changes: 19 additions & 1 deletion botocore/data/aws/importexport.json
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,15 @@
"documentation": "\n The AWS Access Key ID specified in the request did not match the manifest's\n accessKeyId value. The manifest and the request authentication must use the\n same AWS Access Key ID.\n "
}
],
"documentation": "\n This operation returns the jobs associated with the requester. AWS\n Import/Export lists the jobs in reverse chronological order based on the\n date of creation. For example if Job Test1 was created 2009Dec30 and Test2\n was created 2010Feb05, the ListJobs operation would return Test2 followed\n by Test1.\n "
"documentation": "\n This operation returns the jobs associated with the requester. AWS\n Import/Export lists the jobs in reverse chronological order based on the\n date of creation. For example if Job Test1 was created 2009Dec30 and Test2\n was created 2010Feb05, the ListJobs operation would return Test2 followed\n by Test1.\n ",
"pagination": {
"input_token": "Marker",
"output_token": "Jobs[-1].JobId",
"more_results": "IsTruncated",
"limit_key": "MaxJobs",
"result_key": "Jobs",
"py_input_token": "marker"
}
},
"UpdateJob": {
"name": "UpdateJob",
Expand Down Expand Up @@ -881,6 +889,16 @@
"https"
]
},
"pagination": {
"ListJobs": {
"input_token": "Marker",
"output_token": "Jobs[-1].JobId",
"more_results": "IsTruncated",
"limit_key": "MaxJobs",
"result_key": "Jobs",
"py_input_token": "marker"
}
},
"retry": {
"__default__": {
"max_attempts": 5,
Expand Down
54 changes: 51 additions & 3 deletions botocore/data/aws/kinesis.json

Large diffs are not rendered by default.

98 changes: 64 additions & 34 deletions botocore/data/aws/rds.json

Large diffs are not rendered by default.

80 changes: 77 additions & 3 deletions botocore/data/aws/route53.json
Original file line number Diff line number Diff line change
Expand Up @@ -1665,7 +1665,15 @@
"documentation": "\n <p>The resource you are trying to access is unsupported on this Route 53 endpoint. Please consider using a newer endpoint or a tool that does so.</p>\n "
}
],
"documentation": "\n <p> To retrieve a list of your health checks, send a <code>GET</code> request to the <code>2013-04-01/healthcheck</code> resource. The response to this request includes a <code>HealthChecks</code> element with zero, one, or multiple <code>HealthCheck</code> child elements. By default, the list of health checks is displayed on a single page. You can control the length of the page that is displayed by using the <code>MaxItems</code> parameter. You can use the <code>Marker</code> parameter to control the health check that the list begins with. </p>\n <note> Amazon Route 53 returns a maximum of 100 items. If you set MaxItems to a value greater than 100, Amazon Route 53 returns only the first 100.</note>\n "
"documentation": "\n <p> To retrieve a list of your health checks, send a <code>GET</code> request to the <code>2013-04-01/healthcheck</code> resource. The response to this request includes a <code>HealthChecks</code> element with zero, one, or multiple <code>HealthCheck</code> child elements. By default, the list of health checks is displayed on a single page. You can control the length of the page that is displayed by using the <code>MaxItems</code> parameter. You can use the <code>Marker</code> parameter to control the health check that the list begins with. </p>\n <note> Amazon Route 53 returns a maximum of 100 items. If you set MaxItems to a value greater than 100, Amazon Route 53 returns only the first 100.</note>\n ",
"pagination": {
"input_token": "Marker",
"output_token": "NextMarker",
"more_results": "IsTruncated",
"limit_key": "MaxItems",
"result_key": "HealthChecks",
"py_input_token": "marker"
}
},
"ListHostedZones": {
"name": "ListHostedZones",
Expand Down Expand Up @@ -1814,7 +1822,15 @@
"documentation": "\n <p>Some value specified in the request is invalid or the XML document is malformed.</p>\n "
}
],
"documentation": "\n <p> To retrieve a list of your hosted zones, send a <code>GET</code> request to the <code>2013-04-01/hostedzone</code> resource. The response to this request includes a <code>HostedZones</code> element with zero, one, or multiple <code>HostedZone</code> child elements. By default, the list of hosted zones is displayed on a single page. You can control the length of the page that is displayed by using the <code>MaxItems</code> parameter. You can use the <code>Marker</code> parameter to control the hosted zone that the list begins with. </p>\n <note> Amazon Route 53 returns a maximum of 100 items. If you set MaxItems to a value greater than 100, Amazon Route 53 returns only the first 100.</note>\n "
"documentation": "\n <p> To retrieve a list of your hosted zones, send a <code>GET</code> request to the <code>2013-04-01/hostedzone</code> resource. The response to this request includes a <code>HostedZones</code> element with zero, one, or multiple <code>HostedZone</code> child elements. By default, the list of hosted zones is displayed on a single page. You can control the length of the page that is displayed by using the <code>MaxItems</code> parameter. You can use the <code>Marker</code> parameter to control the hosted zone that the list begins with. </p>\n <note> Amazon Route 53 returns a maximum of 100 items. If you set MaxItems to a value greater than 100, Amazon Route 53 returns only the first 100.</note>\n ",
"pagination": {
"input_token": "Marker",
"output_token": "NextMarker",
"more_results": "IsTruncated",
"limit_key": "MaxItems",
"result_key": "HostedZones",
"py_input_token": "marker"
}
},
"ListResourceRecordSets": {
"name": "ListResourceRecordSets",
Expand Down Expand Up @@ -2127,7 +2143,27 @@
"documentation": "\n <p>Some value specified in the request is invalid or the XML document is malformed.</p>\n "
}
],
"documentation": "\n <p>Imagine all the resource record sets in a zone listed out in front of you.\n Imagine them sorted lexicographically first by DNS name (with the labels\n reversed, like \"com.amazon.www\" for example), and secondarily,\n lexicographically by record type. This operation retrieves at most MaxItems\n resource record sets from this list, in order, starting at a position\n specified by the Name and Type arguments:</p>\n <ul>\n <li>If both Name and Type are omitted, this means start the results at the\n first RRSET in the HostedZone.</li>\n <li>If Name is specified but Type is omitted, this means start the results\n at the first RRSET in the list whose name is greater than or equal to Name.\n </li>\n <li>If both Name and Type are specified, this means start the results at the\n first RRSET in the list whose name is greater than or equal to Name and\n whose type is greater than or equal to Type.</li>\n <li>It is an error to specify the Type but not the Name.</li>\n </ul>\n <p>Use ListResourceRecordSets to retrieve a single known record set by\n specifying the record set's name and type, and setting MaxItems = 1</p>\n <p>To retrieve all the records in a HostedZone, first pause any processes\n making calls to ChangeResourceRecordSets. Initially call ListResourceRecordSets\n without a Name and Type to get the first page of record sets. For subsequent\n calls, set Name and Type to the NextName and NextType values returned by the\n previous response.\n </p>\n <p>In the presence of concurrent ChangeResourceRecordSets calls, there is no\n consistency of results across calls to ListResourceRecordSets. The only way\n to get a consistent multi-page snapshot of all RRSETs in a zone is to stop\n making changes while pagination is in progress.</p>\n <p>However, the results from ListResourceRecordSets are consistent within a\n page. If MakeChange calls are taking place concurrently, the result of each\n one will either be completely visible in your results or not at all. You will\n not see partial changes, or changes that do not ultimately succeed. (This\n follows from the fact that MakeChange is atomic)\n </p>\n <p>The results from ListResourceRecordSets are strongly consistent with\n ChangeResourceRecordSets. To be precise, if a single process makes a call to\n ChangeResourceRecordSets and receives a successful response, the effects of that\n change will be visible in a subsequent call to ListResourceRecordSets by\n that process.</p>\n "
"documentation": "\n <p>Imagine all the resource record sets in a zone listed out in front of you.\n Imagine them sorted lexicographically first by DNS name (with the labels\n reversed, like \"com.amazon.www\" for example), and secondarily,\n lexicographically by record type. This operation retrieves at most MaxItems\n resource record sets from this list, in order, starting at a position\n specified by the Name and Type arguments:</p>\n <ul>\n <li>If both Name and Type are omitted, this means start the results at the\n first RRSET in the HostedZone.</li>\n <li>If Name is specified but Type is omitted, this means start the results\n at the first RRSET in the list whose name is greater than or equal to Name.\n </li>\n <li>If both Name and Type are specified, this means start the results at the\n first RRSET in the list whose name is greater than or equal to Name and\n whose type is greater than or equal to Type.</li>\n <li>It is an error to specify the Type but not the Name.</li>\n </ul>\n <p>Use ListResourceRecordSets to retrieve a single known record set by\n specifying the record set's name and type, and setting MaxItems = 1</p>\n <p>To retrieve all the records in a HostedZone, first pause any processes\n making calls to ChangeResourceRecordSets. Initially call ListResourceRecordSets\n without a Name and Type to get the first page of record sets. For subsequent\n calls, set Name and Type to the NextName and NextType values returned by the\n previous response.\n </p>\n <p>In the presence of concurrent ChangeResourceRecordSets calls, there is no\n consistency of results across calls to ListResourceRecordSets. The only way\n to get a consistent multi-page snapshot of all RRSETs in a zone is to stop\n making changes while pagination is in progress.</p>\n <p>However, the results from ListResourceRecordSets are consistent within a\n page. If MakeChange calls are taking place concurrently, the result of each\n one will either be completely visible in your results or not at all. You will\n not see partial changes, or changes that do not ultimately succeed. (This\n follows from the fact that MakeChange is atomic)\n </p>\n <p>The results from ListResourceRecordSets are strongly consistent with\n ChangeResourceRecordSets. To be precise, if a single process makes a call to\n ChangeResourceRecordSets and receives a successful response, the effects of that\n change will be visible in a subsequent call to ListResourceRecordSets by\n that process.</p>\n ",
"pagination": {
"more_results": "IsTruncated",
"limit_key": "MaxItems",
"result_key": "ResourceRecordSets",
"input_token": [
"StartRecordName",
"StartRecordType",
"StartRecordIdentifier"
],
"output_token": [
"NextRecordName",
"NextRecordType",
"NextRecordIdentifier"
],
"py_input_token": [
"start_record_name",
"start_record_type",
"start_record_identifier"
]
}
}
},
"metadata": {
Expand All @@ -2138,6 +2174,44 @@
"https"
]
},
"pagination": {
"ListHealthChecks": {
"input_token": "Marker",
"output_token": "NextMarker",
"more_results": "IsTruncated",
"limit_key": "MaxItems",
"result_key": "HealthChecks",
"py_input_token": "marker"
},
"ListHostedZones": {
"input_token": "Marker",
"output_token": "NextMarker",
"more_results": "IsTruncated",
"limit_key": "MaxItems",
"result_key": "HostedZones",
"py_input_token": "marker"
},
"ListResourceRecordSets": {
"more_results": "IsTruncated",
"limit_key": "MaxItems",
"result_key": "ResourceRecordSets",
"input_token": [
"StartRecordName",
"StartRecordType",
"StartRecordIdentifier"
],
"output_token": [
"NextRecordName",
"NextRecordType",
"NextRecordIdentifier"
],
"py_input_token": [
"start_record_name",
"start_record_type",
"start_record_identifier"
]
}
},
"retry": {
"__default__": {
"max_attempts": 5,
Expand Down
16 changes: 8 additions & 8 deletions botocore/data/aws/s3.json
Original file line number Diff line number Diff line change
Expand Up @@ -2411,7 +2411,7 @@
"documentation": "This operation lists in-progress multipart uploads.",
"pagination": {
"limit_key": "MaxUploads",
"more_key": "IsTruncated",
"more_results": "IsTruncated",
"output_token": [
"NextKeyMarker",
"NextUploadIdMarker"
Expand Down Expand Up @@ -2623,7 +2623,7 @@
"documentation_url": "http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETVersion.html",
"documentation": "Returns metadata about all of the versions of objects in a bucket.",
"pagination": {
"more_key": "IsTruncated",
"more_results": "IsTruncated",
"limit_key": "MaxKeys",
"output_token": [
"NextKeyMarker",
Expand Down Expand Up @@ -2783,7 +2783,7 @@
"documentation_url": "http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGET.html",
"documentation": "Returns some or all (up to 1000) of the objects in a bucket. You can use the request parameters as selection criteria to return a subset of the objects in a bucket.",
"pagination": {
"more_key": "IsTruncated",
"more_results": "IsTruncated",
"limit_key": "MaxKeys",
"output_token": "NextMarker || Contents[-1].Key",
"input_token": "Marker",
Expand Down Expand Up @@ -2929,7 +2929,7 @@
"documentation_url": "http://docs.aws.amazon.com/AmazonS3/latest/API/mpUploadListParts.html",
"documentation": "Lists the parts that have been uploaded for a specific multipart upload.",
"pagination": {
"more_key": "IsTruncated",
"more_results": "IsTruncated",
"limit_key": "MaxParts",
"output_token": "NextPartNumberMarker",
"input_token": "PartNumberMarker",
Expand Down Expand Up @@ -4312,7 +4312,7 @@
"pagination": {
"ListMultipartUploads": {
"limit_key": "MaxUploads",
"more_key": "IsTruncated",
"more_results": "IsTruncated",
"output_token": [
"NextKeyMarker",
"NextUploadIdMarker"
Expand All @@ -4328,7 +4328,7 @@
]
},
"ListObjectVersions": {
"more_key": "IsTruncated",
"more_results": "IsTruncated",
"limit_key": "MaxKeys",
"output_token": [
"NextKeyMarker",
Expand All @@ -4348,7 +4348,7 @@
]
},
"ListObjects": {
"more_key": "IsTruncated",
"more_results": "IsTruncated",
"limit_key": "MaxKeys",
"output_token": "NextMarker || Contents[-1].Key",
"input_token": "Marker",
Expand All @@ -4359,7 +4359,7 @@
"py_input_token": "marker"
},
"ListParts": {
"more_key": "IsTruncated",
"more_results": "IsTruncated",
"limit_key": "MaxParts",
"output_token": "NextPartNumberMarker",
"input_token": "PartNumberMarker",
Expand Down
2 changes: 1 addition & 1 deletion botocore/paginate.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def _get_input_tokens(self, config):
return input_token

def _get_more_results_token(self, config):
more_results = config.get('more_key')
more_results = config.get('more_results')
if more_results is not None:
return jmespath.compile(more_results)

Expand Down
Loading

0 comments on commit 024af41

Please sign in to comment.