Dashboard API - Enable VLANs on new network?

SOLVED
Lorinczm
New here

Dashboard API - Enable VLANs on new network?

We're trying to import VLANs and Subnets into Meraki with API after we create a new network, also with API. The problem seems to be that by default the new networks are 'vlans disabled' single subnet type network. Is there a way to 'ENABLE VLANS' after the network is created or possibly enable it during network creation via initial API call?

1 ACCEPTED SOLUTION
DCooper
Meraki Alumni (Retired)
Meraki Alumni (Retired)

Your correct, this is a manual process for now unless you script it out. If your using templates this obviously will not be an issue.

 

Here is a Python Script to enable VLANS. This is not supported by Meraki Support but will do the trick - https://www.dropbox.com/s/gvefg6i48ll4ltt/enable_vlans.py?dl=0

View solution in original post

8 REPLIES 8
MilesMeraki
Head in the Cloud

After creating multiple VLANs via the API doesn't it automatically enable the VLAN functionality on the device?

Eliot F | Simplifying IT with Cloud Solutions
Found this helpful? Give me some Kudos! (click on the little up-arrow below)
DCooper
Meraki Alumni (Retired)
Meraki Alumni (Retired)

Your correct, this is a manual process for now unless you script it out. If your using templates this obviously will not be an issue.

 

Here is a Python Script to enable VLANS. This is not supported by Meraki Support but will do the trick - https://www.dropbox.com/s/gvefg6i48ll4ltt/enable_vlans.py?dl=0

Bless you kind sir! Crisis averted! 🙂

 

Templates are not an option in this case (long story). Thanks again!!

DCooper
Meraki Alumni (Retired)
Meraki Alumni (Retired)

Another quick note: There isn't a easy way in the API or scripting to bulk pull the network names so that is going to be the drawback.
djonesax
Conversationalist

This script is helpful but I want to run it for 1400 networks versus just one.  The part I am struggling with is creating the exact URL when there is a part of the URL is not available in the API.

 

Example.

https://n##.meraki.com/networknamri/n/xQB--djb/manage/support

 

Can someone help me figure out how to get a correlation of network names to that text in red with out having to click on 1400 networks?

 

Thanks,

 

David

djonesax
Conversationalist

OK, I figured this out.  Once logged into the dashboard you can hit this URL to get the list of administered networks.   This was a HUGE win for us so I hope it helps someone else.

 

https://{shardnumber}.meraki.com/manage/organization/administered_orgs

 

Thanks,

 

David

chengineer
Meraki Alumni (Retired)
Meraki Alumni (Retired)

Good stuff David! Also as we discussed in email, the new copyFromNetworkId parameter for creating a network can be used to clone from a base network that simply has VLANs enabled already. Take care.

Solutions Architect @ Cisco Meraki | API & Developer Ecosystem
DexterLaBora
Meraki Employee
Meraki Employee

Enable VLANs is now a supported endpoint!

 

Postman Collection - Enable VLANs

 

Enable/Disable VLANs for the given network

 

PUT /networks/{{networkId}}/vlansEnabledState

 

 

Get notified when there are additional replies to this discussion.
Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.