Skip to main content

POST – HTTP Push update for firmware

This operation can perform an update of installed software component(s) by pushing a software image file to the URI referenced by UpdateService.HttpPushUri property. In XCC2 redfish service, the UpdateService.HttpPushUri property value is “/fwupdate”.

Request URL

POST https://<BMC_IPADDR>/fwupdate

Request body

The HTTP POST operation shall provide authentication with the sufficient privilege to access the UpdateService resource.

The property “HttpPushUriOptions/HttpPushUriApplyTime/ApplyTime” needs to be set prior to performing a firmware update via Http Push Update.

Response

FieldTypeError Message ID
IdString

The created task ID.

NameString

Task name.

DescriptionString

This resource represents a task for a Redfish implementation.

TaskMonitorString

The URI of the Task Monitor for this task.

StartTimeString

The date-time stamp that the task was last started.

TaskStateString

The state of the task.

MessagesArray

This is an array of messages associated with the task.

PercentCompleteInteger

Task completion in percent.

HidePayloadBoolean

Indicates Payload object is hdden and not returned on GET.

Note
The client may optionally include "Content-Length" header in the POST request to indicate the POST body size. XCC2 checks this header and verity the size is supported for firmware updates. If the file size is beyond what the service can support, it returns code 413 with error messages indicating file size too large.

Http Push update may be rejected with code 503 when Multipart HTTP push update is in progress, and vice versa.

Status code

HTTP Status CodeError Message ID
202Accepted
400BadRequest, ActionParamMissing , ActionParamTypeError , ActionParamFormatError
413RequestEntityTooLarge
500InternalError
503ServiceUnavailable

Example

