From 4b9bc24f0dd1ab261c4b87667c6cdb77d3785185 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Thu, 6 Apr 2023 14:55:41 +0200 Subject: [PATCH] node-proxy: implement network endpoint This adds the required logic for the endpoint '/system/network' to gather and return data about network interfaces. Signed-off-by: Guillaume Abrioux --- src/cephadm/node-proxy/redfish_system.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/cephadm/node-proxy/redfish_system.py b/src/cephadm/node-proxy/redfish_system.py index 3d05718be171d..76d5183541595 100644 --- a/src/cephadm/node-proxy/redfish_system.py +++ b/src/cephadm/node-proxy/redfish_system.py @@ -70,10 +70,17 @@ class RedfishSystem(System): log.info("Updating network") network_info = self.client.get_path(net_path) self._system['network'] = {} + result = dict() for interface in network_info['Members']: interface_path = interface['@odata.id'] interface_info = self.client.get_path(interface_path) - self._system['network'][interface_info['Id']] = interface_info + interface_id = interface_info['Id'] + result[interface_id] = dict() + result[interface_id]['description'] = interface_info['Description'] + result[interface_id]['name'] = interface_info['Name'] + result[interface_id]['speed_mbps'] = interface_info['SpeedMbps'] + result[interface_id]['status'] = interface_info['Status'] + self._system['network'] = result def _update_processors(self): cpus_path = self._system['Processors']['@odata.id'] -- 2.39.5