noc.sa.models.servicesummary

Module Contents

noc.sa.models.servicesummary.logger
class noc.sa.models.servicesummary.SummaryItem

Bases: mongoengine.document.EmbeddedDocument

profile
summary
classmethod items_to_dict(cls, items)

Convert a list of summary items to dict profile -> summary

classmethod dict_to_items(cls, d)

Convert a dict of profile -> summary to list of SummaryItem

class noc.sa.models.servicesummary.ObjectSummaryItem

Bases: mongoengine.document.EmbeddedDocument

profile
summary
classmethod items_to_dict(cls, items)

Convert a list of summary items to dict profile -> summary

classmethod dict_to_items(cls, d)

Convert a dict of profile -> summary to list of SummaryItem

class noc.sa.models.servicesummary.ServiceSummary

Bases: mongoengine.document.Document

meta
managed_object
interface
service
subscriber
classmethod build_summary_for_object(cls, managed_object)

Build active services summary for managed object :param managed_object: Managed Object id :return: dict of interface id -> {service: …, subscriber: ….}

interface None means unbound or box-wise services
classmethod refresh_object(cls, managed_object)
classmethod _refresh_object(cls, managed_object)
classmethod get_object_summary(cls, managed_object)
classmethod get_objects_summary(cls, managed_objects)
classmethod get_weight(cls, summary)

Convert result of get_object_summary to alarm weight

classmethod get_severity(cls, summary)

Convert result of get_object_summary to alarm severity

classmethod get_direct_summary(cls, managed_objects, summary_all=False)

! Method works on mongodb version 3.4 and greater Calculate direct services and profiles for a list of managed objects :param managed_objects: List of managed object instances or ids :param summary_all: Return summary for all services :return: tuple of service and subscriber dicts

noc.sa.models.servicesummary.refresh_object(managed_object)