White Papers

20 RESTful Server Configuration with iDRAC RESTful API
statusCode = req.status_code
data = req.json()
message_string=data[u"Messages"]
current_time=(datetime.now()-start_time)
if statusCode == 202 or statusCode == 200:
print "\n- Execute job ID command passed, checking job status...\n"
time.sleep(1)
else:
print "Execute job ID command failed, error code is: %s" % statusCode
sys.exit()
if str(current_time)[0:7] >= "0:10:00":
print "\n-
FAIL, Timeout of 10 minutes has been reached before marking the job completed."
sys.exit()
else:
print "- Job not marked completed, current status is: %s" % data[u"TaskState"]
print "- Message: %s\n" % message_string[0][u"Message"]
time.sleep(1)
continue
data = req.json()
print "Job ID = "+data[u"Id"]
print "Name = "+data[u"Name"]
print "Message = "+data[u"Messages"]
Executing the script results in the attributes being printed to standard output and also saved to a local XML
file named with the current date and time.
python ./redfish_SCP_export_local.py 192.168.0.120 root calvin
- Job ID successfully created for ExportSystemConfiguration method
- Export locally successfully passed. Attributes exported:
<SystemConfiguration Model="PowerEdge C6420" ServiceTag="BLDXXXX" TimeStamp="Tue Jun 6 14:12:21 2
017">
<!--Export type is Normal,XML,Selective-->
<!--
Exported configuration may contain commented attributes. Attributes may be commented due to depend
ency, destructive nature, preserving server identity or for security reasons.-->
<Component FQDD="BIOS.Setup.1-1">
<Attribute Name="WorkloadProfile">NotAvailable</Attribute>
<Attribute Name="MemTest">Disabled</Attribute>
<Attribute Name="MemOpMode">OptimizerMode</Attribute>
<Attribute Name="NodeInterleave">Disabled</Attribute>
<Attribute Name="CorrEccSmi">Enabled</Attribute>
<Attribute Name="OppSrefEn">Disabled</Attribute>
<Attribute Name="LogicalProc">Enabled</Attribute>
<Attribute Name="CpuInterconnectBusSpeed">MaxDataRate</Attribute>
<Attribute Name="ProcVirtualization">Enabled</Attribute>
<Attribute Name="ProcAdjCacheLine">Disabled</Attribute>
<Output shortened for brevity>