Moving a network to a new Template while preserving Switch Profile/Template...

Willie_McDonald
Getting noticed

Moving a network to a new Template while preserving Switch Profile/Template...

I'm in the process of changing the Supernet of one of the VLAN's in one of my Meraki templates.

 

I have worked with a Meraki SE to develop a python script to do this. It's pretty cool because there are 4 VLAN's in my template and it "preserves" the IP space of 3 of those VLAN's (so the clients keep their IP addreses) when it moves a network. You basically "tag" any networks you want to move, run the script and point it to the new template you want to use, and the script loops through network by network preserving the IP info for those 3 VLAN's, removing the network from the old template, add the network to the new template and update the IP info on the 3 VLAN's to match what they originally were.

 

Here is my problem, if there is a switch on the network being moved and it is bound to a Switch Profile/Template after the template move the association to the Switch/Profile/Template is stripped and the switch reverts to a the stock config.

 

Unfortunatley my SE that helped write this has left Cisco/Meraki, so I'm posting here.

 

I've been looking at the API library here:

 

https://developer.cisco.com/meraki/api/overview/

 

I can get a list of the Switch Profiles/Templates for my Organization, but I haven't found anything for when you look up a particular Switch S/N, on a particular network it tells you what Switch Profile/Template it is currently associaed too.

 

Once I can find out what the original Switch Profile/Template ID is for each switch, I could then re-bind the switch to the matching Switch Profile/Template ID (even if the Switch Profile/Templates are "identical" they gave different template ID's).

 

TL;DR

 

What is the Python command to see what Switch Profile/Template a switch is bound to?

What is the Python command to update the Switch Profile/Template a switch is bound to?

 

Thanks!

2 Replies 2
alemabrahao
Kind of a big deal
Kind of a big deal

Here you can find all APId available.

 

https://developer.cisco.com/meraki/api/bind-network/

 

Here you can find Payton scripts examples.

 

https://github.com/meraki/automation-scripts

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.
John_on_API
Meraki Employee
Meraki Employee

Get notified when there are additional replies to this discussion.