diff --git a/README.md b/README.md index ca5a627..1c9c71b 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,8 @@ As there is no API to create or update Portal Documentation on Apigee, this scri **refresh_token** - Same as in **upload_spec.py**. +**page_size** - The amount of elements to return for API calls that have paging. Default is 100. + ## upload_theme.py This python script leverages Apigee internal APIs to maintain an apigee portal look and feel, by modifiying logos, stylesheets etc. This script uses a custom configuration file described below, to reference different theme resoures. diff --git a/automation/upload_portal_documentation.py b/automation/upload_portal_documentation.py index c59d975..1dcc24f 100755 --- a/automation/upload_portal_documentation.py +++ b/automation/upload_portal_documentation.py @@ -49,7 +49,7 @@ def documentation_exists( there is an existing one using the given spec name.""" response = REQUEST.get( - 'https://apigee.com/portals/api/sites/{}/apidocs?pageSize={}}'.format(portal_name, page_size)) + 'https://apigee.com/portals/api/sites/{}/apidocs?pageSize={}'.format(portal_name, page_size)) if response.status_code != 200: raise RestException(utils.print_error(response)) @@ -157,6 +157,10 @@ def parse_args(): '-rt', '--refresh_token', help='apigee refresh token') + req_grp.add_argument( + '-pgs', + '--page_size', + help='page size for API calls that use paging - default is 100') parsed = parser.parse_args() @@ -178,7 +182,7 @@ def main(): password = args.password refresh_token = args.refresh_token - # Some API calls make use of paging, if the page size is not defined, we default it to 100 + # Some API calls make use of paging, if the page size is not defined, we default it to 100. page_size = 100 if args.page_size is None else args.page_size data = open(doc_path, 'r', encoding='utf8').read()