meraki / provisioning-lib Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v3.0
License: GNU General Public License v3.0
Not sure where to put feature requests.
It took a minute or two of digging to realize that you need to create a vars.py file (with org and apikey variables), AND that you need to manually change the base_url variable in the merakiapi.py to fit your dashboard URL. Why not move that base_url to the vars.py file, and then make it more clear in the documentation that you need to modify it there. That way there is only one file you are making changes to. Also put a dummy vars.py file in the repository so that it is more clear that you need to have it and what the required variables are.
provisioning-lib/python-3.5-api-module/sample-createbulkimport.py
Any \n new line in the address field needs to be replaced with '' , just like the commas (line 79). I tried to add the regex command to do this but it ended up deleting the first line all together. Figured I'd leave the regex to the experts.
Rob,
I believe there is a disconnect between Meraki Support and Sales representatives knowing about this API. We have over 2000 Meraki APs. I have went through all channels to trying to find this functionality. I do note one key piece of functionality in which I have submitted to the wishlist, contacted support, and told my sales representative is very important functionality we don't currently have. We need an API function to reboot an AP, for a multitude of reasons. I can elaborate this more, however I do not want to do that in this public forum.
I would really appreciate a contact.
https://my.ncocc-k12.org/staffdir/emailme.asp?userid=1
Thanks,
Andy
I don't see in the list of functions in merakiapi.py where you can enable VLANs on an MX. I tested creating a network, and adding/updating MXIP and vlan IPs once vlans were enabled on the network MX . But once you create the network, you have to manually go into the dashboard, enable vlans, and then go back to your script to make any changes. Am I missing something?
In provisioning-lib/python-3.5-api-module/sample-getvlans.py
I got a lot of errors as networks didn't have VLANs enabled (or systems manager networks either)...I also updated the imports to be more consistent with some of the other samples.
import merakiapi as m
from vars import apikey, org
from pprint import pprint
#
# Sample Python Script Using Meraki API module to pull VLAN Details for MX Devices in an organization
# Enter API Key and Organization ID into vars.py
#
networks = m.getnetworklist(apikey, org, suppressprint=True)
for row in networks:
print("----------------------------" + "\n Network Name = " + row['name'])
vlans = m.getvlans(apikey, row['id'],suppressprint=True)
#getvlans return result is a list - Search the list for error msg: 'VLANs not enabled'
if any("not" in s for s in vlans):
print ("No VLANs")
else:
print('VLAN Details for Network {0}'.format(str(row['id'])))
for vlanrow in vlans:
vlandetail = m.getvlandetail(apikey, row['id'], vlanrow['id'],suppressprint=True)
pprint(vlandetail)
In the updateswitchport function of merakiapi in the 3.5 module, some condition statements which check for boolean values are short circuiting (as they should), but this is preventing a value of True from being pushed to the switch port.
As an example:
if enabled and (enabled is not False or not True):
raise ValueError("Enabled must be a boolean variable")
elif enabled:
putdata['enabled'] = str(enabled)
If enabled is True, then "if enabled" is true, and then "enabled is not False", which is also true, the condition statement stops there not evaluating against "not True" and we raise a ValueError. Consider a simplified way to write this:
if not isinstance(enabled, bool):
raise ValueError("Enabled must be a boolean variable")
else:
putdata['enabled'] = str(enabled)
PoE, isolation, and rstp in updateswitchport have the same problem.
Also, line 2309 should be "putdata['isolationEnabled'] = str(isolation)"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.