def start(self): LOG.info("Vitrage Api Handler Service - Starting...") super(VitrageApiHandlerService, self).start() transport = messaging.get_rpc_transport(self.conf) rabbit_hosts = self.conf.oslo_messaging_rabbit.rabbit_hosts target = oslo_messaging.Target(topic=self.conf.rpc_topic, server=rabbit_hosts) endpoints = [ TopologyApis(self.entity_graph, self.conf), AlarmApis(self.entity_graph, self.conf), RcaApis(self.entity_graph, self.conf), TemplateApis(self.scenario_repo.templates, self.scenario_repo.def_templates), EventApis(self.conf), ResourceApis(self.entity_graph, self.conf) ] server = vitrage_rpc.get_server(target, endpoints, transport) server.start() LOG.info("Vitrage Api Handler Service - Started!")
def _init_instance(self): conf = self._conf LOG.info("Vitrage Api Handler Service - Starting...") notifier = messaging.VitrageNotifier(conf, "vitrage.api", [EVALUATOR_TOPIC]) db = storage.get_connection_from_config(conf) transport = messaging.get_rpc_transport(conf) rabbit_hosts = conf.oslo_messaging_rabbit.rabbit_hosts target = oslo_messaging.Target(topic=conf.rpc_topic, server=rabbit_hosts) endpoints = [ TopologyApis(self._entity_graph, conf), AlarmApis(self._entity_graph, conf, db), RcaApis(self._entity_graph, conf, db), TemplateApis(notifier, db), EventApis(conf), ResourceApis(self._entity_graph, conf), WebhookApis(conf) ] server = vitrage_rpc.get_server(target, endpoints, transport) server.start() LOG.info("Vitrage Api Handler Service - Started!")
def _start(self): LOG.info("Vitrage Api Handler Service - Starting...") transport = messaging.get_rpc_transport(self.conf) rabbit_hosts = self.conf.oslo_messaging_rabbit.rabbit_hosts target = oslo_messaging.Target(topic=self.conf.rpc_topic, server=rabbit_hosts) endpoints = [TopologyApis(self.entity_graph, self.conf), AlarmApis(self.entity_graph, self.conf), RcaApis(self.entity_graph, self.conf), TemplateApis(self.notifier, self.db), EventApis(self.conf), ResourceApis(self.entity_graph, self.conf), WebhookApis(self.conf)] server = vitrage_rpc.get_server(target, endpoints, transport) server.start() LOG.info("Vitrage Api Handler Service - Started!")
def _init_instance(self): notifier = messaging.VitrageNotifier("vitrage.api", [EVALUATOR_TOPIC]) db = storage.get_connection_from_config() transport = messaging.get_rpc_transport() target = oslo_messaging.Target(topic=CONF.rpc_topic, server=uuidutils.generate_uuid()) self.api_lock = threading.RLock() endpoints = [ TopologyApis(self._entity_graph, self.api_lock), AlarmApis(self._entity_graph, self.api_lock, db), RcaApis(self._entity_graph, self.api_lock, db), ResourceApis(self._entity_graph, self.api_lock), TemplateApis(notifier, db), EventApis(), WebhookApis(db), OperationalApis(self._entity_graph), ] server = vitrage_rpc.get_server(target, endpoints, transport) server.start()
def create_rpc_client_instance(conf): transport = messaging.get_rpc_transport(conf) target = oslo_messaging.Target(topic=conf.rpc_topic_collector) client = vitrage_rpc.get_client(transport, target) return client
def __init__(self, conf): transport = messaging.get_rpc_transport(conf) target = oslo_messaging.Target(topic=conf.rpc_topic) self.client = vitrage_rpc.get_client(transport, target)
def __init__(self): transport = messaging.get_rpc_transport() target = oslo_messaging.Target(topic=CONF.rpc_topic) self.client = vitrage_rpc.get_client(transport, target) self.check_backend = CONF.api.check_backend