|
Mininet Python API Reference Manual
|
Data center network representation for structured multi-trees. More...
Public Member Functions | |
| def | __init__ (self, *args, **params) |
| Topo object. More... | |
| def | build (self, *args, **params) |
| Override this method to build your topology. | |
| def | addNode (self, name, **opts) |
| Add Node to graph. More... | |
| def | addHost (self, name, **opts) |
| Convenience. More... | |
| def | addSwitch (self, name, **opts) |
| Convenience. More... | |
| def | addLink (self, node1, node2, port1=None, port2=None, key=None, **opts) |
| node1, More... | |
| def | nodes (self, sort=True) |
| Return nodes in graph. | |
| def | isSwitch (self, n) |
| Returns true if node is a switch. | |
| def | switches (self, sort=True) |
| Return switches. More... | |
| def | hosts (self, sort=True) |
| Return hosts. More... | |
| def | iterLinks (self, withKeys=False, withInfo=False) |
| Return links (iterator) More... | |
| def | links (self, sort=False, withKeys=False, withInfo=False) |
| Return links. More... | |
| def | addPort (self, src, dst, sport=None, dport=None) |
| Generate port mapping for new edge. More... | |
| def | port (self, src, dst) |
| Get port numbers. More... | |
| def | linkInfo (self, src, dst, key=None) |
| Return link metadata dict. | |
| def | setlinkInfo (self, src, dst, info, key=None) |
| Set link metadata dict. | |
| def | nodeInfo (self, name) |
| Return metadata (dict) for node. | |
| def | setNodeInfo (self, name, info) |
| Set metadata (dict) for node. | |
| def | convertTo (self, cls, data=True, keys=True) |
| Convert to a new object of networkx.MultiGraph-like class cls. More... | |
Static Public Member Functions | |
| def | sorted (items) |
| Items sorted in natural (i.e. More... | |
Public Attributes | |
| g | |
| hopts | |
| sopts | |
| lopts | |
| ports | |
Data center network representation for structured multi-trees.
| def mininet.topo.Topo.__init__ | ( | self, | |
| * | args, | ||
| ** | params | ||
| ) |
| def mininet.topo.Topo.addHost | ( | self, | |
| name, | |||
| ** | opts | ||
| ) |
Convenience.
| method | Add host to graph. |
| name | host name |
| opts | host options |
| def mininet.topo.Topo.addLink | ( | self, | |
| node1, | |||
| node2, | |||
port1 = None, |
|||
port2 = None, |
|||
key = None, |
|||
| ** | opts | ||
| ) |
node1,
| node2 | nodes to link together port1, |
| port2 | ports (optional) |
| opts | link options (optional) |
| def mininet.topo.Topo.addNode | ( | self, | |
| name, | |||
| ** | opts | ||
| ) |
Add Node to graph.
| name | name |
| opts | node options |
| def mininet.topo.Topo.addPort | ( | self, | |
| src, | |||
| dst, | |||
sport = None, |
|||
dport = None |
|||
| ) |
Generate port mapping for new edge.
| src | source switch name |
| dst | destination switch name |
| def mininet.topo.Topo.addSwitch | ( | self, | |
| name, | |||
| ** | opts | ||
| ) |
Convenience.
| method | Add switch to graph. |
| name | switch name |
| opts | switch options |
| def mininet.topo.Topo.convertTo | ( | self, | |
| cls, | |||
data = True, |
|||
keys = True |
|||
| ) |
Convert to a new object of networkx.MultiGraph-like class cls.
| data | include node and edge data (default True) |
| keys | include edge keys as well as edge data (default True) |
| def mininet.topo.Topo.hosts | ( | self, | |
sort = True |
|||
| ) |
Return hosts.
| sort | sort hosts alphabetically |
| def mininet.topo.Topo.iterLinks | ( | self, | |
withKeys = False, |
|||
withInfo = False |
|||
| ) |
Return links (iterator)
| withKeys | return link keys |
| withInfo | return link info |
| def mininet.topo.Topo.links | ( | self, | |
sort = False, |
|||
withKeys = False, |
|||
withInfo = False |
|||
| ) |
Return links.
| sort | sort links alphabetically, preserving (src, dst) order |
| withKeys | return link keys |
| withInfo | return link info |
| def mininet.topo.Topo.port | ( | self, | |
| src, | |||
| dst | |||
| ) |
Get port numbers.
| src | source switch name |
| dst | destination switch name |
| sport | optional source port (otherwise use lowest src port) |
|
static |
Items sorted in natural (i.e.
alphabetical) order
| def mininet.topo.Topo.switches | ( | self, | |
sort = True |
|||
| ) |
Return switches.
| sort | sort switches alphabetically |
1.8.17