diff --git a/examples/simple-proliant.py b/examples/simple-proliant.py index ca481c3..d0c7e61 100644 --- a/examples/simple-proliant.py +++ b/examples/simple-proliant.py @@ -41,7 +41,9 @@ print ("Redfish API version : %s \n" % remote_mgmt.get_api_version()) # remote_mgmt.Systems.systems_list[0] = remote_mgmt.Systems.managed_system print("Bios version : {}\n".format(remote_mgmt.Systems.systems_list[0].get_bios_version())) +print("Serial Number : {}\n".format(remote_mgmt.Systems.systems_list[0].get_serial_number())) +print("Power State : {}\n".format(remote_mgmt.Systems.systems_list[0].get_power())) +print("Parameter 'Model' : {}\n".format(remote_mgmt.Systems.systems_list[0].get_parameter("Model"))) -print("Serial Number : {}\n".format(remote_mgmt.Systems.systems_list[0].get_serialnumber())) remote_mgmt.logout() diff --git a/redfish/types.py b/redfish/types.py index 80185dd..ef13b7d 100644 --- a/redfish/types.py +++ b/redfish/types.py @@ -186,7 +186,7 @@ class Systems(Base): # Hopefully this kind of discrepencies will be fixed with Redfish 1.0 (August) return self.data.BiosVersion - def get_serialnumber(self): + def get_serial_number(self): try: # Returned by proliant return self.data.SerialNumber @@ -194,6 +194,18 @@ class Systems(Base): # Returned by mockup. # Hopefully this kind of discrepencies will be fixed with Redfish 1.0 (August) return "" + + def get_power(self): + try: + return self.data.Power + except: + return "" + + def get_parameter(self, parameter_name): + try: + return self.data[parameter_name] + except: + return "Parameter does not exist" class SystemsCollection(BaseCollection):