noc.inv.models.discoveryid

Module Contents

noc.inv.models.discoveryid.mac_lock
class noc.inv.models.discoveryid.MACRange

Bases: mongoengine.document.EmbeddedDocument

meta
first_mac
last_mac
__str__(self)
class noc.inv.models.discoveryid.DiscoveryID

Bases: mongoengine.document.Document

Managed Object’s discovery identity

meta
object
chassis_mac
hostname
router_id
udld_id
macs
_mac_cache
_udld_cache
__str__(self)
static _macs_as_ints(ranges=None, additional=None)

Get all MAC addresses within ranges as integers :param ranges: list of dicts {first_chassis_mac: …, last_chassis_mac: …} :param additional: Optional list of additional macs :return: List of integers

static _macs_to_ranges(macs)

Convert list of macs (as integers) to MACRange :param macs: List of integer :return: List of MACRange

classmethod submit(cls, object, chassis_mac=None, hostname=None, router_id=None, additional_macs=None)
classmethod get_by_mac(cls, mac)
classmethod get_by_udld_id(cls, device_id)
classmethod find_object(cls, mac=None, ipv4_address=None)

Find managed object :param mac: :param ipv4_address: :param cls: :return: Managed object instance or None

classmethod macs_for_object(cls, object)

Get MAC addresses for object :param cls: :param object: :return: list of (fist_mac, last_mac)

classmethod macs_for_objects(cls, objects_ids)

Get MAC addresses for object :param cls: :param objects_ids: Lis IDs of Managed Object Instance :type: list :return: Dictionary mac: objects :rtype: dict

on_delete(self)
classmethod clean_for_object(cls, mo)
classmethod find_objects(cls, macs)

Find objects for list of macs :param macs: List of MAC addresses :return: dict of MAC -> ManagedObject for resolved MACs

classmethod update_udld_id(cls, object, local_id)

Update UDLD id if necessary :param object: Object for set :param local_id: Local UDLD id :return: