]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: add fullreport in ceph orch CLI (node-proxy) 55538/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:05:53 +0000 (09:05 +0000)
This adds the `fullreport` category to the `ceph orch hardware status` CLI.

Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
(cherry picked from commit 056d4f7a3d4ca8564b374880551a574858e68395)

src/pybind/mgr/cephadm/module.py
src/pybind/mgr/orchestrator/_interface.py
src/pybind/mgr/orchestrator/module.py

index 54bbd63b4b0f2726747b4ca63b8bdf57edbbd340..b59cf6687f9f46df331ebdb051deef25c7b459d6 100644 (file)
@@ -1700,6 +1700,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 7892f4946f8a8f4689126348bbd113fd06b481d9..e5ee5035133e3d43048163a6a3e209e4a2573869 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 0763cdcc5d13dc6695eb244cc21f09da46a5861d..054cd58f8b0d86a743bc0ff7f7aa00d789aec53c 100644 (file)
@@ -496,6 +496,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'],
@@ -524,6 +525,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':