跳到主要内容

POST – 固件的简单更新

此操作可以更新软件映像文件(位于 ImageURI 参数引用的 URI 中)包含的已安装软件组件。

请求 URL

POST https://<BMC_IPADDR>/redfish/v1/UpdateService/Actions/UpdateService.SimpleUpdate

请求正文

参数类型错误消息 ID

ImageURI

字符串

映像文件的 URI

Targets

字符串

待更新资源的 URI

即当您需要更新 BMC(备用)的固件时,Targets 参数必须为 [/redfish/v1/UpdateService/FirmwareInventory/BMC-Backup]。这也是通过在 Targets 中提供值来使用 Redfish 进行固件更新的例外情况,仅适用于 BMC(备用)更新。为了更新其他类型的固件,不需要 Targets 参数或此参数接受 null 值。

TransferProtocol

字符串

此服务用于检索固件映像文件的网络协议

Username

字符串

用于访问 sftp 服务器的用户名。当映像位于 sftp 服务器上,并且 username:password 在 ImageURI 中不可用时,此参数是必需的。

Password

字符串

用于访问 sftp 服务器的密码。当映像位于 sftp 服务器上,并且 username:password 在 ImageURI 中不可用时,此参数是必需的。

响应

字段类型错误消息 ID

Id

字符串

创建的任务 ID。

Name

字符串

任务名称。

Description

字符串

“This resource represents a task for a Redfish implementation.”

TaskMonitor

字符串

此任务的任务监控器的 URI。

StartTime

字符串

上次启动任务的日期时间戳。

TaskState

字符串

任务的状态。

Messages

数组

这是与任务关联的消息数组。

PercentComplete

整数

任务完成百分比。

HidePayload

布尔

指示 Payload 对象为隐藏状态且不会在执行 GET 时返回。

状态代码

HTTP 状态代码错误消息 ID
202Accepted
400BadRequest、ActionParamMissing、ActionParamTypeError、ActionParamFormatError
419Conflict
500InternalError

示例

以下示例是更新 BMC(备用)的请求。POST 正文填充如下:

{
"ImageURI":"sftp://192.168.1.126/tmp/xcc/lnvgy_fw_xcc_cdi338d-2.70_anyos_noarch.uxz",
"Targets": [
"/redfish/v1/UpdateService/FirmwareInventory/BMC-Backup"
],
"Username":"userid",
"Password":"password"
}

返回以下示例 JSON 响应。

{
"Id" : "c13eea76-4ee3-4696-8e03-0f0b16bb6512",
"Messages" : [],
"TaskState" : "New",
"@odata.etag" : "\"1577366735335\"",
"@odata.id" : "/redfish/v1/TaskService/Tasks/c13eea76-4ee3-4696-8e03-0f0b16bb6512",
"PercentComplete" : 0,
"@odata.type" : "#Task.v1_4_1.Task",
"StartTime" : "2019-12-26T13:25:35+00:00",
"Description" : "This resource represents a task for a Redfish implementation.",
"Name" : "Task c13eea76-4ee3-4696-8e03-0f0b16bb6512",
"HidePayload" : true,
"TaskMonitor" : "/redfish/v1/TaskService/0c24a202-c4ef-4bf8-9c10-2bb806ffd8a2"
}

在响应正文中将包含新创建的 Task 资源。然后,通过“GET”获取 URI 以检查更新过程。返回以下示例 JSON 响应。

{
"StartTime": "2019-12-26T13:25:35+00:00",
"TaskState": "Running",
"HidePayload": true,
"@odata.id": "/redfish/v1/TaskService/Tasks/c13eea76-4ee3-4696-8e03-0f0b16bb6512",
"PercentComplete": 17,
"Name": "Task c13eea76-4ee3-4696-8e03-0f0b16bb6512",
"TaskMonitor": "/redfish/v1/TaskService/0c24a202-c4ef-4bf8-9c10-2bb806ffd8a2",
"Id": "c13eea76-4ee3-4696-8e03-0f0b16bb6512",
"@odata.type": "#Task.v1_4_1.Task",
"@odata.etag": "\"1577366759808\"",
"Messages": [
{
"@odata.type": "#Message.v1_0_7.Message",
"Message": "The task with id c13eea76-4ee3-4696-8e03-0f0b16bb6512 has changed to progress 17 percent complete.",
"Resolution": "None.",
"Severity": "OK",
"MessageId": "TaskEvent.1.0.TaskProgressChanged",
"MessageArgs": [
"c13eea76-4ee3-4696-8e03-0f0b16bb6512",
"17"
]
},
{
"@odata.type": "#Message.v1_0_7.Message",
"Message": "Transfer 49 percent complete.",
"Resolution": "None",
"Severity": "OK",
"MessageId": "LenovoFirmwareUpdateRegistry.1.0.UpdateTransferInProgress",
"MessageArgs": [
"49"
]
}
],
"Description": "This resource represents a task for a Redfish implementation."
}

