noc.inv.models.object

Module Contents

noc.inv.models.object.id_lock
noc.inv.models.object._path_cache
class noc.inv.models.object.Object

Bases: mongoengine.document.Document

Inventory object

meta
name
model
data
container
comment
layer
point
tags
bi_id
_id_cache
_bi_id_cache
REBUILD_CONNECTIONS = ['links', 'conduits']
__str__(self)
classmethod get_by_id(cls, id)
classmethod get_by_bi_id(cls, id)
clean(self)
set_point(self)
on_save(self)
get_path(self)

Returns list of parent segment ids :return:

get_data(self, interface, key)
set_data(self, interface, key, value)
reset_data(self, interface, key)
has_connection(self, name)
get_p2p_connection(self, name)

Get neighbor for p2p connection (s and mf types) Returns connection, remote object, remote connection or None, None, None

get_genderless_connections(self, name)
disconnect_p2p(self, name)

Remove connection name

connect_p2p(self, name, remote_object, remote_name, data, reconnect=False)
connect_genderless(self, name, remote_object, remote_name, data=None, type=None, layer=None)

Connect two genderless connections

put_into(self, container)

Put object into container

get_content(self)

Returns all items directly put into container

get_local_name_path(self)
get_name_path(self)

Return list of container names

log(self, message, user=None, system=None, managed_object=None, op=None)
get_log(self)
get_lost_and_found(self)
classmethod detach_children(cls, sender, document, target=None)
iter_connections(self, direction)

Yields connections of specified direction as tuples of (name, remote_object, remote_name)

iter_inner_connections(self)

Yields inner connections as tuples of (name, remote_object, remote_name)

iter_outer_connections(self)

Yields outer connections as tuples of (name, remote_object, remote_name)

has_inner_connections(self)

Returns True if object has any inner connections

get_inner_connections(self)

Returns a list of inner connections as (name, remote_object, remote_name)

get_outer_connections(self)

Returns a list of outer connections as (name, remote_object, remote_name)

classmethod delete_disconnect(cls, sender, document, target=None)
get_pop(self)

Find enclosing PoP :returns: PoP instance or None

get_coordinates_zoom(self)

Get managed object’s coordinates # @todo: Speedup? :returns: x (lon), y (lat), zoom level

classmethod get_managed(cls, mo)

Get Object managed by managed object :param mo: Managed Object instance or id :returns: Objects managed by managed object, or empty list

classmethod get_by_path(cls, path, hints=None)

Get object by given path. :param path: List of names following to path :param hints: {name: object_id} dictionary for getting object in path :returns: Object instance. None if not found

classmethod _pre_init(cls, sender, document, values, **kwargs)

Object pre-initialization

get_address_text(self)

Return first found address.text value upwards the path :return: Address text or None

get_object_serials(self, chassis_only=True)

Gettint object serialNumber :param chassis_only: With serial numbers inner objects :return: