Add service supervisor

This patch set adds supervisor mechanism for Watcher services
to get ability to track states.

Partially-Implements: blueprint watcher-service-list
Change-Id: Iab1cefb971c79ed27b22b6a5d1bed8698e35f9a4
This commit is contained in:
Alexander Chadin
2016-09-16 18:36:49 +03:00
parent 6cf796ca87
commit e7a1e148ca
30 changed files with 1714 additions and 77 deletions

View File

@@ -38,6 +38,7 @@ See :doc:`../architecture` for more details on this component.
from oslo_config import cfg
from watcher.common import service_manager
from watcher.decision_engine.messaging import audit_endpoint
from watcher.decision_engine.model.collector import manager
@@ -78,23 +79,44 @@ CONF.register_group(decision_engine_opt_group)
CONF.register_opts(WATCHER_DECISION_ENGINE_OPTS, decision_engine_opt_group)
class DecisionEngineManager(object):
class DecisionEngineManager(service_manager.ServiceManagerBase):
API_VERSION = '1.0'
@property
def service_name(self):
return 'watcher-decision-engine'
def __init__(self):
self.api_version = self.API_VERSION
@property
def api_version(self):
return '1.0'
self.publisher_id = CONF.watcher_decision_engine.publisher_id
self.conductor_topic = CONF.watcher_decision_engine.conductor_topic
self.status_topic = CONF.watcher_decision_engine.status_topic
self.notification_topics = (
CONF.watcher_decision_engine.notification_topics)
@property
def publisher_id(self):
return CONF.watcher_decision_engine.publisher_id
self.conductor_endpoints = [audit_endpoint.AuditEndpoint]
@property
def conductor_topic(self):
return CONF.watcher_decision_engine.conductor_topic
self.status_endpoints = []
@property
def status_topic(self):
return CONF.watcher_decision_engine.status_topic
self.collector_manager = manager.CollectorManager()
self.notification_endpoints = (
self.collector_manager.get_notification_endpoints())
@property
def notification_topics(self):
return CONF.watcher_decision_engine.notification_topics
@property
def conductor_endpoints(self):
return [audit_endpoint.AuditEndpoint]
@property
def status_endpoints(self):
return []
@property
def notification_endpoints(self):
return self.collector_manager.get_notification_endpoints()
@property
def collector_manager(self):
return manager.CollectorManager()

View File

@@ -48,15 +48,38 @@ class DecisionEngineAPI(service.Service):
class DecisionEngineAPIManager(object):
API_VERSION = '1.0'
@property
def service_name(self):
return None
conductor_endpoints = []
status_endpoints = [notification_handler.NotificationHandler]
notification_endpoints = []
notification_topics = []
@property
def api_version(self):
return '1.0'
def __init__(self):
self.publisher_id = CONF.watcher_decision_engine.publisher_id
self.conductor_topic = CONF.watcher_decision_engine.conductor_topic
self.status_topic = CONF.watcher_decision_engine.status_topic
self.api_version = self.API_VERSION
@property
def publisher_id(self):
return CONF.watcher_decision_engine.publisher_id
@property
def conductor_topic(self):
return CONF.watcher_decision_engine.conductor_topic
@property
def status_topic(self):
return CONF.watcher_decision_engine.status_topic
@property
def notification_topics(self):
return []
@property
def conductor_endpoints(self):
return []
@property
def status_endpoints(self):
return [notification_handler.NotificationHandler]
@property
def notification_endpoints(self):
return []