以下示例是更新 UEFI 的请求。POST 正文填充如下:

{
"ImageURI":"sftp://192.168.1.126/tmp/uefi/lnvgy_fw_uefi_ive148m-2.41_anyos_32-64.uxz",
"Username":"userid",
"Password":"password"
}

返回 POST SimpleUpdate 操作的以下示例 JSON 响应。

{
"Id" : "5913dce0-dbc7-4ba3-a643-0f4cd4bec5e8",
"Messages" : [],
"TaskState" : "New",
"@odata.etag" : "\"1577365985589\"",
"@odata.id" : "/redfish/v1/TaskService/Tasks/5913dce0-dbc7-4ba3-a643-0f4cd4bec5e8",
"PercentComplete" : 0,
"@odata.type" : "#Task.v1_4_1.Task",
"StartTime" : "2019-12-26T13:13:05+00:00",
"Description" : "This resource represents a task for a Redfish implementation.",
"Name" : "Task 5913dce0-dbc7-4ba3-a643-0f4cd4bec5e8",
"HidePayload" : true,
"TaskMonitor" : "/redfish/v1/TaskService/20c990b8-6a6b-44dd-818c-9e6348bdfc4d"
}

在响应正文中将包含新创建的 Task 资源。然后,通过“GET”获取 URI 以检查更新过程。返回以下示例 JSON 响应。

{
"StartTime": "2019-12-26T13:13:05+00:00",
"TaskState": "Running",
"HidePayload": true,
"@odata.id": "/redfish/v1/TaskService/Tasks/5913dce0-dbc7-4ba3-a643-0f4cd4bec5e8",
"PercentComplete": 59,
"Messages": [
{
"MessageArgs": [
"5913dce0-dbc7-4ba3-a643-0f4cd4bec5e8",
"59"
],
"Message": "The task with id 5913dce0-dbc7-4ba3-a643-0f4cd4bec5e8 has changed to progress 59 percent complete.",
"MessageId": "TaskEvent.1.0.TaskProgressChanged",
"Severity": "OK",
"Resolution": "None.",
"@odata.type": "#Message.v1_0_7.Message"
},
{
"MessageArgs": [
"1",
"/redfish/v1/UpdateService/FirmwareInventory/UEFI",
"UEFI-IVE1-6",
"48M-2.41",
"Unknown"
],
"Message": "Assignment 1: Resource /redfish/v1/UpdateService/FirmwareInventory/UEFI SoftwareID UEFI-IVE1-6 Version 48M-2.41 to Version Unknown.",
"@odata.type": "#Message.v1_0_7.Message",
"Severity": "OK",
"MessageId": "LenovoFirmwareUpdateRegistry.1.0.UpdateAssignment",
"Resolution": "None"
},
{
"@odata.type": "#Message.v1_0_7.Message",
"Message": "Assignment 1: Apply 38 percent complete.",
"Resolution": "None",
"Severity": "OK",
"MessageId": "LenovoFirmwareUpdateRegistry.1.0.PayloadApplyInProgress",
"MessageArgs": [
"1",
"38"
]
}
],
"@odata.type": "#Task.v1_4_1.Task",
"Name": "Task 5913dce0-dbc7-4ba3-a643-0f4cd4bec5e8",
"Id": "5913dce0-dbc7-4ba3-a643-0f4cd4bec5e8",
"@odata.etag": "\"1577366006339\"",
"TaskMonitor": "/redfish/v1/TaskService/20c990b8-6a6b-44dd-818c-9e6348bdfc4d",
"Description": "This resource represents a task for a Redfish implementation."
}