New to the Meraki community and was hoping to get some assistance.
Trying to add a new VLAN via postman and request is just sitting there and not going anywhere. It is not returning any error and I am also not seeing any logs in the dashboard on the network,
Has anyone had issues with the add VLAN API post and if so could you share what was done to get it working.
This is outside my area, but take a look at this example on GitHub that allows you to export and import configurations.
You can jump to the procedure called "createvlan".
Thanks for the reply. Probably shoud have mentioned this is for a Layer Interface on an MS350.
I have just had a look at the script and that seems to be for an MX unless it is the same for an MS. Interesting thing is I have had a look on https://documenter.getpostman.com/view/897512/meraki-dashboard-prov-api/2To9xm#intro and the body looks different.
Am thinking maybe the postman Meraki Dashboard API is not up to date and I am not passing the correct variables hence it is failing.
Log into the dashboard, and then [in the top right hand corner] go "Help/API Docs". That should be the most accurate reference.
You can find the latest documentation here:
I recommend using the Postman collection:
Sometimes the Postman takes a day to get updated but we try out best to keep it up to date!
The VLANs section of the API calls are for the MX appliance.
You can see in the call that it needs the applianceIp as a parameter and the query is a networkId.
I do believe the documentation can be more clear on this. I have updated the Postman to be more obvious.
I think I know what's going on.
First, ensure that you have VLANs "enabled" for the MX appliance. You have to do this in the Dashboard first. Then, all API calls should work.
Second, using dashboard.meraki.com or api.meraki.com, involves redirects to your organization's shard. This is the physical server where your account resides. You can see this in your dashboard URL (i.e. https://n143.meraki.com/~). Use the n### as the "Shard" number in your calls. I have updated Postman to use the shard number as a variable. I have also added the VLAN ID as a parameter for the post call.
Lot of water under the bridge since then :-D. I don't remember exactly what I did, and I have deleted (By accident) the old script. But from what I can remember, I managed to get the Python code to read a comma separated Excel sheet, and add the VLANs one by one using loops. It was not fast, but compared to doing it via the dashboard, it was blazing fast :-D :-D
I have not seen any being able to creating multiple VLANs in one go, even on the same device. Maybe it can be done, but I don't see how, actually, as there are no 'bulk' VLAN creation in the API, as far as I know.
BTW: I will do it in another way today, as back then I was using JSON to contact the API. Today I have installed a Meraki library, and calls that when I what to use the Meraki API. Much easier, and I do not have to keep track when Meraki updates their API. I am using this right now, but there are others:
I have been looking at this: https://github.com/meraki/meraki-python-sdk, which have a build in function allowing it not to flood the API, and thus avoid your script from failing if you get to busy; i.e. making to many calls per sec. From the tests my colleague have made, it is also a little bit faster to use again maybe because it is not flooding the API.
I was creating a lot of VLANs on a MX, and I must warn you: When you reach a certain number of VLANs on the MX, the dashboard and the browser becomes very slow; i.e. very long response times. I don't know what exactly is going on, but I think it is because the browser tries to load all the information at once, and that takes time. Mind you I created more than 300 VLAN interfaces on the MX, and maybe you will create less so you will not have that problem. It is running fine, with DHCP and all; it is just the webpage that loads slowly.
I have a python script that adds vlans with user input. Basically we use the same vlans across locations so it lets you add the IPs for those. Will probably need some adjustments but it could be a good start. Unsure of link rules so i can message you my reddit post if you would like.
Sorry for the long reply, but are on vacation right now, and I do not login that frequently
No problem. Link away :-).
Just so I understand: You use the same VLAN throughout the network, but lets users (Only you?) add the VLAN based on the device IP address?
Regarding updating multiple VLANs in one call;
You might want to checkout Action Batches, which have recently been added to the API. They are designed to combine multiple operations into a single request. This is good for adding VLANs, updating switch ports, managing policies, etc.