# import socket from vnc_api.gen.resource_client import Alarm from vnc_api.gen.resource_xsd import IdPermsType, AlarmExpression, \ AlarmAndList, AlarmOrList, UveKeysType from pysandesh.gen_py.sandesh.ttypes import SandeshLevel from config_handler import ConfigHandler from opserver_util import camel_case_to_hyphen, inverse_dict from plugins.alarm_base import AlarmBase from sandesh.viz.constants import UVE_MAP _INVERSE_UVE_MAP = inverse_dict(UVE_MAP) class AlarmGenConfigHandler(ConfigHandler): def __init__(self, module_id, instance_id, logger, discovery_client, keystone_info, rabbitmq_info, alarm_plugins, alarm_config_change_callback): service_id = socket.gethostname()+':'+module_id+':'+instance_id config_types = ['global-system-config', 'alarm'] super(AlarmGenConfigHandler, self).__init__(service_id, logger, discovery_client, keystone_info, rabbitmq_info, config_types) self._alarm_plugins = alarm_plugins self._alarm_config_change_callback = alarm_config_change_callback self._inbuilt_alarms = {} self._config_ownership = False
import socket import json from vnc_api.gen.resource_client import Alarm from vnc_api.gen.resource_xsd import IdPermsType, AlarmExpression, \ AlarmOperand2, AlarmAndList, AlarmOrList, UveKeysType from pysandesh.gen_py.sandesh.ttypes import SandeshLevel from sandesh.alarmgen_ctrl.ttypes import AlarmgenConfigLog from config_handler import ConfigHandler from opserver_util import camel_case_to_hyphen, inverse_dict from plugins.alarm_base import AlarmBase from sandesh.viz.constants import UVE_MAP _INVERSE_UVE_MAP = inverse_dict(UVE_MAP) class AlarmGenConfigHandler(ConfigHandler): def __init__(self, sandesh_instance, module_id, instance_id, logger, api_server_list, keystone_info, rabbitmq_info, alarm_plugins, alarm_config_change_callback): service_id = socket.gethostname()+':'+module_id+':'+instance_id config_types = ['global-system-config', 'alarm'] super(AlarmGenConfigHandler, self).__init__(service_id, logger, api_server_list, keystone_info, rabbitmq_info, config_types) self._sandesh_instance = sandesh_instance self._alarm_plugins = alarm_plugins self._alarm_config_change_callback = alarm_config_change_callback self._inbuilt_alarms = {}