Network

Main functions for AutoNetkit

AutoNetkit.network.LOG = <logging.Logger object at 0x101a5f410>
TODO: use for fast node access, eg can do self.ank[n][‘asn’]
#Return a dict of neighbors of node n. Use the expression ‘G[n]’. def __getitem__(self, n):
also look at
def __iter__(self):
and
def __contains__(self,n):

to pass through to the netx graph methods for quick access

class AutoNetkit.network.Network(physical_graph=None)[source]

Main network containing router graph

add_device(node_id, asn=None, device_type=None, **kwargs)[source]

Adds a device to the physical graph

asn(node)[source]

syntactic sugar for accessing asn of a node

>>> network = ank.example_multi_as()
>>> network.asn("1a.AS1")
1
>>> [network.asn(node) for node in sorted(network.devices())]
[1, 1, 1, 2, 2, 2, 2, 3]
devices(asn=None)[source]

return devices in a network

find(fqdn)[source]

Note: this is O(N) in number of nodes

>>> network = ank.example_multi_as()
>>> network.find("1a.AS1")
1a.AS1
>>> network.find("1a.AS4")
Traceback (most recent call last):
...
DeviceNotFoundException
fqdn(node)[source]

Shortcut to fqdn

ibgp_cluster(node)[source]

syntactic sugar for accessing ibgp_cluster of a node

ibgp_level(node)[source]

syntactic sugar for accessing ibgp_level of a node

label(node)[source]

syntactic sugar for accessing label of a node

Returns a named-tuple for accessing link properties

lo_ip(node)[source]

syntactic sugar for accessing loopback IP of a node

network(node)[source]

syntactic sugar for accessing network of a node

pop(node)[source]

syntactic sugar for accessing pop of a node

route_reflector(node)[source]

syntactic sugar for accessing if a ndoe is a route_reflector

routers(asn=None)[source]

return routers in network

servers(asn=None)[source]

return servers in network

update_node_type(*args, **kwargs)[source]

Updates any node in graph that has no type set to be default_type

virtual_nodes(asn=None)

return devices in a network

class AutoNetkit.network.device[source]

API to access device in network

device_hostname[source]

Replaces . with _ to make safe for router configs

API to access link in network

Assume bi-directional link

class AutoNetkit.network.overlay

API to access overlay graph in network

class AutoNetkit.network.overlay_node

API to access overlay graph node in network