]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/orch: add pause/resume hooks
authorSage Weil <sage@redhat.com>
Thu, 12 Mar 2020 17:53:50 +0000 (12:53 -0500)
committerSage Weil <sage@redhat.com>
Thu, 12 Mar 2020 18:05:48 +0000 (13:05 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/pybind/mgr/orchestrator/_interface.py
src/pybind/mgr/orchestrator/module.py

index ee3ac31372c92a8707000ea2d5f622a419dcfd20..4bfd33da05faa769ba40ea5dabe72821bfab8638 100644 (file)
@@ -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
         """
index 7dcbb2289439e6387c70a6e13f2545c6da94ca61..e6c80d27c9e0d80fc26b1fd7bd3c9d834d49d9f9 100644 (file)
@@ -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')