• Post category:StudyBullet-16
  • Reading time:20 mins read


100% Hands-on Python training session with real time Network Automation usecases (SSH, NETCONF, RESTCONF& API examples)

What you will learn

Master Python Network Automation concepts from scratch. No prior coding experience is needed

Learn about Paramiko, Netmiko, NAPALM, Nornir, NETCONF, RESTCONF, YANG Models, Ncclient,API Requests, IPAddress libraries in python for Network automation

Acclerate your career to become the future-ready Network Automation Engineer

Learn to automate SSH, NETCONF, RESTCONF and API device interactions using Python

Learn to automate day to day Network Device configuration tasks and solve realtime Networking Automation usecases in more practical way

Learn to setup Ubuntu OS and PyCharm for your Network Automation Journey

Learn to do the Network Sniffing anf Packet capture using Python

Learn to prase device configuration using RegularExpression

Learn about SSH Keybased Authentication

Learn all the Python3 core concepts from Network context

Learn to use Jinja2 templates and textfsm in your scripts

Learn to use functions and Classes in Python for Network Automation

Learn about scheduling the task execution and logging the script execution results

Create and use CSV, YAML, JSON, XML files in your Python Automation scripts and device configurations

Description

Learn Network Automation skills from scratch to an advanced level.

For attending this course you don’t need any prior coding experience.

You will be learning all the required Python concepts in a practical way with Networking Examples

This will help you to get into the exciting world of most trending technology and raise your earning potential.

This course is designed for Network Engineers with less or no coding experience.


Get Instant Notification of New Courses on our Telegram channel.


Throughout the session, we will be using Linux OS (preferably Ubuntu) for running Python scripts.

The IDE is PyCharm and Cisco devices will be used for demonstrating most of the device interactions. (vIOS, IOS-XE, NXOS etc)

  • The course will be starting with SSH fundamentals
  • Initially, Course will take you through Paramiko, Netmiko, NAPALM and Nornir Libraries’ fundamentals
  • Paramiko invoke_shell and exec_command methods
  • Methods supported in Netmiko for device interactions
  • How to do Configuration parsing using Regular Expressions over SSH
  • How to enable logging in the script with a log file or event email triggers
  • How to schedule the Script execution without keeping the terminal opened
  • How to do IP address and subnet validations using Python
  • How to do multithreading for parallel execution on multiple devices
  • Read and write contents to a text file, JSON, YAML, and XML
  • Manage device inventories or config details in CSV files
  • Read the configuration data from CSV, YAML, JSON, or text files
  • How to use textfsm template
  • How to use Jinja2 templates for creating multiline configuration templates with loops or conditions
  • How to use NAPALM for multivendor support
  • How to use getters in NAPALM
  • How to use config merge, config compare, config replace and config rollback in NAPALMcreate
  • What is Nornir Framework
  • How to create an inventory file in Nornir
  • How to create tasks in Nornir
  • What are plugins in Nornir
  • NETCONF/YANG Data models with real-time examples
  • Netconf Automation using Python Ncclient
  • RESTCONF API Automation using Requests
  • Raspberry Pi Mocropython Network Monitoring and Automation examples

Course Update log (Latest Topics):
June 2023: Raspberry Pi Micro Python
May 2023: Command Line Arguments using Argparse
April 2023:VMWare ESXi CLI automation using Python

Python Fundamentals Covered:

  • Strings and String Methods
  • Bytes and Unicode
  • Exception handling
  • stdin, stdout, stderr in Python
  • File Operations
  • Config HTML Comparison using Python
  • Regex Fundamentals
  • For loop
  • While loop
  • if, else, elif
  • Functions and Modules
  • Object Oriented Programming: Classes Basics
  • Multithreading
  • lists, dictionaries, and its methods
  • sets, tuples
  • Pycharm debug Example
  • Mutable vs Immutable
  • datetime
  • schedule
  • Logging
  • Enumerate
  • Tabulate
  • Itemgettes
  • List comprehension
  • copy and deep copy
  • subprocess
  • JSON
  • XML
  • YAML
  • Mocropython for beginners
English
language

Content

Introduction & Course Walkthrough

Introduction
Course Walkthrough

Lab Setup

Lab Setup Suggestion
Install VirtualBox
Install Ubuntu OS in VirtualBox
Enable RDP in Ubuntu OS
Install GNS3 in Ubuntu OS and Setup Interface
Add TAP Interface in Ubuntu for GNS3 Device Connection
Install Cisco vIOS L3 Image in GNS3
Install Cisco vIOS L2 Image in GNS3
Install GNS3 VM in VirtualBox
Install CSV1000v in GNS3 VM
Enable older SSH Key Exchange algorithms support in Ubuntu
Virtual Environment in Python
Setup Github-Desktop App and PyCharm
Test your first script from PyCharm
PyCharm Keyboard shortcuts

Paramiko

Basic SSH using Paramiko invoke_shell
Bytes and Unicode
Send multiple commands using for loop
SSH connection function
SSH known host key Policies in Paramiko
Paramiko exec_command
SSH key based authentication to Linux OS
SSH exception handlings
SSH Key based authentication with Cisco
Demonstrated Scripts in Zip File

File Operations

Text file operations using Python
Save device output to text file
Send config commands from text file
Demonstrated Scripts in Zip File

String Methods

Match user input using string methods Example
String Methods theory : Part 1
String Methods theory : Part 2
Splitlines Example
Format string using ANSI Escape squences
Create dynamic filenames using string methods
Create SSH output dynamic files using string methods
Demonstrated Scripts in Zip File

