From: Laura Flores Date: Wed, 28 Jul 2021 16:50:25 +0000 (+0000) Subject: mgr: add specification comments to osd_command X-Git-Tag: v17.1.0~1008^2~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b14ec61df8fead47215361c62e08377ba85e2c80;p=ceph.git mgr: add specification comments to osd_command 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 --- diff --git a/src/pybind/mgr/mgr_module.py b/src/pybind/mgr/mgr_module.py index 60a405847d2..f547d87f926 100644 --- a/src/pybind/mgr/mgr_module.py +++ b/src/pybind/mgr/mgr_module.py @@ -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)