PATCH – 更新网络设备 PCIe 功能资源
使用 PATCH 方法更新 Redfish 服务的 NetworkDeviceFunction 资源中的属性。
请求 URL
PATCH https://<BMC_IPADDR>/redfish/v1/Chassis/1/NetworkAdapters/{Location}/NetworkDeviceFunctions/{1-M}.{1-N}/Pending
请求正文
要更新的属性如下所示,所有这些属性都可以单独更改。
Field | 类型 | 描述 | |
---|---|---|---|
iSCSIBoot | 对象 | 机箱的位置。 | |
AuthenticationMethod | 字符串 | 此网络设备功能的 iSCSI 引导认证方法。 | |
CHAPSecret | 字符串 | 用于 CHAP 认证的共享密钥。 | |
CHAPUsername | 字符串 | 用于 CHAP 认证的用户名。 | |
IPAddressType | 字符串 | 在 iSCSIBoot IP 地址字段中填入的 IP 地址的类型。 有效值:“IPv4”、“IPV6” | |
InitiatorDefaultGateway | 字符串 | IPv6 或 IPv4 iSCSI 引导默认网关。 | |
InitiatorIPAddress | 字符串 | IPv6 或 IPv4 iSCSI 引导默认网关。 | |
InitiatorName | 字符串 | iSCSI 发起方名称。 | |
InitiatorNetmask | 字符串 | iSCSI 引导发起方的 IPv6 或 IPv4 网络掩码。 | |
MutualCHAPSecret | 字符串 | 用于双向 CHAP 认证的 CHAP 密钥。 | |
MutualCHAPUsername | 字符串 | 用于双向 CHAP 认证的 CHAP 用户名。 | |
PrimaryLUN | 数字 | 主 iSCSI 引导目标的逻辑单元号(LUN)。 | |
PrimaryTargetIPAddress | 字符串 | 主 iSCSI 引导目标的 IPv4 或 IPv6 地址。 | |
PrimaryTargetName | 字符串 | iSCSI 主引导目标的名称。 | |
PrimaryTargetTCPPort | 数字 | 主 iSCSI 引导目标的 TCP 端口。 | |
TargetInfoViaDHCP | 布尔 | 指示是否应从 DHCP 获取 iSCSI 引导目标名称、LUN、IP 地址和网络掩码。 |
仅当 AuthenticationMethod 为 CHAP 时,才能对 CHAPUsername 和 CHAPSecret 执行 PATCH 操作。仅当 AuthenticationMethod 为 MutualCHAP 时,才能对 MutualCHAPUsername 和 MutualCHAPSecret 执行 PATCH 操作。
响应正文
响应返回的内容与 GET 操作相同,但更新了属性。
状态代码
HTTP 状态代码 | 错误消息 ID |
---|---|
500 | InternalError |
示例
以下示例是 PATCH 正文
{
"iSCSIBoot": {
"AuthenticationMethod": "MutualCHAP",
"IPAddressType": "IPv4",
"InitiatorDefaultGateway": "192.168.1.1",
"InitiatorIPAddress": "0.0.0.0",
"InitiatorName": "iqn.com.example",
"InitiatorNetmask": "255.255.255.0"
"MutualCHAPSecret": "
"MutualCHAPUsername": "username",
"PrimaryLUN": 0,
"PrimaryTargetIPAddress": "192.168.1.10",
"PrimaryTargetName": "iqn.example",
"PrimaryTargetTCPPort": 3261,
"TargetInfoViaDHCP": false
}
}
成功运行 PATCH 操作后,机箱资源查询将返回以下示例 JSON 响应:
{
"Ethernet": {
"MACAddress": "b8:59:9f:03:00:3f",
"PermanentMACAddress": "b8:59:9f:03:00:3f",
"MTUSize": 32768
},
"@odata.id": "/redfish/v1/Chassis/1/NetworkAdapters/slot-13/NetworkDeviceFunctions/1.1",
"Links": {
"PhysicalPortAssignment": {
"@odata.id": "/redfish/v1/Chassis/1/NetworkAdapters/slot-13/NetworkPorts/1"
},
"PCIeFunction": {
"@odata.id": "/redfish/v1/Chassis/1/PCIeDevices/slot_13/PCIeFunctions/slot_13.00"
}
},
"Description": "A Network Device Function represents a logical interface exposed by the network adapter.",
"iSCSIBoot": {
"AuthenticationMethod": "MutualCHAP",
"IPAddressType": "IPv4",
"InitiatorDefaultGateway": "192.168.1.1",
"InitiatorIPAddress": "0.0.0.0",
"InitiatorName": "iqn.com.example",
"InitiatorNetmask": "255.255.255.0"
"MutualCHAPSecret": "
"MutualCHAPUsername": "username",
"PrimaryLUN": 0,
"PrimaryTargetIPAddress": "192.168.1.10",
"PrimaryTargetName": "iqn.example",
"PrimaryTargetTCPPort": 3261,
"TargetInfoViaDHCP": false
},
"PhysicalPortAssignment": {
"@odata.id": "/redfish/v1/Chassis/1/NetworkAdapters/slot-13/NetworkPorts/1"
},
"DeviceEnabled": true,
"AssignablePhysicalPorts@odata.count": 1,
"NetDevFuncType": "iSCSI",
"AssignablePhysicalPorts": [
{
"@odata.id": "/redfish/v1/Chassis/1/NetworkAdapters/slot-13/NetworkPorts/1"
}
],
"@Redfish.Settings": {
"SettingsObject": {
"@odata.id": "/redfish/v1/Chassis/1/NetworkAdapters/slot-13/NetworkDeviceFunctions/1.1/Pending"
},
"@odata.type": "#Settings.v1_3_0.Settings",
"SupportedApplyTimes": [
"OnReset"
],
"Messages": [],
"Time": null
},
"@odata.type": "#NetworkDeviceFunction.v1_4_0.NetworkDeviceFunction",
"Status": {
"State": "Enabled",
"Health": "OK",
"HealthRollup": "OK"
},
"Name": "Logical Port 1",
"@odata.etag": "\"c583b2e1c88932caff70d\"",
"Id": "1.1",
"PhysicalPortAssignment@Redfish.Deprecated": "The property is deprecated. Please use Links/PhysicalPortAssignment instead."
}