Code Monkey home page Code Monkey logo

provisioning-lib's People

Contributors

apierson27 avatar chasetb avatar gegolao avatar knakashima avatar xorcat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

provisioning-lib's Issues

Merakiapi and vars file

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.

New Line on address

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.

API

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

enable vlans on MX

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?

Error handling

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)

Short-circuit Evaluations Causing Problems

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)"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.