From: Sage Weil Date: Thu, 12 Mar 2020 17:53:50 +0000 (-0500) Subject: mgr/orch: add pause/resume hooks X-Git-Tag: v15.1.1~7^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=3336e498b3db870b373fe99a975998601a2caefe;p=ceph.git mgr/orch: add pause/resume hooks Signed-off-by: Sage Weil --- diff --git a/src/pybind/mgr/orchestrator/_interface.py b/src/pybind/mgr/orchestrator/_interface.py index ee3ac31372c92..4bfd33da05faa 100644 --- a/src/pybind/mgr/orchestrator/_interface.py +++ b/src/pybind/mgr/orchestrator/_interface.py @@ -752,6 +752,14 @@ class Orchestrator(object): """ raise NotImplementedError() + def pause(self): + # type: () -> None + raise NotImplementedError() + + def resume(self): + # type: () -> None + raise NotImplementedError() + def add_host(self, host_spec): # type: (HostSpec) -> Completion """ diff --git a/src/pybind/mgr/orchestrator/module.py b/src/pybind/mgr/orchestrator/module.py index 7dcbb2289439e..e6c80d27c9e0d 100644 --- a/src/pybind/mgr/orchestrator/module.py +++ b/src/pybind/mgr/orchestrator/module.py @@ -953,6 +953,20 @@ Usage: return HandleCommandResult(-errno.EINVAL, stderr="Module '{0}' not found".format(module_name)) + @_cli_write_command( + 'orch pause', + desc='Pause orchestrator background work') + def _pause(self): + self.pause() + return HandleCommandResult() + + @_cli_write_command( + 'orch resume', + desc='Resume orchestrator background work (if paused)') + def _resume(self): + self.resume() + return HandleCommandResult() + @_cli_write_command( 'orch cancel', desc='cancels ongoing operations')