Bach edit Meraki API

Solved
JPaul
Here to help

Bach edit Meraki API

Hello

 

I am currently in the process of modifying 12 x MS225-48 switches and I am able to modify ports through https://developer.cisco.com/meraki/api-v1/ I have tried Postman but when I import a CSV to runner I get a 400 Bad request error and wondered if there is any other way to modify all switch ports as I need to be done?

1 Accepted Solution
Brash
Kind of a big deal
Kind of a big deal

If all of the ports are being given the same configuration, the change can be easily achieved in the GUI: Switching -> Switch Ports -> Check all of the ports you're making the change on -> Edit.

 

If the ports are being given different configuration, the API is definitely the way to go.

You will need your script to import the CSV, parse it and build a JSON file with the appropriate configuration and send that with the API request.

You can find a poor but functional powershell script below that you can use as reference.

Meraki/Meraki Update Switchports.ps1 at main · Brash92/Meraki (github.com)

View solution in original post

2 Replies 2
Brash
Kind of a big deal
Kind of a big deal

If all of the ports are being given the same configuration, the change can be easily achieved in the GUI: Switching -> Switch Ports -> Check all of the ports you're making the change on -> Edit.

 

If the ports are being given different configuration, the API is definitely the way to go.

You will need your script to import the CSV, parse it and build a JSON file with the appropriate configuration and send that with the API request.

You can find a poor but functional powershell script below that you can use as reference.

Meraki/Meraki Update Switchports.ps1 at main · Brash92/Meraki (github.com)

GIdenJoe
Kind of a big deal
Kind of a big deal

For mass editing in a single network I heavily use tags and then go about selecting the tag's and editing their configuration in one go.

 

Usually when you connect a new switch to a network the first thing you do is the following.  Go to switch -> switchports and then apply following filter.   switch:nameofnewswitch port:1-48 and then give them all the tag ACCESS and a second tag depicting the VLAN they are supposed to be in.

 

Next time you need to edit all those ports you just go tag:nameoftag and then you bulk edit them.

 

There is also a port-profile early access feature but it is missing some key configurations IMHO.

 

If you're heavily into API's and you automate new switches into a network it might be a good idea to automatically add tags to new ports.

Get notified when there are additional replies to this discussion.