Config Compare

Text file comparison using Difflib
Cisco Config comparison in html format
Demonstrated Scripts in Zip File

RegEx Fundamentals

RegEx Introduction and basic Examples
Create RegEx Patten Object using re.compile
Validate Multiline outputs using RegEx
Demonstrated Scripts in Zip File

RegEx show command Parsing Examples

Parse “show version” from text file
Parse “show run” from text file
Parse Interface configuration details
Parse route details
Parse “show version” output over SSH
Parse “show run” output over SSH
Parse “show ip interface brief” using split and splitlines
Parse “show ip interface brief” using RegEx
Demonstrated Scripts in Zip File

IP Address Module

IP Address Objects and methods
IP Network Objects and methods
Subnet validation Example script
Device Interface IP Address Object Parsing
Demonstrated Scripts in Zip File

Python Functions

Functions and Arguments Introduction
Multiple ways to pass Arguments to the function
Pass Arbitrary number of elements to function
Demonstrated Scripts in Zip File

Python Modules

Python Modules and Packages example
Example of: if __name__ == ‘__main__’
Demonstrated Scripts in Zip File

Python Classes and Objects : Basics

Classes and Objects Introduction
Create Methods inside classes
Cisco Configuration parsing using classes and Methods
Demonstrated Scripts in Zip File

Python : Data Types

Data Model Introduction
List slicing Example
List methods
Mutable vs Immutable Objects
Dictionary methods
Sets
Tuples
Demonstrated Scripts in Zip File

PyCharm Debug

Dictionary Data Debug Example : Step over, step into
List Data Debug Example
Demonstrated Scripts in Zip File

Loops and Conditionals

for loop
while loop
if elif else condition
Demonstrated Scripts in Zip File

Python Multithreading

Threading Module
Concurrent futures
Threading Module Cisco Example
Concurrent futures Cisco Example
Demonstrated Scripts in Zip File

CSV Files

Introduction
read CSV data in row format using Reader
read CSV data in column format using Reader
CSV DictReader
CSV DictWriter
Demonstrated Scripts in Zip File

Logging

Logging Setup
Logging Levels
Access OS Environmental variables from Python
Trigger Email from Logger
Schedule Example
Cisco Device Interface Monitoring using Schedule
Demonstrated Scripts in Zip File

Userful Python Concenpts

Enumerate
Itemgetter
Sorted and Sort
Tabulate
Add text Color
List Comprehension
Dicitionary Comprehension
Shallow copy and Deepcopy
Subprocess
Demonstrated Scripts in Zip File

NETMIKO

Introduction
send_command method
send_config method
IOS image copying example
send_multiline method
SCP file transfer
SCP Config Backup
Enable Logging in Netmiko
Context manager for device Connection
Exception Handling
SSH Key based Auth
Use Regex Pattern
Threading in Netmiko
Concurrent Futures in Netmiko
TextFSM
Genie Parser
Demonstrated Scripts in Zip File

Data Serialization & Templates

JSON
YAML
03 XML Using xmltodict
04 XML Using elementTree
Jinja2
Demonstrated Scripts in Zip File

NAPALM Python Library

Introduction & cli_show_command method
Changing Device Configuration : Replace, Merge, Commit etc
Configuration Backup and Restore
Set Configuration Revert Timer
NAPALM Getters
Demonstrated Scripts in Zip File

Nornir

Introduction
Nornir Config File Explained
Access Nornir Inventory Data
Filter Nornir inventory for task execution
Nornir Print title
Nornir Task : napalm_get and napalm_cli
Nornir Task : napalm_configure
Nornir Task : netmiko_send_command
Nornir Task : netmiko_send_config
Run multiple tasks using Function
Demonstrated Scripts in Zip File

NETCONF

Introduction
Python Ncclient library
get_config
filter Netconf response
Configure Hostname using Ncclient
Configure cisco interface using Netconf
Get, Add and Delete users using Netconf
Save Config
Save Netconf response as a Pretty XML File
Parse device configuration
Demonstrated Scripts in Zip File

YANG Suite

Introduction & How to install and Setup YANG Suite
Add repositories and Explore Data models

RESTCONF

Introduction
Postman for Restconf
REST API Python Scripts using Requests Library
Get Full config in Json format
PUT Method in RESTCONF
POST Method in RESTCONF
PATCH Method in RESTCONF
DELETE Method in RESTCONF
Save Device Configuration
Demonstrated Scripts in Zip File

Cisco Nexus API (NXAPI -CLI)

Cisco Nexus 9K installation and API setup
NX-API json-rpc Automation using Python
NX-OS API : Handle API Exceptions
NX-API Request From Postman
Parse show commnad output in JSON Format
Use RegEx to parse cli_ascii output
Send Configuration Commands using JSON Data
Execute Bash commands in Nexus Using NXAPI
Run Python script within Nexus using CLI module
Demonstrated Scripts in Zip File

PyATS Framework

PyATS Introduction and how to install it in Ubuntu
PyATS CLI Job Run Example
PyATS CLI Parse show command output in JSON Format
Genie Parser Python Script
Genie Parser Python Script from PyCharm
Use Mock devices for testing PyATS CLI and Python Scripts
Learn Feature in PyATS
Configure Cisco Device using PyATS
Config comparison using Diff in PyATS
Connection methods in PyATS
Describe Topology Details in PyATS
Demonstrated Scripts in Zip File