I have the below topology DOT file (test.dot). This dot file maintains a network topology in Switch-port name manner.
digraph G {
"R1":"swp1" -> "R3":"swp3"; // Port swp1 of switch R1 is connected to port swp3 of R3
"R1":"swp2" -> "R4":"swp3";
"R1":"swp3" -> "R5":"swp3";
"R1":"swp4" -> "R6":"swp3";
}
I am using pygraphviz library in python to read the graph.
Source code:
#!/usr/bin/env python
from pygraphviz import *
G = AGraph("test.dot")
for edge in G.edges():
print edge
OUTPUT:
(u'R1', u'R6')
(u'R1', u'R4')
(u'R1', u'R3')
(u'R1', u'R5')
The issue I am facing is that the API doesn't gives the port information.
How can I get the port information also from the API ?