From: Kristoffer Grönlund Date: Wed, 26 Feb 2020 12:09:07 +0000 (+0100) Subject: mgr/orchestrator: Add alertmanager hooks X-Git-Tag: v15.1.1~208^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6ef8c6378d7f10daa25c90ffe0fb1ffc24e94669;p=ceph.git mgr/orchestrator: Add alertmanager hooks Signed-off-by: Kristoffer Grönlund --- diff --git a/src/pybind/mgr/orchestrator/_interface.py b/src/pybind/mgr/orchestrator/_interface.py index 6a521744d8fb..f904867fb0f8 100644 --- a/src/pybind/mgr/orchestrator/_interface.py +++ b/src/pybind/mgr/orchestrator/_interface.py @@ -1081,6 +1081,16 @@ class Orchestrator(object): """Update existing a Node-Exporter daemon(s)""" raise NotImplementedError() + def add_alertmanager(self, spec): + # type: (ServiceSpec) -> Completion + """Create a new AlertManager service""" + raise NotImplementedError() + + def apply_alertmanager(self, spec): + # type: (ServiceSpec) -> Completion + """Update an existing AlertManager daemon(s)""" + raise NotImplementedError() + def upgrade_check(self, image, version): # type: (Optional[str], Optional[str]) -> Completion raise NotImplementedError() diff --git a/src/pybind/mgr/orchestrator/module.py b/src/pybind/mgr/orchestrator/module.py index 4aaea6089283..a89c69d353e6 100644 --- a/src/pybind/mgr/orchestrator/module.py +++ b/src/pybind/mgr/orchestrator/module.py @@ -616,6 +616,21 @@ Usage: self._orchestrator_wait([completion]) return HandleCommandResult(stdout=completion.result_str()) + @_cli_write_command( + 'orch daemon add alertmanager', + 'name=num,type=CephInt,req=false ' + 'name=hosts,type=CephString,n=N,req=false ' + 'name=label,type=CephString,req=false', + 'Add alertmanager daemon(s)') + def _daemon_add_alertmanager(self, num=None, label=None, hosts=[]): + # type: (Optional[int], Optional[str], List[str]) -> HandleCommandResult + spec = ServiceSpec( + placement=PlacementSpec(label=label, hosts=hosts, count=num), + ) + completion = self.add_alertmanager(spec) + self._orchestrator_wait([completion]) + return HandleCommandResult(stdout=completion.result_str()) + @_cli_write_command( 'orch', "name=action,type=CephChoices,strings=start|stop|restart|redeploy|reconfig "