Giter Club home page Giter Club logo

mist-automation-programmability / mist_switch_operator Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 19.76 MB

Web UI leveraging Mist APIs to demo the switch configuration APIs. This app can be used to allow minor configuration changes on the Juniper switches ports, like the VLAN (based on the already configured VLANs on the Mist Dashboard), the PoE, the Speed and the Duplex.

Home Page: https://switch.mist-lab.fr

License: MIT License

Dockerfile 0.01% Shell 0.01% Python 0.32% HTML 0.31% JavaScript 99.01% CSS 0.04% TypeScript 0.30% Sass 0.01% SCSS 0.03%
mist switch operator switches api webapp configuration

mist_switch_operator's Introduction

Mist Switch Operator Web UI

MIT LICENSE

Copyright (c) 2020 Thomas Munzer

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Features

  • list switches
  • display basic switch info
  • single/multi ports or LACP configuration changes
    • Port:
      • port enabled/disabled
      • POE enabled/disabled
    • VLAN:
      • mode access/trunk
      • access VLAN (access mode)
      • native/trunk VLANs (trunk mode)
    • Link:
      • autonegociation enabled/disabled
      • speed and duplex (if autonegocation disabled)
  • update switch settings
  • Virtual Chassis support
  • Leverage the "no_local_overwrite" setting from Mist to block the ports configuration from this tool:

no_local_overwrite setting

How it's working

  • This application requires Mist accounts or API token to be used.
  • This application is automatically retrieving the account information and access rights from the Mist Cloud.
  • When an operator selects a site, the application is retrieving the list of switches and VCs.
  • When an operator selects a switch, the application is retrieving the configured networks/vlans from the Mist Cloud.
  • When an operator changes a switch port configuration, the application is creating (or updating) a new "Port Profile" at the switch level with the required configuration, and apply to the switch port. All the port profiles managed by the application are name autogenerated_<port_id>.
  • There is no information stored on the server side, and all the required information are cached on the web browser side (this means everything will be lost if the page is manually refreshed, or when using the web browser "back" button).

Installation

This is a demo application using the Mist APIs.

You can run it as a strandalone Python application, or deploy it as a Docker container.

Note: The application is not providing secured HTTPS connections. It is highly recommended to deploy it behind a reverse proxy providing HTTPS encryption.

Standalone deployment

  1. download the github repository
  2. from the project folder, install the python dependencies (ex: pip3 install -r requirements.txt)
  3. create a config.py file in the directory django/backend/ with the required settings. A configuration example with explanation is avaiable in django/backend/config_example.py.
  4. from the django_appfolder, start the app with python3 ./manage.py runserver (please see Djano server options with python3 ./manage.py runserver -h)

Docker Image

The docker image is available on docker hub: https://hub.docker.com/repository/docker/tmunzer/mist_switch_operator.

The Docket image is listening on port TCP8000

Configuration

You can configure the settings through a configuration file or through Environment Variables.

Environment Variables

Variable Name Type Default Value Comment
DJANGO_DEBUG Number 0 Whether or not Django starts in Debug Mode (0=Production, 1=Debug)
DJANGO_ALLOWED_HOSTS String FQDN on which Django is listening. Only used in Production Mode
GOOGLE_API_KEY String Google API Key to use Google Map Javascript API
APP_DISLCAIMER String Disclaimer to display on the login page

mist_switch_operator's People

Contributors

dependabot[bot] avatar snyk-bot avatar tmunzer avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

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.