]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: add specification comments to osd_command
authorLaura Flores <lflores@redhat.com>
Wed, 28 Jul 2021 16:50:25 +0000 (16:50 +0000)
committerLaura Flores <lflores@redhat.com>
Wed, 28 Jul 2021 16:50:25 +0000 (16:50 +0000)
This comment explains the parameters that osd_command expects, as well as where to find valid prefixes that can be used with it.

Signed-off-by: Laura Flores <lflores@redhat.com>
src/pybind/mgr/mgr_module.py

index 60a405847d2b47a89c6de6cb2e23c21fc854e2c3..f547d87f92620df6dd0064619aaf396b9fb614fa 100644 (file)
@@ -1500,7 +1500,18 @@ class MgrModule(ceph_module.BaseMgrModule, MgrModuleLoggingMixin):
         return r
 
     def osd_command(self, cmd_dict: dict, inbuf: Optional[str] = None) -> Tuple[int, str, str]:
+        """
+        Helper for osd command execution.
+
+        See send_command for general case. Also, see osd/OSD.cc for available commands.
 
+        :param dict cmd_dict: expects a prefix and an osd id, i.e.:
+            cmd_dict = {
+                'prefix': 'perf histogram dump',
+                'id': '0'
+            }
+        :return: status int, out std, err str
+        """
         t1 = time.time()
         result = CommandResult()
         self.send_command(result, "osd", cmd_dict['id'], json.dumps(cmd_dict), "", inbuf)