diff options
author | Adam King <adking@redhat.com> | 2024-03-26 20:08:40 +0100 |
---|---|---|
committer | Adam King <adking@redhat.com> | 2024-03-26 20:08:40 +0100 |
commit | 84065520356534ccb77ca388f2a46bdd5ea4f0f4 (patch) | |
tree | 45245c5bd5d5ec2cd2d3d2a73455e8b75b4b8600 /src/pybind/mgr/orchestrator/module.py | |
parent | Merge pull request #56351 from afreen23/wip-advanced-sec (diff) | |
download | ceph-84065520356534ccb77ca388f2a46bdd5ea4f0f4.tar.xz ceph-84065520356534ccb77ca388f2a46bdd5ea4f0f4.zip |
mgr/cephadm: make command for adding prometheus custom alerts
Easier than having to specify the settting in the
config-key store. Also handles the reconfig of the
prometheus daemon in a single command
Signed-off-by: Adam King <adking@redhat.com>
Diffstat (limited to 'src/pybind/mgr/orchestrator/module.py')
-rw-r--r-- | src/pybind/mgr/orchestrator/module.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/pybind/mgr/orchestrator/module.py b/src/pybind/mgr/orchestrator/module.py index d1ba6ea8675..4c08ace4dbd 100644 --- a/src/pybind/mgr/orchestrator/module.py +++ b/src/pybind/mgr/orchestrator/module.py @@ -1197,6 +1197,14 @@ class OrchestratorCli(OrchestratorClientMixin, MgrModule, access_info = raise_if_exception(completion) return HandleCommandResult(stdout=json.dumps(access_info)) + @_cli_write_command('orch prometheus set-custom-alerts') + def _set_custom_prometheus_alerts(self, inbuf: Optional[str] = None) -> HandleCommandResult: + if not inbuf: + raise OrchestratorError('This command requires passing a file with "-i <filepath>"') + completion = self.set_custom_prometheus_alerts(inbuf) + out = raise_if_exception(completion) + return HandleCommandResult(stdout=json.dumps(out)) + @_cli_write_command('orch apply osd') def _apply_osd(self, all_available_devices: bool = False, |