From cae87cc42935cd5cc6c6a2096af215b8dc64171d Mon Sep 17 00:00:00 2001 From: Yaarit Hatuka Date: Fri, 31 Jan 2020 16:36:23 -0500 Subject: [PATCH] mgr/telemetry: added 'telemetry show-device' command Added 'telemetry show-device' command to print a preview of telemetry device report. Added a message at the bottom of 'telemetry show' about 'telemetry show-device' new command. Signed-off-by: Yaarit Hatuka --- src/pybind/mgr/telemetry/module.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/telemetry/module.py b/src/pybind/mgr/telemetry/module.py index 97b35353893..ce8dd71e51a 100644 --- a/src/pybind/mgr/telemetry/module.py +++ b/src/pybind/mgr/telemetry/module.py @@ -169,6 +169,11 @@ class Module(MgrModule): "desc": "Show last report or report to be sent", "perm": "r" }, + { + "cmd": "telemetry show-device", + "desc": "Show last device report or device report to be sent", + "perm": "r" + }, { "cmd": "telemetry on name=license,type=CephString,req=false", "desc": "Enable telemetry reports from this cluster", @@ -748,7 +753,12 @@ class Module(MgrModule): report = self.compile_report( channels=command.get('channels', None) ) - return 0, json.dumps(report, indent=4, sort_keys=True), '' + report = json.dumps(report, indent=4, sort_keys=True) + if self.channel_device: + report += '\n \nDevice report is generated separately. To see it run \'ceph telemetry show-device\'.' + return 0, report, '' + elif command['prefix'] == 'telemetry show-device': + return 0, json.dumps(self.gather_device_report(), indent=4, sort_keys=True), '' else: return (-errno.EINVAL, '', "Command not found '{0}'".format(command['prefix'])) -- 2.47.3