Posts

Showing posts from October, 2020

pyATS - Reading from a Dictionary

Image
When working with pyATS, one of the first things that threw me off when working with the data that came back from my lab router was that the data was in a structure that I wasn't used to seeing. I really, really struggled with this, so I hope if you have found your way here, this blog helps you! The issue with the structure is that it comes back from a router as a dictionary. This is the output from a vty connection to an 1841 I have running in my lab: The information is taken from the running configuration of the router and printed on the screen in a human readable format. The same output through pyATS looks something like this: For human readable this output loses points, however this output can be very powerful if you can iterate through the dictionary  items  and find the  values  you need from the dictionary  keys.  One of the first things to do is get a feel for the actual structure of this dictionary. The dictionary itself makes more sense when structured like this: { '