]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/telemetry: added 'telemetry show-device' command
authorYaarit Hatuka <yaarit@redhat.com>
Fri, 31 Jan 2020 21:36:23 +0000 (16:36 -0500)
committerYaarit Hatuka <yaarit@redhat.com>
Fri, 31 Jan 2020 21:36:23 +0000 (16:36 -0500)
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 <yaarit@redhat.com>
src/pybind/mgr/telemetry/module.py

index 97b353538931373aac7ad1244019793e6f7058c6..ce8dd71e51a1ca63b7dbcfbda189dbcff4af1c8c 100644 (file)
@@ -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']))