23.1. Genie Dq to easily query Pthon Dirctionary
Genie Dq (Dictionary Query) is a Python pyATS library and part of genie.utils to easily query a python dictionary without having to traverse through the dictionary to get a value.
DetailsGenie Dq (Dictionary Query) is a Python pyATS library and part of genie.utils to easily query a python dictionary without having to traverse through the dictionary to get a value.
DetailsPython Jinja2 template also has loops, conditionals, and some other features in addition to the variable substitution discussed in the previous section.
In this section, we demonstrate a jinja2 configuration template with all these features.
Using google TextFSM parser in Nornir automation scripts helps us get structured output when sending show monitoring commands to network devices from which any information can be easily extracted.
In this section we show how to use textfsm in nornir Netmiko and Scrapli plugins.
In the next section, we will introduce the Genie parser, which belongs to the Cisco Company.
Nornir filter inventory gives the capability to limit the execution of automation scripts on a specific network device or group of network devices.
In this section we will learn about two different types of Nornir filter, basic filtering using the filter method and advanced filtering using the F object.
Python sys argv or system arguments are used to get the arguments from the command line in Python scripts.
We use system arguments in network automation to get the password of network devices from the command line to avoid storing clear text passwords in Nornir inventory files.