meraki / dashboard-api-python

Official Dashboard API library (SDK) for Python
MIT License
293 stars 154 forks source link

added an iterator for get_pages method #146

Closed coreGreenberet closed 3 years ago

coreGreenberet commented 3 years ago

Async/DashboardAPI got a new parameter called "use_iterator_for_get_pages".

If set to true, the api will return an iterator instead of a whole list/dict with all entries. For backwards compatibility this parameter is set to False by default.

To make the iterator work for getNetworkEvents, I've removed the surrounding informations like pageStartAt, pageEndAt.

The issue without having an iterator got already discussed in the community forum: https://community.meraki.com/t5/Developers-APIs/networks-getNetworkClients-fetch-in-batches/m-p/110536#M4446

the asyncio even got a performance boost that way, as the iterator method will load the next page while yielding all the items from the list.

TKIPisalegacycipher commented 3 years ago

Thanks, looking forward to using this!