Coder Social home page Coder Social logo

smartzoneapi's Introduction

Ruckus SmartZone API

Repository for basic python scripts to pull and print data from Ruckus SmartZone API.

Note

I am new to both python and git and scripts are training exercises. I have not written code for an extended period. Program is tested against a SZ100 cluster of 2 running 3.6.2 firmware and using v6_1 version of the API. These scripts work correctly with vSZ-E but not with vSZ-H. Read-only account is recommended.

Each script will need the following variables which will need modifying for your own configuration:

  • baseurl
  • szusername
    • String
  • szpassword
    • String
  • check_cert
    • Boolean - set to False if using selfsigned certificates or certificate chain is not installed on the machine
    • There is also an import commented out for supressing invalid certificate warnings for testing purposes only.

Use API documentation below for reference:

Ruckus documentation for version 3.6.2

login_getzone.py

Prerequisites: requests, json

Returns and prints all the configured zones on the cluster. The script will output a list of lists called cleaned_zones.

Format of the lists are:

[name_of_zone,zone_id]

login_getwlans.py

Prerequisites: requests, json

Builds on login_getzone.py to produce a list of lists called cleaned_all_zone_wlan from cleaned_zones that includes the WLAN names and ids. Please note this is the WLAN name NOT the SSID.

Format of the lists are:

[name_of_zone,zone_id,name_of_WLAN,WLAN_id]

login_getwlan_details.py

Prerequisites: requests, json, sys

Returns and prints the JSON from individual WLAN. If wlan_template_id or zone_template_id are blank the program will ask for the names of the WLAN and the zone to be inputted. The script attempts to account for spelling mistakes in the WLAN name before quitting if WLAN is not found in the zone.

It will save the WLAN's details in a variable called wlan_template.

login_getwlans_compare.py

Prerequisites: requests, json, sys, dictdiffer

Returns and prints the differences in configuration of two different WLANs. Useful for quickly solving why a certain WLAN isn't working as expected. It builds on login_getwlan_details but will need two sets of WLAN + Zone details, either one template and one inputted or both manually inputted. The ignore list removes common and expected differences as defined below, can be used or not.

ignore_list = ['id','name','ssid','encryption.passphrase','bssid','zoneId','description']

The results are saved in wlans_compared. A more detailed description of the output is in the helper module documentation here, otherwise a basic format is below.

[(type_of_difference,where_is_the_difference,the_difference)]

smartzoneapi's People

Contributors

conflate avatar garethhay avatar lowlifeplanet avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

smartzoneapi's Issues

Fix errors in README.md

File can be made concise.
Metadiscourse can be removed for clarity.
SOme pronouns can be removed.

Scripts don't account for `has_more` so limited to 100 entries

For larger environments currently, the scripts don't account for over a 100 entries.

The API reply contains a boolean has_more which will indicate there are further items not in the list provided.

If passed listSize then larger lists can be requested.

listSize
string (optional)
The maximum number of entries to be retrieved. Default: 100

Will revisit when I start working on the access points as unlikely to have environments with over 100 zones and over 100 WLANs in a single zone in SZ100 or vSZ-E.

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.