Using meraki.DashboardAPI(use_iterator_for_get_pages=True), getOrganizationNetworks() returns no results with the default perPage=1000 value. I get results when perPage is limited to 650 or less. This is on version 1.18.2 running under Python 3.9.2.
Iterator with default perPage
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import meraki
>>> dashboard = meraki.DashboardAPI(use_iterator_for_get_pages=True, simulate=True)
2022-02-19 14:11:40 meraki: INFO > Meraki dashboard API session initialized with these parameters: {
'version': '1.18.2', 'api_key': '************************************ab6d', 'base_url': 'https://api.meraki.com/api/v1',
'single_request_timeout': 60, 'certificate_path': '', 'requests_proxy': '', 'wait_on_rate_limit': True,
'nginx_429_retry_wait_time': 60, 'action_batch_retry_wait_time': 60, 'retry_4xx_error': False,
'retry_4xx_error_wait_time': 60, 'maximum_retries': 2, 'simulate': True,
'be_geo_id': None, 'caller': None, 'use_iterator_for_get_pages': True}
>>> nets = dashboard.organizations.getOrganizationNetworks(organizationId='nnnnnn')
>>> next(nets).keys()
2022-02-19 14:12:19 meraki: INFO > GET https://api.meraki.com/api/v1/organizations/nnnnnn/networks
2022-02-19 14:12:20 meraki: INFO > organizations, getOrganizationNetworks; page 1 - 200 OK
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
StopIteration
Iterator with perPage=650
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import meraki
>>> dashboard = meraki.DashboardAPI(use_iterator_for_get_pages=True, simulate=True)
2022-02-19 14:18:59 meraki: INFO > Meraki dashboard API session initialized with these parameters: {
'version': '1.18.2', 'api_key': '************************************ab6d', 'base_url': 'https://api.meraki.com/api/v1',
'single_request_timeout': 60, 'certificate_path': '', 'requests_proxy': '', 'wait_on_rate_limit': True,
'nginx_429_retry_wait_time': 60, 'action_batch_retry_wait_time': 60, 'retry_4xx_error': False,
'retry_4xx_error_wait_time': 60, 'maximum_retries': 2, 'simulate': True,
'be_geo_id': None, 'caller': None, 'use_iterator_for_get_pages': True}
>>> nets = dashboard.organizations.getOrganizationNetworks(organizationId='nnnnnn', perPage=650)
>>> next(nets).keys()
2022-02-19 14:19:06 meraki: INFO > GET https://api.meraki.com/api/v1/organizations/nnnnnn/networks
2022-02-19 14:19:08 meraki: INFO > organizations, getOrganizationNetworks; page 1 - 200 OK
dict_keys(['id', 'organizationId', 'name', 'productTypes', 'timeZone', 'tags', 'enrollmentString', 'url', 'notes'])
Using
meraki.DashboardAPI(use_iterator_for_get_pages=True),getOrganizationNetworks()returns no results with the defaultperPage=1000value. I get results whenperPageis limited to 650 or less. This is on version 1.18.2 running under Python 3.9.2.Iterator with default
perPageIterator with
perPage=650