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

Method tell_command

src/pybind/mgr/mgr_module.py:1882–1905  ·  view source on GitHub ↗

Helper for `ceph tell` command execution. See send_command for general case. :param dict cmd_dict: expects a prefix i.e.: cmd_dict = { 'prefix': 'heap', 'heapcmd': 'stats', } :return: status int, out std, err

(self, daemon_type: str, daemon_id: str, cmd_dict: dict, inbuf: Optional[str] = None, one_shot: bool = False)

Source from the content-addressed store, hash-verified

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 """
1884 Helper for `ceph tell` command execution.
1885
1886 See send_command for general case.
1887
1888 :param dict cmd_dict: expects a prefix i.e.:
1889 cmd_dict = {
1890 'prefix': 'heap',
1891 'heapcmd': 'stats',
1892 }
1893 :return: status int, out std, err str
1894 """
1895 t1 = time.time()
1896 result = CommandResult()
1897 self.send_command(result, daemon_type, daemon_id, json.dumps(cmd_dict), "", inbuf, one_shot=one_shot)
1898 r = result.wait()
1899 t2 = time.time()
1900
1901 self.log.debug("tell_command on {0}.{1}: '{2}' -> {3} in {4:.5f}s".format(
1902 daemon_type, daemon_id, cmd_dict['prefix'], r[0], t2 - t1
1903 ))
1904
1905 return r
1906
1907 def get_quiesce_leader_gid(self, fscid: str) -> Optional[int]:
1908 leader_gid: Optional[int] = None

Callers 3

tell_quiesce_leaderMethod · 0.95
parse_heap_statsMethod · 0.45
get_mempoolMethod · 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