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)
| 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 | """ |
no test coverage detected