From: Sage Weil Date: Thu, 31 Oct 2019 14:39:30 +0000 (-0500) Subject: mgr/ssh,orchestrator_cli: add 'restart' service action X-Git-Tag: v15.1.0~1055^2~7 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=dd27ba50f574ec7e3c87d41dd8a0760c545d85a0;p=ceph-ci.git mgr/ssh,orchestrator_cli: add 'restart' service action Signed-off-by: Sage Weil --- diff --git a/doc/mgr/orchestrator_cli.rst b/doc/mgr/orchestrator_cli.rst index cc21093efc5..bfe0462ae49 100644 --- a/doc/mgr/orchestrator_cli.rst +++ b/doc/mgr/orchestrator_cli.rst @@ -297,11 +297,11 @@ This is an overview of the current implementation status of the orchestrators. device ls ✔️ ✔️ ✔️ ✔️ service ls ⚪ ✔️ ✔️ ✔ service-instance status ⚪ ⚪ ⚪ ✔ + service-instance {stop,start,...} ⚪ ⚪ ⚪ ✔ iscsi {stop,start,reload} ⚪ ⚪ ⚪ ⚪ iscsi add ⚪ ⚪ ⚪ ⚪ iscsi rm ⚪ ⚪ ⚪ ⚪ iscsi update ⚪ ⚪ ⚪ ⚪ - mds {stop,start,reload} ⚪ ⚪ ⚪ ⚪ mds add ⚪ ✔️ ⚪ ✔ mds rm ⚪ ✔️ ⚪ ✔ mds update ⚪ ✔ ⚪ ✔ diff --git a/src/pybind/mgr/orchestrator.py b/src/pybind/mgr/orchestrator.py index 86d375046d8..2c8fb02f936 100644 --- a/src/pybind/mgr/orchestrator.py +++ b/src/pybind/mgr/orchestrator.py @@ -405,7 +405,7 @@ class Orchestrator(object): * If using service_id, perform the action on a single specific daemon instance. - :param action: one of "start", "stop", "reload" + :param action: one of "start", "stop", "reload", "restart" :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) diff --git a/src/pybind/mgr/orchestrator_cli/module.py b/src/pybind/mgr/orchestrator_cli/module.py index b051d2f1490..45bd20330a4 100644 --- a/src/pybind/mgr/orchestrator_cli/module.py +++ b/src/pybind/mgr/orchestrator_cli/module.py @@ -344,7 +344,7 @@ Usage: return HandleCommandResult(stdout=completion.result_str()) @_write_cli('orchestrator service', - "name=action,type=CephChoices,strings=start|stop|reload " + "name=action,type=CephChoices,strings=start|stop|reload|restart " "name=svc_type,type=CephString " "name=svc_name,type=CephString", 'Start, stop or reload an entire service (i.e. all daemons)') @@ -355,7 +355,7 @@ Usage: return HandleCommandResult(stdout=completion.result_str()) @_write_cli('orchestrator service-instance', - "name=action,type=CephChoices,strings=start|stop|reload " + "name=action,type=CephChoices,strings=start|stop|reload|restart " "name=svc_type,type=CephString " "name=svc_id,type=CephString", 'Start, stop or reload a specific service instance') diff --git a/src/pybind/mgr/ssh/module.py b/src/pybind/mgr/ssh/module.py index 5beafa25926..8cf4c8a1647 100644 --- a/src/pybind/mgr/ssh/module.py +++ b/src/pybind/mgr/ssh/module.py @@ -529,6 +529,7 @@ class SSHOrchestrator(MgrModule, orchestrator.Orchestrator): actions = { 'start': ['reset-failed', 'start'], 'stop': ['stop'], + 'restart': ['reset-failed', 'restart'], } name = '%s.%s' % (service_type, service_id) for a in actions[action]: