/python-training-for-network-engineers

Python hands-on training for network engineers. How to automate Junos with Python

Primary LanguagePython

What to find in thos project

A "Python for network enginners" course.
It is useful to network engineers with no python programming knowledge, who wants to use python to manage junos devices.
This is a hands-on training, with step-by-step instructions and many basics examples.
The course covers an introduction to Python programming, it includes also the PyEZ library to interact with JUNOS devices as well as an overview of some other Python modules to manipulate IP addresses, files, regular expressions, templates and rest calls.

Presentations

The presentations are available into this repo
- Python-for-network-engineers.pdf
- Python-training.pdf

Scripts

All the scripts are available into this project.
The examples and code in this document are for learning and educational purposes.
The samples were created with the goals of clarity and ease of understanding.
If you are writing code for a real application, you would write some code differently :-)

Agenda

  • introduction to network automation
  • introduction to python programming
  • IP addresses manipulation
  • files manipulation
  • building documents with jinja2 templates
  • YAML (humans to programs)
  • junos automation with PyEZ python library
  • JSON data format (exchange data between applications)
  • programmatic access with REST APIs

More examples on of how to use network automation with Junos:

How to automate junos with python (pyez, ncclient, napalm, json, yaml, jinja, netconf, lxml, rest api)
https://github.com/ksator/python-training-for-network-engineers

How to automate junos with Ansible (ansible, travis CI)
https://github.com/ksator/ansible-training-for-junos-automation

How to use Openconfig with Juniper devices (openconfig, pyang, pyangbind, netconf, yang, pyez, ansible, jinja, travis CI)
https://github.com/ksator/openconfig-demo-with-juniper-devices

How to package junos automation tools in a Dockerfile on Github, and to publish the Docker image automatically in the docker registery
https://github.com/ksator/junos-automation-apps-dockerized

How to orchestrate Junos virtual machines with Vagrant (vsrx, vqfx, vagrant, virtualbox, ansible)
https://github.com/ksator/vagrant-with-junos

How to automate operational states verifications and configuration audits on Junos devices using JSNAPy (jsnapy, pyez, ansible)
https://github.com/ksator/junos-verifications-automation-with-jsnapy

junos automation with IaC (Infrastructure as Code, gitlab CI, gitlab runners, gitflow, Continuous Integration/Continuous Delivery, docker, ansible, jinja, yaml)
https://github.com/ksator/network-Infrastructure-as-Code

How to delegate junos automation tasks chatting to hubot with slack (chatops, chatbot, hubot, slack, docker, Travic CI, ansible)
https://github.com/ksator/junos-automation-with-chatops

How to automate Junos with stackstorm (stackstorm, event driven automtion, napalm, ansible)
https://github.com/ksator/junos-automation-with-stackstorm

How to automate tests for Python with pytest, and tests coverage reporting with Coveralls. CI with Travis.
https://github.com/ksator/continuous-integration-with-python

Contributions, bugs, questions or enhancement requests:

please submit github issues or pull requests.