Giter Club home page Giter Club logo

junos_automation_using_ncclient's Introduction

About ncclient

ncclient is a python library. It is a NETCONF client implementation in Python.

Code https://github.com/ncclient/ncclient
Doc https://ncclient.readthedocs.io/en/latest/
PyPI (Python Package Index) https://pypi.python.org/pypi/ncclient

About NETCONF

NETCONF is a protocol defined in the RFC 6241

ncclient is a NETCONF client
Junos has a NETCONF server

The file NETCONF_session.md shows how to use NETCONF in an SSH connection.

About Jupyter notebook

Jupyter Notebook is an open-source web application that allows you to create and share documents that contains live code.

About this repo

This repo has several Jupyter notebook files (.ipynb files). These files have Junos automation content using ncclient

This repo also shows how to use NETCONF inside an SSH connection (file NETCONF_session.md)

Instructions

Requirements

Install Docker

You also need a Junos device.

Start Jupyter

Pull the Docker image for Jupyter

$ docker pull jupyter/minimal-notebook
$ docker images jupyter/minimal-notebook
REPOSITORY                 TAG                 IMAGE ID            CREATED             SIZE
jupyter/minimal-notebook   latest              5741bc0030bd        2 weeks ago         2.57GB

Instanciate a container

$ docker run --rm --name ncclient -d -p 9081:8888 -v $PWD:/home/jovyan/ jupyter/minimal-notebook
$ docker ps | grep jupyter/minimal-notebook
c57eac4264a9        jupyter/minimal-notebook   "tini -g -- start-no…"   10 minutes ago      Up 10 minutes       0.0.0.0:9081->8888/tcp                            ncclient

Install the requirements on the container

$ docker exec ncclient pip install ncclient
$ docker exec ncclient pip list | grep ncclient
ncclient               0.6.6

Open a browser.
The URL is http://IP:PORT/?token=xxxxxxxx

  • The default port is 8888 but the container instanciated with the above docker run command use the port 9081
  • The token is provided with the command $ docker exec ncclient jupyter notebook list

Then you can use Jupyter .ipynb files. They have ncclient content to automate Junos. Suggested order:

Stop Jupyter

$ docker stop ncclient
ncclient
$ docker ps | grep ncclient
$ docker ps -a | grep ncclient
$ 

The changes on the .ipynb files are automatically saved locally.

$ ls -l

junos_automation_using_ncclient's People

Contributors

ksator avatar

Stargazers

 avatar

Watchers

 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.