Giter VIP home page Giter VIP logo

sdwan-uplink-automation's Introduction

SDWAN Uplink Automation

Using SDWAN device template APIs we can automate the selection of uplinks on all SDWAN nodes, for this pourpous we can create different templates that activate different uplinks and use the device tempale API to automate the switching of uplinks from other programs a very stright forward usecase is cost optimisation on uplinks where a customer can link its cost monitoring app to SDWAN using this API and keep switching between Uplinks based on pricing

This prototype is a sciprt that can be trgred by another prgram and activate one template on a selcted device. Prototype

Install:

Clone the repo :

$ git clone https://github.com/gve-sw/sdwan-uplink-automation

Install dependencies :

$ pip install requests
$ pip install click

Setup:

Retrieve template Id and device UUID :

Using the sdwan.py device template toolkit you can retrieve the template id and device uuid, you can discover more about sdwan API here LINK

  • Retrieve your device UUID: update 'Nyiregyhaza' with your device name and copy the device ID
$ python3 sdwan.py device-list --search 'Nyiregyhaza'
Retrieving the devices.
╒═════════════╤═══════════════╤═══════════════════════════╤═════════════╤═══════════╤═══════════════╤═════════════════════╕
│ Host-Name   │ Device Type   │ Device ID                 │ System IP   │   Site ID │ Version       │ Device Model        │
╞═════════════╪═══════════════╪═══════════════════════════╪═════════════╪═══════════╪═══════════════╪═════════════════════╡
│ Nyiregyhaza │ vedge         │ C1117-                    │ 10.10.10.30 │       300 │ 16.12.1d.0.32 │ vedge-C1117         │
╘═════════════╧═══════════════╧═══════════════════════════╧═════════════╧═══════════╧═══════════════╧═════════════════════╛
  • Retrieve your template ID: update 'Nyiregyhaza' with your template name and copy the selcted template ID:
$ python3 sdwan.py template-list --search 'Nyiregyhaza'
Retrieving the templates available.
╒════════════════════════════╤═════════════════════╤══════════════════════════════════════╤════════════════════╤════════════════════╕
│ Template Name              │ Device Type         │ Template ID                          │   Attached devices │   Template version │

Update the script attach_template_script.py:

Update the following section with your details:

SDWAN_IP = "your vmanage host here"
SDWAN_USERNAME = "your user name here"
SDWAN_PASSWORD = "you pasword here"
#Update target device and template 
TEMPLATEID = "your template id here"  
DEVICEID = "your device UUID here"

You can test this script using the SDWAN sandbox on DevNet LINK

Usage:

Launch the script by issuing

$ python3 attach_template_script.py

Notice the change of attached devices to your template using the sdwan.py

$ python3 sdwan.py template-list --search 'Nyiregyhaza'
Retrieving the templates available.
╒════════════════════════════╤═════════════════════╤══════════════════════════════════════╤════════════════════╤════════════════════╕
│ Template Name              │ Device Type         │ Template ID                          │   Attached devices │   Template version │

sdwan-uplink-automation's People

Contributors

abdellbar avatar ggchaves avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  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.