Don't spend your time doing work a well-trained monkey could do | From automate the boring stuff with python book
Automation is not a replacement for our workforce; it presents an opportunity to embrace agility in a constantly evolving digital society.
Considering network engineers' numerous tedious tasks each week, automation becomes a crucial ingredient for success.
Beyond the hype and rankings, Python has emerged as the de facto language for automation. Its elegant syntax and versatility have led to the creation of amazing tools.
pyATS, which stands for Python Automated Test System, was developed by Cisco Systems to automate testing and validate networks. It is often called a "Swiss Army knife" due to its ability to perform a wide range of tasks beyond conventional expectations. In addition to automated testing, pyATS supports network configuration testing and updates,...
Language: Python, it is oriented for DevOps and NetDevOps
Typical usage: Network configuration tests, anomaly detection, connectivity validation…
Objective: Automating network tests and validation by providing a modular and extensible environment.
PyATS: the main framework for automated tests.
Genie: Collection of automation libraries for configuring, analyzing, and verifying network data.
PyATS is a big ecosystem of innovations where we can do amazing and it goes beyond Cisco environments!
The best way to install pyATS is to create a Python virtual environment and this is the quickest way to do it by observing the capture below
To install Genie the process is the same!
PyATS and Genie are installed with their packages.
pyats version check
After running the command we see the version,pyATS is properly installed and we can achieve amazing things we want.
What makes pyATS unique is its abstraction, and to understand it better, you need to engage with these abstractions!
Testbed: This is the representation of network environments. A YAML file describes devices, their roles, and IP addresses, and here is how it looks when the file is written.
# Step 0: list of devices
devices:
iosxr1:
# Step 1: OS and Type
type: iosxr-Prod
os: iosxr
# Step 2: credentials
credentials:
default:
username: admin
password: Hacker@204k
# Step 3: connection parameters
connections:
vty:
protocol: ssh
ip: test-mgmt.talesoftechnology.com
port: 8080
Now you know how to install pyATS using the Windows Subsystem for Linux, and you don’t need a lengthy guide! You understand the basic concepts; even though pyATS can seem abstract, the best way to grasp it is through interaction with various abstractions.
Automation is essential for agility today, you don’t have to reinvent the wheel with tedious tasks.
With pyATS, you can save time and reduce stress compared to handling everything manually.
In the next article, you will learn how to create a testbed, and we will demystify pyATS, it’s not as hard as you think!