Skip to content

Commit 056d4f7

Browse files
committed
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 <[email protected]>
1 parent 1a4a128 commit 056d4f7

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

src/pybind/mgr/cephadm/module.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,6 +1716,10 @@ def hardware_powercycle(self, hostname: str, yes_i_really_mean_it: bool = False)
17161716
raise OrchestratorValidationError(f"Can't perform powercycle on node {hostname}: {e}")
17171717
return f'Powercycle scheduled on {hostname}'
17181718

1719+
@handle_orch_error
1720+
def node_proxy_fullreport(self, hostname: Optional[str] = None) -> Dict[str, Any]:
1721+
return self.node_proxy_cache.fullreport(hostname=hostname)
1722+
17191723
@handle_orch_error
17201724
def node_proxy_summary(self, hostname: Optional[str] = None) -> Dict[str, Any]:
17211725
return self.node_proxy_cache.summary(hostname=hostname)

src/pybind/mgr/orchestrator/_interface.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,14 @@ def node_proxy_summary(self, hostname: Optional[str] = None) -> OrchResult[Dict[
403403
"""
404404
raise NotImplementedError()
405405

406+
def node_proxy_fullreport(self, hostname: Optional[str] = None) -> OrchResult[Dict[str, Any]]:
407+
"""
408+
Return node-proxy full report
409+
410+
:param hostname: hostname
411+
"""
412+
raise NotImplementedError()
413+
406414
def node_proxy_firmwares(self, hostname: Optional[str] = None) -> OrchResult[Dict[str, Any]]:
407415
"""
408416
Return node-proxy firmwares report

src/pybind/mgr/orchestrator/module.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,7 @@ def _hardware_status(self, hostname: Optional[str] = None, _end_positional_: int
497497
"""
498498
table_heading_mapping = {
499499
'summary': ['HOST', 'STORAGE', 'CPU', 'NET', 'MEMORY', 'POWER', 'FANS'],
500+
'fullreport': [],
500501
'firmwares': ['HOST', 'COMPONENT', 'NAME', 'DATE', 'VERSION', 'STATUS'],
501502
'criticals': ['HOST', 'COMPONENT', 'NAME', 'STATUS', 'STATE'],
502503
'memory': ['HOST', 'NAME', 'STATUS', 'STATE'],
@@ -525,6 +526,15 @@ def _hardware_status(self, hostname: Optional[str] = None, _end_positional_: int
525526
row.extend([v['status'][key] for key in ['storage', 'processors', 'network', 'memory', 'power', 'fans']])
526527
table.add_row(row)
527528
output = table.get_string()
529+
elif category == 'fullreport':
530+
if hostname is None:
531+
output = "Missing host name"
532+
elif format != Format.json:
533+
output = "fullreport only supports json output"
534+
else:
535+
completion = self.node_proxy_fullreport(hostname=hostname)
536+
fullreport: Dict[str, Any] = raise_if_exception(completion)
537+
output = json.dumps(fullreport)
528538
elif category == 'firmwares':
529539
output = "Missing host name" if hostname is None else self._firmwares_table(hostname, table, format)
530540
elif category == 'criticals':

0 commit comments

Comments
 (0)