noc.core.topology.base

Module Contents

class noc.core.topology.base.BaseTopology(node_hints=None, link_hints=None, force_spring=False)

Bases: object

CAPS
ISOLATED_PADDING = 50
ISOLATED_WIDTH = 300
ISOLATED_ROW_HEIGHT = 50
ISOLATED_STEP = 100
MAP_OFFSET
__len__(self)
__contains__(self, item)
load(self)

Load objects and links

get_role(self, mo)

Returns managed object’s role. None if no role

add_object(self, mo, attrs=None)

Add managed object to topology

add_cloud(self, link, attrs=None)

Add cloud to topology :param link: :param attrs: :return:

Add link between interfaces to topology

static get_object_stencil(mo)
static get_cloud_stencil(link)
order_nodes(self, uplink, downlinks)

Sort downlinks basing on uplink’s interface :param uplink: managed object id :param downlinks: ids of downlinks :returns: sorted list of downlinks

get_rings(self)

Return list of all rings

get_isolated(self)

Returns list of nodes without connections

non_isolated_graph(self)
normalize_pos(self, pos)

Normalize positions, shift to (0, 0). Returns width, height, post

get_layout_class(self)
layout(self)