The following example with curl commands is the HTTP push update procedure for UEFI/ BMC(Backup).

  1. Update HttpPushUriTargetsBusy to true.

    Client should first check HttpPushUriTargetsBusy property. When the value is false, change HttpPushUriTargetsBusy property to True, in order to claim the service is occupied for firmware update. Other clients should not update firmware on this server to avoid interference.

    The PATCH body is:

    {
    "HttpPushUriTargetsBusy" : true
    }

  2. If client intends to update BMC(Backup), there is an extra step here to provide HttpPushUriTargets.

    Skip this step if it is not to update BMC(Backup) firmware.

    The PATCH body is:

       "HttpPushUriTargets" : [
    "/redfish/v1/UpdateService/FirmwareInventory/BMC-Backup"
    ]

  3. Update HttpPushUriOptions/HttpPushUriApplyTime/ApplyTime to "Immediate" or "OnReset".

    The PATCH body is:

    {
    "HttpPushUriOptions": {
    "HttpPushUriApplyTime": {
    "ApplyTime": "Immediate"
    }
    }
    }

  4. Push the firmware image to the URL in HttpPushUri property.

    Sample curl command is below for HTTP push update request for UEFI.

    curl -s -k -u USERID:PASSW0RD --data-binary @/tmp/uefi/lnvgy_fw_uefi_ive148m-2.41_anyos_32-64.uxz https://192.168.1.126:443/fwupdate
    Note
    you can add ‘-v’ to the curl command to observe file transfer progress.

    Sample curl command is below for HTTP push update request for BMC(Backup).

    curl -s -k -u USERID:PASSW0RD --data-binary @lnvgy_fw_xcc_usx319b-0.99_anyos_comp.uxz https://192.168.1.126:443/fwupdate

    The following sample JSON response is returned.

    {
    "@odata.type":"#Task.v1_5_1.Task",
    "@odata.id":"/redfish/v1/TaskService/Tasks/c3f04c5f-3118-409c-a33d-5abc8a631009",
    "TaskMonitor":"/redfish/v1/TaskService/f1874fd8-78d8-42b2-a64c-26f7bb31fa45",
    "Messages":[],"Description":"This resource represents a task for a Redfish implementation.",
    "StartTime":"2023-01-04T08:05:53+00:00",
    "@odata.etag":"\"1672819553334\"",
    "PercentComplete":0,
    "HidePayload":true,
    "@odata.context":"/redfish/v1/$metadata#Task.Task",
    "TaskState":"New",
    "Id":"c3f04c5f-3118-409c-a33d-5abc8a631009",
    "Name":"Task c3f04c5f-3118-409c-a33d-5abc8a631009"
    }


    In the response body, a new created task resource is included. And a task monitor resource is referenced in TaskMonitor property.

  5. Client needs to periodically check the URI of task for updating progress.

    In the following are sample JSON responses for continuously checking a task resource. (The task Id is c3f04c5f-3118-409c-a33d-5abc8a631009)

    Task overall progress 100%. And task state is completed.

    {
    "@odata.type": "#Task.v1_5_1.Task",
    "@odata.id": "/redfish/v1/TaskService/Tasks/c3f04c5f-3118-409c-a33d-5abc8a631009",
    "EndTime": "2023-01-04T08:06:42+00:00",
    "TaskMonitor": "/redfish/v1/TaskService/f1874fd8-78d8-42b2-a64c-26f7bb31fa45",
    "Messages": [
    {
    "@odata.type": "#Message.v1_1_2.Message",
    "MessageId": "Update.1.0.OperationTransitionedToJob",
    "Resolution": "Follow the referenced job and monitor the job for further updates.",
    "MessageSeverity": "OK",
    "Message": "The update operation has transitioned to the job at URI '/redfish/v1/JobService/Jobs/JobR000005-Update'.",
    "MessageArgs": [
    "/redfish/v1/JobService/Jobs/JobR000005-Update"
    ]
    }
    ],
    "Description": "This resource represents a task for a Redfish implementation.",
    "@odata.etag": "\"1672819602270\"",
    "StartTime": "2023-01-04T08:05:53+00:00",
    "PercentComplete": 100,
    "TaskStatus": "OK",
    "TaskState": "Completed",
    "@odata.context": "/redfish/v1/$metadata#Task.Task",
    "HidePayload": true,
    "Id": "c3f04c5f-3118-409c-a33d-5abc8a631009",
    "Name": "Task c3f04c5f-3118-409c-a33d-5abc8a631009"
    }
    In the response body, a new created job resource is included.
    }

  6. Client needs to check the job until its state changed to complete or exception. And handle exceptions according to job messages returned.

    A sample task response with exception is below.

    {
    "@odata.type": "#Job.v1_0_7.Job",
    "StepOrder": [
    "BMC-Primary"
    ],
    "EndTime": "2023-01-04T08:07:00+00:00",
    "Messages": [
    {
    "@odata.type": "#Message.v1_1_2.Message",
    "MessageId": "Update.1.0.UpdateSuccessful",
    "MessageSeverity": "OK",
    "Resolution": "None.",
    "Message": "Device '/redfish/v1/UpdateService/FirmwareInventory/BMC-Primary' successfully updated with image 'upload_file'.",
    "MessageArgs": [
    "/redfish/v1/UpdateService/FirmwareInventory/BMC-Primary",
    "upload_file"
    ]
    }
    ],
    "Description": "This resource is used to represent a job for a Redfish implementation.",
    "@odata.id": "/redfish/v1/JobService/Jobs/JobR000005-Update",
    "StartTime": "2023-01-04T08:06:41+00:00",
    "@odata.etag": "\"1672819620097\"",
    "PercentComplete": 100,
    "Steps": {
    "@odata.id": "/redfish/v1/JobService/Jobs/JobR000005-Update/Steps"
    },
    "@odata.context": "/redfish/v1/$metadata#Job.Job",
    "JobState": "Completed",
    "Id": "JobR000005-Update",
    "Name": "JobR000005-Update"
    }

  7. If the target is BMC(Backup), there is an extra step here to clear HttpPushUriTargets.

    Skip this step if it is not BMC(Backup) firmware updated.

    The PATCH body is:

    {
    "HttpPushUriTargets" : [ ]
    }

  8. Update HttpPushUriTargetsBusy to false.

    When the firmware update procedure is completed, change HttpPushUriTargetsBusy property to false, in order to release the service to other clients for firmware update.

    The PATCH body is:

    {
    "HttpPushUriTargetsBusy" : false
    }