Unsolved

This post is more than 5 years old

1 Rookie

 • 

4 Posts

2473

September 6th, 2019 15:00

Cannot update firmware via REST API

I'm trying to update iDRAC firmware via REST API, but it fails. If I use the GUI, it works even though I use the same repository, catalog, and baseline. I'm using OpenManage Enterprise 3.2.1.

I could not find the details on updating firmware via API in the OMEnt API document, so I followed the threads below:

https://www.dell.com/community/Dell-OpenManage-Enterprise/Updating-firmware-via-REST-API/m-p/6072728
https://www.dell.com/community/Dell-OpenManage-Enterprise/Powershell-REST-API-Script-for-updating-firmware/td-p/6242026 

My JSON request payload was like this:






{
"Id":0,
"JobName":"Update Firmware",
"JobDescription":"Firmware Update Job",
"Schedule":"startnow",
"State":"Enabled",
"JobType": {
"Id":5,
"Name":"Update_Task"
},
"Params": [
{
"Key": "stagingValue",
"Value": "false"
},
{
"Key": "signVerify",
"Value": "true"
},
{
"Key": "complianceUpdate",
"Value": "true"
},
{
"Key": "operationName",
"Value": "INSTALL_FIRMWARE"
},
{
"Key": "catalogId",
"Value": "25"
},
{
"Key": "repositoryId",
"Value": "15"
},
{
"Key": "complianceReportId",
"Value": "14"
}],
"Targets":[
{
"Id": 10134,
"Data": "DCIM:INSTALLED#iDRAC.Embedded.1-1#IDRACinfo;",
"TargetType":
{
"Id":1000,
"Name":"DEVICE"
}
}]
}

And sent a POST request to /api/JobService/Jobs. It created a firmware update job, but it failed with the following error:


















































Package(s) download operation failed.

Firmawre Update Job via APIFirmawre Update Job via API


If I did a firmware update from the GUI, it worked fine. OMEnt updated iDRAC firmware on the target.

I checked the request in Google Chrome developer tool (F12) when I did from the GUI, and saw the parameters like catalog ID, repository ID, Compliance Report ID, Device ID, Data, etc. were exactly the same as the API request.
It is difficult for me to do further troubleshooting at this point. Any help would be appreciated.



8 Posts

September 12th, 2019 11:00

Not sure how to do it via the "regular" api, but i have found that POSTing the following JSON (python, so self.catalogId, etc... comes from another api call):

payload = {'taskName': 'Update Firmware',
                   'taskParams': [
                       {'jobId': 0, 'key': 'operationName', 'value': 'INSTALL_FIRMWARE'},
                       {'jobId': 0, 'key': 'complianceUpdate', 'value': 'true'},
                       {'jobId': 0, 'key': 'signVerify', 'value': 'true'},
                       {'jobId': 0, 'key': 'stagingValue', 'value': 'false'}],
                   'tasks': [
                       {'catalogId': self.catalogId,
                        'repositoryId': self.repoId,
                        'baselineId': baseline_id,
                        'baselineName': baseline_name,
                        'taskTargets': [
                            {'id': device_id,
                             'data': target_string,
                             'targetType':
                                 {'id': 1000, 'name': 'Server'}
                             }],
                        'dupTask': False}],
                   'schedule': self.update_schedule,
                   'taskDescription': 'Firmware Update Job: {}'.format(baseline_name)}

against the api endpoint: "https://OME_HOST/msm/api/Console/Firmware/UpdateTask"  works well.  "target_string" entry in "data" comes from another api call used to grab all the items which need updated, which in your case would be "DCIM:INSTALLED#iDRAC.Embedded.1-1#IDRACinfo;"

1 Rookie

 • 

4 Posts

September 12th, 2019 14:00

Thank you for your response, willid32!

Yes, I saw the same request from the GUI (browser) to OMEnt (the endpoint was slightly different, /core/api/Console/Firmware/UpdateTask). That may work, but it is not the standard API endpoint. I can't find the firmware update details in OMEnt API document, so I guess I need to open a case with DELL on this problem to get proper support.

I'm creating workflows that utilize API endpoints to automate some tasks like firmware update, hardware configuration, etc. for a multi-vendor environment (OMEnt for DELL, and other management tools for other vendors). Using non-standard APIs may cause some problems in the future, so I would like to avoid that.

Anyways, thank you for the information. I really appreciate it.

8 Posts

September 16th, 2019 08:00

mm77, You're welcome. I understand not wanting to use the non-standard apis. I use them heavily in automation, deployments, firmware upgrades, etc, but created a solution to alert me of any "internal api" changes since the official API is lacking. This is obviously not for everyone, but I have a Teamcity job that runs when a new version is released, an OME docker image is built and spun up, then using my python library i created I have a test suite that runs through api calls to check and make sure nothing changed. Again, this is not for everyone, just my solution so ensure my automation stays running, and notifies me if changes need to be made. Just my little workaround until the "public" API gets up to speed.

April 2nd, 2020 08:00

@mm77 ,

Did you ever get this resolved? I am having the same issue and can't figure out why it's failing. 

Thanks!

 

 

No Events found!

Top