MCPcopy Create free account
hub / github.com/ceph/ceph / osd_command

Method osd_command

src/pybind/mgr/mgr_module.py:1857–1880  ·  view source on GitHub ↗

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'

(self, cmd_dict: dict, inbuf: Optional[str] = None)

Source from the content-addressed store, hash-verified

1855 return r
1856
1857 def osd_command(self, cmd_dict: dict, inbuf: Optional[str] = None) -> Tuple[int, str, str]:
1858 """
1859 Helper for osd command execution.
1860
1861 See send_command for general case. Also, see osd/OSD.cc for available commands.
1862
1863 :param dict cmd_dict: expects a prefix and an osd id, i.e.:
1864 cmd_dict = {
1865 'prefix': 'perf histogram dump',
1866 'id': '0'
1867 }
1868 :return: status int, out std, err str
1869 """
1870 t1 = time.time()
1871 result = CommandResult()
1872 self.send_command(result, "osd", cmd_dict['id'], json.dumps(cmd_dict), "", inbuf)
1873 r = result.wait()
1874 t2 = time.time()
1875
1876 self.log.debug("osd_command: '{0}' -> {1} in {2:.3f}s".format(
1877 cmd_dict['prefix'], r[0], t2 - t1
1878 ))
1879
1880 return r
1881
1882 def tell_command(self, daemon_type: str, daemon_id: str, cmd_dict: dict, inbuf: Optional[str] = None, one_shot: bool = False) -> Tuple[int, str, str]:
1883 """

Callers 1

get_osd_histogramsMethod · 0.45

Calls 5

send_commandMethod · 0.95
waitMethod · 0.95
CommandResultClass · 0.85
debugMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected