Bulk update network devices

OleN
New here

Bulk update network devices

Hi!
I am working for a ferry company and we have had Meraki devices on the boats for well over a year now with great success. As I am diving a bit deeper into the functionality of the API, I have run into some issues.
We have currently about 900 Meraki devices divided into 90 networks, and planning to add more. As the boats do not have a static location, I get the IAS data from our location system and using Python and the Meraki API, update the location of the devices. ( Bit annoying to not be able to do this on a network-wide configuration...)

The issue however is when using a for loop to edit all devices. As there are so many devices to update, the API put per serial number exceeds 14 minutes to complete, and as the boats are continuously moving, getting this down to less than 2-4 minutes would be preferable.

 

for serial, coordinates in matching_devices.items():
    deviceupdate = dashboard.devices.updateDevice(
        serial,
        address= str(coordinates["address"]),
        moveMapMarker = True
       
    )

 


I have looked into the batch update API docs, but it is not the best and looks at best as a work in progress. Do any of you have an easy way to send bulk updates to the API? A per network would be extremely nice, as 90 updates instead of 900 are waaay faster.

3 Replies 3
sungod
Kind of a big deal

If you can't do it with action batch, and assuming you are using Python, another way to speed things up is use the asyncio option in the library.

 

This allows you to run the requests concurrently, much faster than iterating through hundreds/thousands of networks/devices waiting for each to complete

 

You may need to wrap some back-off and retry logic around the API calls as the rate limit will kick in and the built-in recovery in the library is not always enough.

 

See https://github.com/meraki/dashboard-api-python there are some examples.

 

Inderdeep
Kind of a big deal
Kind of a big deal

@OleN : Check if it helps 

https://community.meraki.com/t5/Developers-APIs/Update-multiple-devices-in-different-networks/m-p/18...

 

Regards/Inder
Cisco IT Blogs awarded in 2020 & 2021
www.thenetworkdna.com
John_on_API
Meraki Employee
Meraki Employee

Update the attributes of a device

This endpoint is totally batchable! That would increase your throughput 100x.

 

https://developer.cisco.com/meraki/api-v1/#!action-batches-overview

https://developer.cisco.com/meraki/api-v1/#!supported-resources

Also, take a look at the action batch helper I made, here: https://github.com/TKIPisalegacycipher/Action-Batch-Helper/blob/main/main.py

 

Get notified when there are additional replies to this discussion.