Ejemplo n.º 1
0
    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!")
Ejemplo n.º 2
0
 def _init_instance(self):
     scenario_repo = ScenarioRepository(self.worker_id, self._workers_num)
     actions_callback = messaging.VitrageNotifier(
         publisher_id='vitrage_evaluator', topics=[EVALUATOR_TOPIC]).notify
     self._evaluator = ScenarioEvaluator(self._entity_graph,
                                         scenario_repo,
                                         actions_callback,
                                         enabled=False)
     self._evaluator.scenario_repo.log_enabled_scenarios()
Ejemplo n.º 3
0
 def _init_instance(self):
     actions_callback = messaging.VitrageNotifier(
         conf=self._conf,
         publisher_id='vitrage_evaluator',
         topics=[EVALUATOR_TOPIC]).notify
     self._evaluator = ScenarioEvaluator(self._conf,
                                         self._entity_graph,
                                         None,
                                         actions_callback,
                                         enabled=False)
Ejemplo n.º 4
0
    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()