Reference Guide
18 RESTful Server Configuration with iDRAC RESTful API
- Query job ID command passed
Job ID = JID_968007336828
Name = Export: Server Configuration Profile
Message = Successfully exported Server Configuration Profile
JobStatus = Completed
JID_968007336828 completed in: 0:00:13
$
2.4 Exporting SCP to a streamed local file
Exporting SCP directly to a local file is supported with iDRAC7/iDRAC8 with firmware version 2.50.50.50 or
later, and with iDRAC9 firmware version 3.00.00.00 or later. In the following example, the SCP values are
streamed to a local file on the client executing the script. The required parameters are the iDRAC IP address,
and iDRAC admin username and password. The export format will be XML.
NOTE: The “Target” setting picks the subsection of interest. In this case it is set to “BIOS” but it could be
changed to export settings for “RAID”, “NIC”, “iDRAC”, etc. This can be very useful to select specific sections
to export and subsequently import on another system. There is no need to clone the entire server if a targeted
approach will meet the need.
Script – redfish_SCP_export_local.py
# Python script using Redfish API to export SCP attributes to a local file
import requests, json, sys, re, time
from datetime import datetime
try:
idrac_ip = sys.argv[1]
idrac_username = sys.argv[2]
idrac_password = sys.argv[3]
except:
print "-
FAIL, you must pass in script name along with iDRAC IP/iDRAC username/iDRAC password"
sys.exit()
url = 'https://%s/redfish/v1/Managers/iDRAC.Embedded.1/Actions/Oem/EID_674_Manager.ExportSystemCon
figuration' % idrac_ip
payload = {"ExportFormat":"XML","ShareParameters":{"Target":"BIOS"}}
headers = {'content-type': 'application/json'}
response = requests.post(url, data=json.dumps(payload), headers=headers, verify=False, auth=(idrac
_username,idrac_password))
if response.status_code != 202:
print "- FAIL, status code not 202\n, code is: %s" % response.status_code
print "- Error details: %s" % response.__dict__
sys.exit()
else:
print "\n- Job ID successfully created for ExportSystemConfiguration method\n"