- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Config Templates settings
Hello,
is it possible to read the config template settings?
I know you can get the config templates itself with "
GET /organizations/{organizationId}/configTemplates
[ { "id": "N_24329156", "name": "My config template", "productTypes": [ "appliance", "switch", "wireless" ] } ]
I've tried to get a list of devices with the id from this result as "network" id, but it is always empty. In this special case I'm interested in the appliance settings.
I want to read the local subnets settings and compare that to the ones which are used by the networks to get some kind of usage report.
Solved! Go to solution.
- Labels:
-
Dashboard API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've created the needed script.
Please make sure, that you have the latest meraki api installed (released a few days ago).
pip3 install meraki -U
usage:
usage: aio_list_used_template_ranges.py [-h] -o ORGANIZATIONS [ORGANIZATIONS ...] Analyze the usage of subnetPool templates optional arguments: -h, --help show this help message and exit -o ORGANIZATIONS [ORGANIZATIONS ...], --organization ORGANIZATIONS [ORGANIZATIONS ...] the name/id of the organization(s) you want to analyze
Example Output:
Analyzing organization Template_Demo
Downloading Changelog
Downloading templates
Analyzing template Template_One
Analyzing template Template_Two
Analyzing template Template_Three
Analyzing template Template_Four
Analyzing template Template_Five
Getting largest supernetworks:
172.16.0.0/21 mask 28
172.16.8.0/21 mask 29
172.16.16.0/21 mask 28
Downloading VLAN information
172.16.0.0/21 mask 28 subnetworks: total=128 used=34 free=94 -> usage 26.5625%
172.16.8.0/21 mask 29 subnetworks: total=256 used=20 free=236 -> usage 7.8125%
172.16.16.0/21 mask 28 subnetworks: total=128 used=32 free=96 -> usage 25.0%
How it works:
Step 1:
Since we don't have access yet to the address settings in the network template, this script will download the organization changelog.
Step 2:
It will download all templates and map all network configuration changes to the templates.
Which also means, that it can only detect networks of a template which got changed in the last 14 months or 2 years. see Meraki Documentation for details
Step 3:
It will search for the biggest standalone supernetworks and map the smallest possible mask.
Step 4:
It will download the vlan information of all networks and calculate their usage on their respective supernetwork.
Step 5:
Print results
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've done exactly this to retrieve network settings.
You do just as you say - treated the retrieve template ID and use it as a network ID. Then you can retrieve all the settings.
You wont be able to retrieve information on specific devices - as a template doesn't contain actual physical devices.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not specifically. What happens when you use the normal API calls to retrieve the VLANs?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The generated IP subnets are in the normal networks, so you should be querying the networks to get that info.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Unfortunately it looks like you are out of luck. Maybe use the make a wish function?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've added a new IDEA in the early developer community. API related wishes are getting more attention there.
If someone else needs that information, then there is some tricky workaround.
You can extract the subnet settings from the dashboard changelog and use the latest one.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Good Morning,
We used templates as well, however due to some freak things, we were not able to autogenerate the VLAN IP addresses anymore. This really sucks... Also due to the nature of binding a network to the template, adding or removing stuff will result in errors.. Also later unbinding the template will have some effects on the current settings....
We in our organisation are not using templates anymore, and start using scripts to create networks and adding devices to that network...
The easiest way would be browsing through your route table but it is not really possible to find a free IP range, so i created a python script which browses though all the networks, creates a list of all used network subnets, and then picks one which is not in use.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've created the needed script.
Please make sure, that you have the latest meraki api installed (released a few days ago).
pip3 install meraki -U
usage:
usage: aio_list_used_template_ranges.py [-h] -o ORGANIZATIONS [ORGANIZATIONS ...] Analyze the usage of subnetPool templates optional arguments: -h, --help show this help message and exit -o ORGANIZATIONS [ORGANIZATIONS ...], --organization ORGANIZATIONS [ORGANIZATIONS ...] the name/id of the organization(s) you want to analyze
Example Output:
Analyzing organization Template_Demo
Downloading Changelog
Downloading templates
Analyzing template Template_One
Analyzing template Template_Two
Analyzing template Template_Three
Analyzing template Template_Four
Analyzing template Template_Five
Getting largest supernetworks:
172.16.0.0/21 mask 28
172.16.8.0/21 mask 29
172.16.16.0/21 mask 28
Downloading VLAN information
172.16.0.0/21 mask 28 subnetworks: total=128 used=34 free=94 -> usage 26.5625%
172.16.8.0/21 mask 29 subnetworks: total=256 used=20 free=236 -> usage 7.8125%
172.16.16.0/21 mask 28 subnetworks: total=128 used=32 free=96 -> usage 25.0%
How it works:
Step 1:
Since we don't have access yet to the address settings in the network template, this script will download the organization changelog.
Step 2:
It will download all templates and map all network configuration changes to the templates.
Which also means, that it can only detect networks of a template which got changed in the last 14 months or 2 years. see Meraki Documentation for details
Step 3:
It will search for the biggest standalone supernetworks and map the smallest possible mask.
Step 4:
It will download the vlan information of all networks and calculate their usage on their respective supernetwork.
Step 5:
Print results
