White Papers

32 Implementation of the DMTF Redfish API on Dell EMC PowerEdge Servers
idrac_password = sys.argv[3]
except:
print "\n- FAIL, you must pass in script name along with iDRAC IP / iDRAC
username / iDRAC password. Example: \"script_name.py 192.168.0.120 root
calvin\""
sys.exit()
print "\n- Getting current firmware version(s) for all devices in the system
iDRAC supports\n"
time.sleep(3)
req = requests.get('https://%s/redfish/v1/UpdateService/FirmwareInventory/'
% (idrac_ip), auth=(idrac_username, idrac_password), verify=False)
statusCode = req.status_code
data = req.json()
number_of_devices=len(data[u'Members'])
count = 0
installed_devices=[]
while count != len(data[u'Members']):
a=data[u'Members'][count][u'@odata.id']
a=a.replace("/redfish/v1/UpdateService/FirmwareInventory/","")
if "Installed" in a:
installed_devices.append(a)
count +=1
installed_devices_details=["\n--- Firmware Inventory ---"]
a="-"*75
installed_devices_details.append(a)
l=[]
ll=[]
for i in installed_devices:
req =
requests.get('https://%s/redfish/v1/UpdateService/FirmwareInventory/%s' %
(idrac_ip, i), auth=(idrac_username, idrac_password), verify=False)
statusCode = req.status_code
data = req.json()
a="Name: %s" % data[u'Name']
l.append(a.lower())
installed_devices_details.append(a)
a="Firmware Version: %s" % data[u'Version']
ll.append(a.lower())
installed_devices_details.append(a)
a="Updateable: %s" % data[u'Updateable']
installed_devices_details.append(a)
a="-"*75
installed_devices_details.append(a)
for i in installed_devices_details:
print i