White Papers
30 Implementation of the DMTF Redfish API on Dell EMC PowerEdge Servers
print "- WARNING, JobStatus not completed, current status is:
\"%s\", current job polling time is: %s\n" %
(data[u'Message'],str(current_time)[0:7])
time.sleep(30)
### Function to check attribute new current value
def get_new_current_value():
response =
requests.get('https://%s/redfish/v1/Systems/System.Embedded.1/Bios' %
idrac_ip,verify=False,auth=(idrac_username, idrac_password))
data = response.json()
current_value_new = data[u'Attributes'][attribute_name]
if current_value_new == pending_value:
print "\n- PASS, BIOS attribute \"%s\" new current value is: %s" %
(attribute_name, pending_value)
else:
print "n\- FAIL, BIOS attribute \"%s\" attribute not set to: %s" %
(attribute_name, current_value)
sys.exit()
### Run code
get_attribute_current_value()
set_bios_attribute()
create_bios_config_job()
get_job_status()
reboot_server()
loop_job_status()
get_new_current_value()
Output:
% redfish_set_one_bios_attribute.py 100.65.99.66 root calvin MemTest Enabled
- WARNING: Current value for MemTest is: Disabled, setting to: Enabled
- PASS: Command passed to set BIOS attribute MemTest pending value to Enabled
- PASS: Command passed to create target config job, status code 200 returned.
- WARNING: JID_956505296759 job ID successfully created
- PASS, Command passed to check job status, code 200 returned
JobID = JID_956505296759
Name = ConfigBIOS:BIOS.Setup.1-1