]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
node-proxy: implement network endpoint
authorGuillaume Abrioux <gabrioux@ibm.com>
Thu, 6 Apr 2023 12:55:41 +0000 (14:55 +0200)
committerGuillaume Abrioux <gabrioux@ibm.com>
Thu, 25 Jan 2024 14:49:07 +0000 (14:49 +0000)
This adds the required logic for the endpoint '/system/network'
to gather and return data about network interfaces.

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

src/cephadm/node-proxy/redfish_system.py

index 3d05718be171db471e9ff05c4715f6ecd5819e73..76d5183541595e8e300ebd75f383d01a856de3c3 100644 (file)
@@ -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']