Following table are the platforms which NAPALM supports at the moment.
First we have to install NAPALM library in our environment, mine is Ubuntu.
python3 -m pip install napalm
Following code gets the device details of the device and print it with the default format.
Part of the output will be something like the following..
Converting Results to a Structured Data Format
For this we need to import the "rich" library. If your system does not have it yet, it can be installed by the following commands.
pip install --user rich
pip install rich
Now by using the following additions to the code will provide a more readable output.
It is just importing the rich library and the result is printed as "rprint" instead of normal "print".
If you need to get a specific information our from the above output, it can be done like in the following.
Above outputs the serial number of the device like the following.
If there are multiple devices in a list it's just modifying the list "DEVICES" like the following.
No comments:
Post a Comment