cancel
Showing results for 
Search instead for 
Did you mean: 

Update multiple devices in different networks

New here

Update multiple devices in different networks

I'm attempting to update multiple access point's tags in multiple networks at the same time. I know you can do this in the dashboard as long as they are in the same network. But I'm trying to update the tags of multiple access points in different networks. I might be missing a way to do this via the dashboard but after looking through it and the documentation I can't seem to find a way.

 

I'm now trying to complete this using python and meraki's dashboard API. Would it be possible to get the inventory of an organization, then using that list to update the devices with new information? For example I'd use “meraki.getorginventory” to provide a list of AP’s to update when doing a “meraki.updatedevice”. Any and all assistance on this is greatly appreciated!

3 REPLIES
Here to help

Re: Update multiple devices in different networks

so digging into the that call, it looks like you can. the help(meraki) shows ``` updatedevice(apikey, networkid, serial, name=None, tags=None, lat=None, lng=None, address=None, move=None, suppressprint=False) # Update the attributes of a device # https://api.meraki.com/api_docs#update-the-attributes-of-a-device ``` if you click on the link to the API documentation, you can see what the call looks like to update the tags. keep in mind that you are updating per device, per network ``` updatedevice(apikey, networkid, serial, name=None, tags=None, lat=None, lng=None, address=None, move=None, suppressprint=False) ```
Getting noticed

Re: Update multiple devices in different networks

If you're trying to add a tag or modify the tag list, note that the inventory API does not include the current set of tags for each device.

 

If you update the device attributes (/networks/[networkId]/devices/[serial]), you will overwrite any existing tags.  If that's okay with you, go for it.  Otherwise, you will need to do a bit more work.  Note that the tags parameter is a space-delimited set of tags.

 

Instead, you can call the inventory API to get the list of devices, then get the device attributes for each device, parse the tag list and make any necessary changes, and then update the device attributes.  It's really not that bad, but does require a little more code.

 

One more thing, Meraki's APIs limit how quickly you can call them.  If you're updating a lot of devices, make sure you throttle the requests.  I think the official limit is 5 per second, although if I configure any higher than 3 per second, I get occasional failures.

Here to help

Re: Update multiple devices in different networks

Hey Conway,
I utilise the API in this maner and have been utilising it for a while making updates accross orgs and networks. IT might not be the cleanest way to acheive and i use Powershell to get and post information but the premise would be the same.
I extract all information against the Org using the networks url. Placing the results into a CSV.
https://api.meraki.com/api/v0/organizations/[organizationId]/networks
Using this list i then i extract device information into another csv looping the results in the network list to create a new one with devices
https://api.meraki.com/api/v0/networks/[networkId]/devices
You can then update this CV with information Tags/Address's/Address details/Notes (this is not shown on the doc but you get notes).
Then i would use this updated csv looping through posting the details and setting the url with varibles from that https://api.meraki.com/api/v0/networks/[networkId]/devices/[serial]

Let me know if you need more information.