using pyats to automate network test and configuration
pyATS is intended for test script developers and network engineers who want to get started with pyATS and the pyATS Library (previously "Genie").
pyATS currently supports Python v3.7.x, v3.8.x, v3.9.x and v3.10.x, and is tested to work on the following platforms:
Installation
Getting started with testbed.yml
To generate a testbed file for PyATS connectivity, you can convert an existing Ansible hosts file into a testbed file, or you can create a custom testbed file by leveraging an API to pull data from a CMDB or an external database.
Using Ansible - run.yml
Shell mode
If you want to use Python, you can use pyats shell to load the testbed API and create your testbed and device objects. Then, tell the system to connect to each device and to learn the specified features. In this example, the system stores the output as a Python dictionary in the variable learnt and displays the output: