Reference Guide

21 RESTful Server Configuration with iDRAC RESTful API
</Component>
</SystemConfiguration>
Job ID = JID_963619479070
Name = Export: Server Configuration Profile
Message = Successfully exported Server Configuration Profile
JobStatus = Completed
JID_963619479070 completed in: 0:00:04
Exported attributes are also saved in file: 2017-6-2_11555_export.xml
2.5 Previewing SCP imports with iDRAC RESTful API
Before importing an SCP to apply configuration settings to a server, it is recommended to preview the SCP
file using the ImportSystemConfigurationPreview method. The following Python script will preview the
import of an SCP file stored on a CIFS share with the iDRAC IP address, iDRAC admin credentials and the
SCP file name passed as arguments.
Script: redfish_SCP_import_preview.py
import requests, json, re, sys, time
from datetime import datetime
try:
idrac_ip = sys.argv[1]
idrac_username = sys.argv[2]
idrac_password = sys.argv[3]
file = sys.argv[4]
except:
print "\n- FAIL, you must pass in script name along with iDRAC IP/iDRAC username/iDRAC paasswo
rd/file name"
sys.exit()
url = 'https://%s/redfish/v1/Managers/iDRAC.Embedded.1/Actions/Oem/EID_674_Manager.ImportSystemCon
figurationPreview' % idrac_ip
payload = {"ShareParameters":{"Target":"ALL","IPAddress":"192.168.0.130","ShareName":"cifs_share",
"ShareType":"CIFS","FileName":file,"UserName":"cifs_user","Password":"cifs_password"}}
headers = {'content-type': 'application/json'}
response = requests.post(url, data=json.dumps(payload), headers=headers, verify=False, auth=(idrac
_username,idrac_password))
d=str(response.__dict__)
try:
z=re.search("JID_.+?,",d).group()
except:
print "\n- FAIL: detailed error message: {0}".format(response.__dict__['_content'])