API Guide

Table Of Contents
preCheck: Prerequisites check before firmware update.
exit MaintenanceMode: Option to exit from maintenance mode.
resetIDracAndDeleteJobs: Set this value as TRUE. Clears all the iDRAC jobs present in the Job Queue followed by iDRAC
reset before updating firmware on the host.
If you do not mention any value while running API, OMIVV considers the settings configured on the Settings >
Firmware Update Settings on the User Interface.
enterMaintenanceModetimeout: Time out value for host to enter maintenance mode. Enter the Maintenance Mode
timeout value between 601440 minutes. If the wait time goes beyond the specified time, the update jobs fail and enter
maintenance task will be canceled or timed out. However, the components may get updated automatically when the host
is restarted.
reboot options: Host reboot options. In this article, we use the host reboot option as Safe reboot.
The possible input value is true or false. Default value is true if the required value is not entered. For cluster-level firmware
update, the only allowed value is true.
Sample code to create the firmware update job:
```json
def creatHostFirmwareUpdateJob(omivvIP, bearerToken, repoId, bundleID, packageIds,
hostID, jobName):
url = "https://" + omivvIP + "/Spectre/api/rest/v1/Services/UpdateService/Jobs"
head = {'Authorization': 'Bearer ' + bearerToken}
postBodyData = {"jobname": jobName, "jobdesc": "FWTest1Desc", "updateType":
"FIRMWARE", "updateTargetType" : "HOST", "schedule":{"runLater":"true",
"runNow":"false","dateTime":"2021-10-24T02:30:01Z"},
"firmwareRepoProfileID":repoId,"rebootOptions":"FORCEREBOOT","preCheck":"false","firmw
areUpdateTargets":
[{"hostId":hostID,"bundleId":bundleID,"packageIDs":packageIds}],"jobSpecificCustomConf
iguration":
{"exitMaintenanceMode":"true","migratePoweredOffAndSuspendedVMs":"true","resetIDracAnd
DeleteJobs":"false","enterMaintenanceModetimeout":60, "enterMaintenanceModeOption" :
"Ensure accessibility"}}
jsonReponse = requests.post(url, json=postBodyData, verify=False,headers=head)
if(jsonReponse.status_code == 202):
json_object = json.dumps(jsonReponse.json(), indent=4, sort_keys=True)
print(json_object)
else:
print("creatHostFirmwareUpdateJob API is failed.")
```
7. Track firmware update job. After you create the firmware update job, you can track the job status by calling the following
API received from the response of step 6.
/Services/UpdateService/Jobs/{firmware update job ID}
```json
def getHostFirmwareUpdateJobDetails(omivvIP, bearerToken, JobId):
url ="https://" + omivvIP + "/Spectre/api/rest/v1/Services/UpdateService/Jobs/" +
JobId
head = {'Authorization': 'Bearer ' + bearerToken}
jsonReponse = requests.get(url, verify=False, headers=head)
if (jsonReponse.status_code == 200):
json_object = json.dumps(jsonReponse.json(), indent=4, sort_keys=True)
print(json_object)
else:
print("Get getHostFirmwareUpdateJobDetails failed")
```
Retrieve OMIVV license information
Prerequisites
Ensure that:
Use cases
29