From: Tim Serong Date: Thu, 20 Dec 2018 11:47:53 +0000 (+1100) Subject: mgr/orchestrator: Add service_action method X-Git-Tag: v14.1.0~382^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cf2570bae709a7d6d0ff6cd495b7b26f10edc509;p=ceph-ci.git mgr/orchestrator: Add service_action method This is to facilitate service start/stop/reload (for example, after altering NFS Ganesha configuration, we need to trigger a service reload). Signed-off-by: Tim Serong --- diff --git a/src/pybind/mgr/orchestrator.py b/src/pybind/mgr/orchestrator.py index 1fcacaa02c6..8a1b387187f 100644 --- a/src/pybind/mgr/orchestrator.py +++ b/src/pybind/mgr/orchestrator.py @@ -186,6 +186,28 @@ class Orchestrator(object): """ raise NotImplementedError() + def service_action(self, action, service_type, service_name=None, service_id=None): + # type: (str, str, str, str) -> WriteCompletion + """ + Perform an action (start/stop/reload) on a service. + + Either service_name or service_id must be specified: + - If using service_name, perform the action on that entire logical + service (i.e. all daemons providing that named service). + - If using service_id, perform the action on a single specific daemon + instance. + + :param action: one of "start", "stop", "reload" + :param service_type: e.g. "mds", "rgw", ... + :param service_name: name of logical service ("cephfs", "us-east", ...) + :param service_id: service daemon instance (usually a short hostname) + :rtype: WriteCompletion + """ + assert action in ["start", "stop", "reload"] + assert service_name or service_id + assert not (service_name and service_id) + raise NotImplementedError() + def create_osds(self, osd_spec): """ Create one or more OSDs within a single Drive Group.