From 2d1550cf051f4784fd572555b1014ef9daa79d0f Mon Sep 17 00:00:00 2001 From: Yaarit Hatuka Date: Wed, 12 Jan 2022 05:57:21 +0000 Subject: [PATCH] mgr/telemetry: add `enable / disable channel all` Enable or disable all telemetry channels at once with: ceph telemetry enable channel all ceph telemetry disable channel all Signed-off-by: Yaarit Hatuka --- doc/mgr/telemetry.rst | 5 +++++ src/pybind/mgr/telemetry/module.py | 14 ++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/doc/mgr/telemetry.rst b/doc/mgr/telemetry.rst index 6927a19332f04..de2d72f2b67d9 100644 --- a/doc/mgr/telemetry.rst +++ b/doc/mgr/telemetry.rst @@ -83,6 +83,11 @@ Multiple channels can be enabled or disabled with:: ceph telemetry enable channel basic crash device ident perf ceph telemetry disable channel basic crash device ident perf +Channels can be enabled or disabled all at once with:: + + ceph telemetry enable channel all + ceph telemetry disable channel all + Please note that telemetry should be on for these commands to take effect. List all channels with:: diff --git a/src/pybind/mgr/telemetry/module.py b/src/pybind/mgr/telemetry/module.py index 446a1bf1be33a..ca039afe611bc 100644 --- a/src/pybind/mgr/telemetry/module.py +++ b/src/pybind/mgr/telemetry/module.py @@ -1438,6 +1438,13 @@ To enable, add '--license {LICENSE}' to the 'ceph telemetry on' command.''' msg = 'Telemetry is now disabled.' return 0, msg, '' + @CLIReadCommand('telemetry enable channel all') + def enable_channel_all(self, channels: List[str] = ALL_CHANNELS) -> Tuple[int, str, str]: + ''' + Enable all channels + ''' + return self.toggle_channel('enable', channels) + @CLIReadCommand('telemetry enable channel') def enable_channel(self, channels: Optional[List[str]] = None) -> Tuple[int, str, str]: ''' @@ -1445,6 +1452,13 @@ To enable, add '--license {LICENSE}' to the 'ceph telemetry on' command.''' ''' return self.toggle_channel('enable', channels) + @CLIReadCommand('telemetry disable channel all') + def disable_channel_all(self, channels: List[str] = ALL_CHANNELS) -> Tuple[int, str, str]: + ''' + Disable all channels + ''' + return self.toggle_channel('disable', channels) + @CLIReadCommand('telemetry disable channel') def disable_channel(self, channels: Optional[List[str]] = None) -> Tuple[int, str, str]: ''' -- 2.39.5