From: Sage Weil Date: Sun, 1 Mar 2020 17:38:42 +0000 (-0600) Subject: mgr/orch: add crash hooks X-Git-Tag: v15.1.1~167^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bec4138ceee9c2bcf811afc3dc9b3df5c85fe01a;p=ceph.git mgr/orch: add crash hooks Signed-off-by: Sage Weil --- diff --git a/src/pybind/mgr/orchestrator/_interface.py b/src/pybind/mgr/orchestrator/_interface.py index 198771f21cde..de285f64c60e 100644 --- a/src/pybind/mgr/orchestrator/_interface.py +++ b/src/pybind/mgr/orchestrator/_interface.py @@ -1104,6 +1104,16 @@ class Orchestrator(object): """Update existing a Node-Exporter daemon(s)""" raise NotImplementedError() + def add_crash(self, spec): + # type: (ServiceSpec) -> Completion + """Create a new crash service""" + raise NotImplementedError() + + def apply_crash(self, spec): + # type: (ServiceSpec) -> Completion + """Update existing a crash daemon(s)""" + raise NotImplementedError() + def add_grafana(self, spec): # type: (ServiceSpec) -> Completion """Create a new Node-Exporter service""" diff --git a/src/pybind/mgr/orchestrator/module.py b/src/pybind/mgr/orchestrator/module.py index 6f9dfc11dca3..bcc43f20bd35 100644 --- a/src/pybind/mgr/orchestrator/module.py +++ b/src/pybind/mgr/orchestrator/module.py @@ -638,6 +638,19 @@ Usage: self._orchestrator_wait([completion]) return HandleCommandResult(stdout=completion.result_str()) + @_cli_write_command( + 'orch daemon add crash', + 'name=placement,type=CephString,n=N,req=false', + 'Add node-exporter daemon(s)') + def _daemon_add_crash(self, placement=None): + spec = ServiceSpec( + 'crash', + placement=PlacementSpec.from_strings(placement), + ) + completion = self.add_crash(spec) + self._orchestrator_wait([completion]) + return HandleCommandResult(stdout=completion.result_str()) + @_cli_write_command( 'orch daemon add grafana', 'name=placement,type=CephString,n=N,req=false', @@ -844,6 +857,19 @@ Usage: self._orchestrator_wait([completion]) return HandleCommandResult(stdout=completion.result_str()) + @_cli_write_command( + 'orch apply crash', + 'name=placement,type=CephString,n=N,req=false', + 'Update node_exporter service') + def _apply_crash(self, placement=None): + spec = ServiceSpec( + 'crash', + placement=PlacementSpec.from_strings(placement), + ) + completion = self.apply_crash(spec) + self._orchestrator_wait([completion]) + return HandleCommandResult(stdout=completion.result_str()) + @_cli_write_command( 'orch set backend', "name=module_name,type=CephString,req=true",