meraki.DashboardAPI and pagination

JM2024
New here

meraki.DashboardAPI and pagination

Hi,
I am using the Python meraki.DashboardAPI and trying to read all policy objects of an organization.

Unfortunately I get "only" 5000 Objects back.
How can I do pagination with the merakiDashboardAPI?

Is there somewhere an examples?

 

Here is the code:

organizationPolicyObjects = dashboard.organizations.getOrganizationPolicyObjects(organizationId=orgID)
 

Thanks

Juergen

7 Replies 7
alemabrahao
Kind of a big deal
Kind of a big deal

Check it out.

 

Pagination - Meraki Dashboard API v1 - Cisco Meraki Developer Hub

I am not a Cisco Meraki employee. My suggestions are based on documentation of Meraki best practices and day-to-day experience.

Please, if this post was useful, leave your kudos and mark it as solved.
JM2024
New here

I already tried this:

organizationPolicyObjects = dashboard.organizations.getOrganizationPolicyObjects(total_pages="all", perPage=1000, organizationId=orgID)
 
Unfortunately I get only 1000 objects back. It seems that "total_pages" is not working.
alemabrahao
Kind of a big deal
Kind of a big deal

That's the maximum number of entries you'll be able to obtain, I think you'll have to store it in a CSV.

 

Take a look at this.

 

https://community.meraki.com/t5/Developers-APIs/Python-pagination-get-8000-devices/m-p/101593#M4111

I am not a Cisco Meraki employee. My suggestions are based on documentation of Meraki best practices and day-to-day experience.

Please, if this post was useful, leave your kudos and mark it as solved.
JM2024
New here

Hi, thankyou for your answer.
This is using the standard REST-Meraki API. I think, that this will work. 
I would like to use the meraki python library.

PhilipDAth
Kind of a big deal
Kind of a big deal

What happens if you use:

response = dashboard.organizations.getOrganizationPolicyObjects(
    organization_id, total_pages='all'
)

 

I took this from the example in the documentation:
https://developer.cisco.com/meraki/api-v1/get-organization-policy-objects/ 

JM2024
New here

So the main reason seems to be, that the Meraki-API does not work as usual when doing the API-call.
In the HTML-response is no "Link: xxxxx" added. 
That´s maybe the reason, that the MerakiDashboardPythonLib is not working properly.
For me this is a bug. I opened a ticket for it.

FreshFrank
Conversationalist

Hey man, I know this thread is old, did you ever happen to figure this out? I am having the same issue with getting Policy Objects over 5000 (unable to paginate basically)

Get notified when there are additional replies to this discussion.