]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: add fullreport in ceph orch CLI (node-proxy) 55537/head
authorGuillaume Abrioux <gabrioux@ibm.com>
Wed, 14 Feb 2024 09:02:50 +0000 (09:02 +0000)
committerGuillaume Abrioux <gabrioux@ibm.com>
Wed, 14 Feb 2024 09:03:49 +0000 (09:03 +0000)
This adds the `fullreport` category to the `ceph orch hardware status` CLI.

Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
src/pybind/mgr/cephadm/module.py
src/pybind/mgr/orchestrator/_interface.py
src/pybind/mgr/orchestrator/module.py

index 1451943ab28aacc311845e713041ffa9ad74bf2a..87f7024bb2555510a7418f357634559a2bed0593 100644 (file)
@@ -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)
index ed8d47c8cac4c62bd10163d522b7df1f51f1bade..bc1721ab2511f80c9f3d551f6f3991cec399c4fd 100644 (file)
@@ -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
index c8606a6286e4632fd3a8d40168ea8d6fdfa26609..c36c85e7d99ea0c97b353083df5f9efc4f42c96b 100644 (file)
@@ -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':