Previously, we created a simple script to print a table of CDP neighbors for all interfaces in the fabric. While writing it, we realized it could be optimized.
To optimize the script, we need to change the way we retrieve data.
The class used to get the fabric nodes is fabricNode. Open the Viewer and perform a query with role == leaf:
In the address bar, we can see that parameters have been added to filter the query. To achieve the same effect using the APIs, we need to call this URL:
Continue reading the post on Patreon .