-
Book Overview & Buying
-
Table Of Contents
Python Network Programming Techniques
By :
A basic functionality we have seen across all the different packages covered so far is the ability to issue commands against a device. In the Retrieving command outputs as structured Python data using Netmiko and Genie recipe in Chapter 4, Configuring Network Devices Using Netmiko, we have already seen that we can use Genie, the package that is part of the pyATS ecosystem, to retrieve the output of a command not as text but as structured Python data.
In this recipe, we are going to use pyATS to connect to a device, issue a command, and retrieve the output as structured data.
Open your code editor and start by creating a file called testbed.yaml, as well as a file called connect.py. Next, navigate in your terminal to the same directory in which you just created the testbed.yaml file.
Follow these steps to connect to a device and issue a command using pyATS: