I have some networks with as many as 400+ APs and I need to change the address for all of them since they default to Palo Alto. Is there anyway to do this without touching each AP in the dashboard?
Thanks
You would have to write a script. In the portal you can go "Help/API Docs".
Here is the section from the manual with the request to update a devices address.
HTTP REQUEST
PUT /networks/[networkId]/devices/[serial]
PARAMETERS
SAMPLE REQUEST
curl -L -H 'X-Cisco-Meraki-API-Key: <key>' -X PUT -H 'Content-Type: application/json' --data-binary '{"name":"Your AP", "lat":37.4180951010362, "lng":-122.098531723022, "serial":"Q2XX-XXXX-XXXX", "mac":"00:11:22:33:44:55:66", "tags":" recently-added "}' 'https://api.meraki.com/api/v0/networks/[networkId]/devices/[serial]'
SAMPLE RESPONSE
Successful HTTP Status: 200
{
"name":"Your AP",
"tags":" recently-added ",
"lat":37.4180951010362,
"lng":-122.098531723022,
"serial":"Q2XX-XXXX-XXXX",
"mac":"00:11:22:33:44:55:66",
"model":"MR34",
"address":"1600 Pennsylvania Ave",
"moveMapMarker": true,
"lanIp":"1.2.3.4"
}
Related question to this, is there an easy way to get a list of or to see all devices that don't have a location set?
Go:
Organisation/Overview
Look at everything on the map that is no where near you.
I've tried that and it just shows this.
If you click on the icon of the "House" near the top left?
If the zoom doesn't change greatly then that implies everything has an address.
The house button just takes me to the full map overview. The zoomed in portion is a cluster of devices showing California (presumably Meraki HQ) as the location. But if I click on the icon or use any other method I cannot view which devices don't have an address.
Crap. Your correct. In that case, I'm not how to identify individual devices easily that don't have an address configured.
I'm in the same boat. Trying to update the address of numerous devices with one API call. What I can't seem to figure out is how to tell the API call to update the address for multiple serial numbers.
https://dashboard.meraki.com/api/v0/networks/{{networkId}}/devices/{{serial}}
I understand how to edit my environment so {{serial}} would be updated with the actual serial number, but I don't want to do this for each serial number. I also understand that I could change the URL with the actual serial number of each device, but I'm still stuck doing an API call per serial number.
So is the solution individual apis per serial #?
PM'd you! with the script.
@RyanB wrote:PM'd you! with the script.
Maybe worth shooting it to @EricGlodowski above as well. If I recall correctly Ryan's script just loops through the devices so it makes it pretty easy.
Can I get the script too?
thanks
So I was able to pull down all the devices without an address with the script but how would I change the address on a batch of devices with say the same tag?
Hey Sarge,
That would require customizing the script to be checking devices for their tags, and then batched on a match running an update call to send back the address for the device.
Depending how many you have to do I'd check out this tool: https://create.meraki.io/build/dashboard-api-react-toolbox-demo/
There is even a live demo which you could use if you don't want to download and deploy the docker package.
https://meraki-api-react-toolbox.herokuapp.com/
This would let you put in your API key, and in one swoop update the addresses for every single device in a particular network to the same thing. So my script likely provided you with all the networks where there are devices missing addresses, and you could use this to bulk import addresses.
Let me know if this helps!
That's pretty awesome. Seems to stop working at 5 devices though.
So I installed Docker and hyper-v on my PC and ran the toolbox locally and it changed 9 out of 76 this time. Then seemed to hang.
Just saw this:
Current behavior notes
Damnit it showed promise.