跳到主要内容

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 中不可用时,此参数是必需的。

@Redfish.OperationApplyTime

字符串
指定何时开始更新 SimpleUpdate 提供的固件。接受的设置为:
  • “Immediate”

  • “OnReset”

  • “OnStartUpdateRequest”

响应

字段类型错误消息 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.216/tmp/xcc/lnvgy_fw_xcc_cdi338d-2.70_anyos_noarch.uxz",
"Targets": [
"/redfish/v1/UpdateService/FirmwareInventory/BMC-Backup"
],
"Username":"userid",
"Password":"password"
"@Redfish.OperationApplyTime": "Immediate"
}

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

{
"ImageURI":"sftp://192.168.1.216/test/lnvgy_fw_uefi_use105d-1.10_anyos_32-64.uxz",
"Targets": [],
"Username":"userid",
"Password":"password",
"@Redfish.OperationApplyTime": "OnReset"
}

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

{
"TaskState": "New",
"Id": "2a372022-8d74-4503-bf9a-6b24c52f26e0",
"TaskMonitor": "/redfish/v1/TaskService/7df1c3c5-a4ab-42a4-92cb-a8ace5b576d4",
"PercentComplete": 0,
"Description": "This resource represents a task for a Redfish implementation.",
"HidePayload": true,
"StartTime": "2022-12-15T08:05:56+00:00",
"Name": "Task 2a372022-8d74-4503-bf9a-6b24c52f26e0",
"@odata.type": "#Task.v1_5_1.Task",
"@odata.id": "/redfish/v1/TaskService/Tasks/2a372022-8d74-4503-bf9a-6b24c52f26e0",
"@odata.context": "/redfish/v1/$metadata#Task.Task",
"Messages": [],
"@odata.etag": "\"1671091556862\""
}

如果在请求中指定了“OnReset”,则此服务将处于暂挂状态,直至其收到主机电源重置/打开信号,然后启动更新。

在响应正文中将包含新创建的“任务”资源。

{
"TaskState": "Pending",
"StartTime": "2022-12-15T08:05:56+00:00",
"TaskMonitor": "/redfish/v1/TaskService/7df1c3c5-a4ab-42a4-92cb-a8ace5b576d4",
"PercentComplete": 0,
"Description": "This resource represents a task for a Redfish implementation.",
"Id": "2a372022-8d74-4503-bf9a-6b24c52f26e0",
"HidePayload": true,
"Name": "Task 2a372022-8d74-4503-bf9a-6b24c52f26e0",
"@odata.type": "#Task.v1_5_1.Task",
"@odata.id": "/redfish/v1/TaskService/Tasks/2a372022-8d74-4503-bf9a-6b24c52f26e0",
"@odata.context": "/redfish/v1/$metadata#Task.Task",
"Messages": [
{
"MessageId": "Update.1.0.UpdateInProgress",
"@odata.type": "#Message.v1_1_2.Message",
"Resolution": "None.",
"MessageSeverity": "OK",
"Message": "An update is in progress.",
"MessageArgs": []
}
],
"@odata.etag": "\"1671091615381\""
}

如果在请求中指定了“OnReset”,则此服务将处于暂挂状态,直至其收到主机电源重置/打开信号,然后启动更新。

然后,“获取”任务 URI 以检查更新过程。返回以下示例 JSON 响应。

{
"TaskState": "Running",
"StartTime": "2022-12-15T08:05:56+00:00",
"TaskMonitor": "/redfish/v1/TaskService/7df1c3c5-a4ab-42a4-92cb-a8ace5b576d4",
"PercentComplete": 71,
"Description": "This resource represents a task for a Redfish implementation.",
"Id": "2a372022-8d74-4503-bf9a-6b24c52f26e0",
"HidePayload": true,
"Name": "Task 2a372022-8d74-4503-bf9a-6b24c52f26e0",
"@odata.type": "#Task.v1_5_1.Task",
"@odata.id": "/redfish/v1/TaskService/Tasks/2a372022-8d74-4503-bf9a-6b24c52f26e0",
"@odata.context": "/redfish/v1/$metadata#Task.Task",
"Messages": [
{
"MessageId": "Update.1.0.UpdateInProgress",
"@odata.type": "#Message.v1_1_2.Message",
"Resolution": "None.",
"MessageSeverity": "OK",
"MessageArgs": [],
"Message": "An update is in progress."
}
],
"@odata.etag": "\"1671091716264\""
}

在响应正文中将包含新创建的“Job”资源。

{
"TaskState": "Completed",
"TaskStatus": "OK",
"EndTime": "2022-12-15T08:08:46+00:00",
"StartTime": "2022-12-15T08:05:56+00:00",
"TaskMonitor": "/redfish/v1/TaskService/7df1c3c5-a4ab-42a4-92cb-a8ace5b576d4",
"PercentComplete": 100,
"Description": "This resource represents a task for a Redfish implementation.",
"Id": "2a372022-8d74-4503-bf9a-6b24c52f26e0",
"HidePayload": true,
"Name": "Task 2a372022-8d74-4503-bf9a-6b24c52f26e0",
"@odata.type": "#Task.v1_5_1.Task",
"@odata.id": "/redfish/v1/TaskService/Tasks/2a372022-8d74-4503-bf9a-6b24c52f26e0",
"@odata.context": "/redfish/v1/$metadata#Task.Task",
"Messages": [
{
"MessageId": "Update.1.0.OperationTransitionedToJob",
"@odata.type": "#Message.v1_1_2.Message",
"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/JobR000001-Update'.",
"MessageArgs": [
"/redfish/v1/JobService/Jobs/JobR000001-Update"
]
}
],
"@odata.etag": "\"1671091726964\""
}

然后,通过“GET”获取作业 URI 以检查更新过程。返回以下示例 JSON 响应。

{
"JobState": "Completed",
"Steps": {
"@odata.id": "/redfish/v1/JobService/Jobs/JobR000001-Update/Steps"
},
"EndTime": "2022-12-15T08:08:55+00:00",
"StartTime": "2022-12-15T08:08:46+00:00",
"PercentComplete": 100,
"Description": "This resource is used to represent a job for a Redfish implementation.",
"Messages": [
{
"MessageId": "Update.1.0.UpdateSuccessful",
"@odata.type": "#Message.v1_1_2.Message",
"Resolution": "None.",
"MessageSeverity": "OK",
"Message": "Device '/redfish/v1/UpdateService/FirmwareInventory/UEFI' successfully updated with image 'lnvgy_fw_uefi_use105d-1.10_anyos_32-64.uxz'.",
"MessageArgs": [
"/redfish/v1/UpdateService/FirmwareInventory/UEFI",
"lnvgy_fw_uefi_use105d-1.10_anyos_32-64.uxz"
]
}
],
"Id": "JobR000001-Update",
"Name": "JobR000001-Update",
"@odata.type": "#Job.v1_0_7.Job",
"@odata.id": "/redfish/v1/JobService/Jobs/JobR000001-Update",
"@odata.context": "/redfish/v1/$metadata#Job.Job",
"StepOrder": [
"UEFI"
],
"@odata.etag": "\"1671091735837\""
}