From: Guillaume Abrioux Date: Wed, 14 Feb 2024 09:02:50 +0000 (+0000) Subject: mgr/cephadm: add fullreport in ceph orch CLI (node-proxy) X-Git-Tag: v19.3.0~16^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F55537%2Fhead;p=ceph.git mgr/cephadm: add fullreport in ceph orch CLI (node-proxy) This adds the `fullreport` category to the `ceph orch hardware status` CLI. Signed-off-by: Guillaume Abrioux --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 1451943ab28a..87f7024bb255 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -1716,6 +1716,10 @@ Then run the following: raise OrchestratorValidationError(f"Can't perform powercycle on node {hostname}: {e}") return f'Powercycle scheduled on {hostname}' + @handle_orch_error + def node_proxy_fullreport(self, hostname: Optional[str] = None) -> Dict[str, Any]: + return self.node_proxy_cache.fullreport(hostname=hostname) + @handle_orch_error def node_proxy_summary(self, hostname: Optional[str] = None) -> Dict[str, Any]: return self.node_proxy_cache.summary(hostname=hostname) diff --git a/src/pybind/mgr/orchestrator/_interface.py b/src/pybind/mgr/orchestrator/_interface.py index ed8d47c8cac4..bc1721ab2511 100644 --- a/src/pybind/mgr/orchestrator/_interface.py +++ b/src/pybind/mgr/orchestrator/_interface.py @@ -403,6 +403,14 @@ class Orchestrator(object): """ raise NotImplementedError() + def node_proxy_fullreport(self, hostname: Optional[str] = None) -> OrchResult[Dict[str, Any]]: + """ + Return node-proxy full report + + :param hostname: hostname + """ + raise NotImplementedError() + def node_proxy_firmwares(self, hostname: Optional[str] = None) -> OrchResult[Dict[str, Any]]: """ Return node-proxy firmwares report diff --git a/src/pybind/mgr/orchestrator/module.py b/src/pybind/mgr/orchestrator/module.py index c8606a6286e4..c36c85e7d99e 100644 --- a/src/pybind/mgr/orchestrator/module.py +++ b/src/pybind/mgr/orchestrator/module.py @@ -497,6 +497,7 @@ class OrchestratorCli(OrchestratorClientMixin, MgrModule, """ table_heading_mapping = { 'summary': ['HOST', 'STORAGE', 'CPU', 'NET', 'MEMORY', 'POWER', 'FANS'], + 'fullreport': [], 'firmwares': ['HOST', 'COMPONENT', 'NAME', 'DATE', 'VERSION', 'STATUS'], 'criticals': ['HOST', 'COMPONENT', 'NAME', 'STATUS', 'STATE'], 'memory': ['HOST', 'NAME', 'STATUS', 'STATE'], @@ -525,6 +526,15 @@ class OrchestratorCli(OrchestratorClientMixin, MgrModule, row.extend([v['status'][key] for key in ['storage', 'processors', 'network', 'memory', 'power', 'fans']]) table.add_row(row) output = table.get_string() + elif category == 'fullreport': + if hostname is None: + output = "Missing host name" + elif format != Format.json: + output = "fullreport only supports json output" + else: + completion = self.node_proxy_fullreport(hostname=hostname) + fullreport: Dict[str, Any] = raise_if_exception(completion) + output = json.dumps(fullreport) elif category == 'firmwares': output = "Missing host name" if hostname is None else self._firmwares_table(hostname, table, format) elif category == 'criticals':