- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to determin if VLANs are enabled for a network
Hello,
I am using the end-point : GET /networks/{networkId}/appliance/vlans
The doc describing it is there : https://developer.cisco.com/meraki/api-v1/#!get-network-appliance-vlans
I am only using it for MX devices.
It responds correctly when the VLANs are enabled,.
But in case they are not, I have the following response :
Because I would like to not request anymore on MX devices which don't have the option enable,
I would like to have an attribute bringing this information.
Do you know if there is any end-point API which could give me such info (VLAN enable or not) ?
Many thanks in advance
Chris
Solved! Go to solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You should be able to see when VLANs are enabled by looking at the settings before you make a call to the VLANs endpoint.
https://developer.cisco.com/meraki/api-v1/#!get-network-appliance-vlans-settings
It means 2 calls to the API to get VLANs though, so you may be better off just calling the VLANs endpoint and catching that error of 'VLANs are not enabled for this network'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
But the call you mentioned is the one to use (?): it told you they weren't enabled (for the Network in your query).
Maybe create a script which adds a Network tag to all those Networks which come back with VLANs enabled?
Then only use Networks with that tag, in any subsequent operations?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Good idea, but that means that I have to maintain by myself such an attribute and to periodically try again to collect data on every network_id in case of one has been activated between the 2 batchs.
From my point of view, this management should not have to be done by the API customer.
In fact this "VLAN enabled" data is a "functional data".
May be, it could be present into the response to the API end-point : GET /organizations/{organizationId}/networks
see https://developer.cisco.com/meraki/api-v1/#!get-organization-networks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You should be able to see when VLANs are enabled by looking at the settings before you make a call to the VLANs endpoint.
https://developer.cisco.com/meraki/api-v1/#!get-network-appliance-vlans-settings
It means 2 calls to the API to get VLANs though, so you may be better off just calling the VLANs endpoint and catching that error of 'VLANs are not enabled for this network'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Many thanks Daniel for this end-point that I didn't know
