Lenovo WenTian WR5220 G3服务器 BMC使用中常用的Redfish指令

curl工具相关指令
1.查看Raid卡槽位信息

curl.exe -H "Content-Type: application/json" -sk -u USERID:PASSW0RD -X GET https://10.111.124.230/redfish/v1/Systems/1/Storages

回显:

D:\programs\curl-7.87.0-win64-mingw\bin>curl.exe -H "Content-Type: application/json" -sk -u USERID:PASSW0RD -X GET https://10.111.124.230/redfish/v1/Systems/1/Storages | python -m json.tool
{
    "@odata.context": "/redfish/v1/$metadata#StorageCollection.StorageCollection",
    "@odata.etag": "\"1720056809\"",
    "@odata.id": "/redfish/v1/Systems/1/Storages",
    "@odata.type": "#StorageCollection.StorageCollection",
    "Actions": {
        "Oem": {
            "HddLocate": {
                "target": "/redfish/v1/Systems/1/Storages/Actions/Oem/HddLocate"
            }
        }
    },
    "Description": "Collection of Storage resource instances",
    "Members": [
        {
            "@odata.id": "/redfish/v1/Systems/1/Storages/RaidController_0"
        },
        {
            "@odata.id": "/redfish/v1/Systems/1/Storages/StorageUnit_0"
        }
    ],
    "Members@odata.count": 2,
    "Name": "Storage Collection",
    "Oem": {
        "HddLocateStatus": "/redfish/v1/Systems/1/Storages/Oem/HddLocateStatus"
    }
}

2.查看Raid卡控制器信息及磁盘槽位

curl.exe -H "Content-Type: application/json" -sk -u USERID:PASSW0RD -X GET https://10.111.124.230/redfish/v1/Systems/1/Storages/RaidController_0

回显:

D:\programs\curl-7.87.0-win64-mingw\bin>curl.exe -H "Content-Type: application/json" -sk -u USERID:PASSW0RD -X GET https://10.111.124.230/redfish/v1/Systems/1/Storages/RaidController_0 | python -m json.tool
{
    "@odata.context": "/redfish/v1/$metadata#Storage.Storage",
    "@odata.etag": "\"1720056809\"",
    "@odata.id": "/redfish/v1/Systems/1/Storages/RaidController_0",
    "@odata.type": "#Storage.v1_9_0.Storage",
    "Description": "RaidController_0",
    "Drives": [
        {
            "@odata.id": "/redfish/v1/Systems/1/Storages/RaidController_0/Drives/RaidController0_0"
        },
        {
            "@odata.id": "/redfish/v1/Systems/1/Storages/RaidController_0/Drives/RaidController0_1"
        },
        {
            "@odata.id": "/redfish/v1/Systems/1/Storages/RaidController_0/Drives/RaidController0_4"
        },
        {
            "@odata.id": "/redfish/v1/Systems/1/Storages/RaidController_0/Drives/RaidController0_5"
        },
        {
            "@odata.id": "/redfish/v1/Systems/1/Storages/RaidController_0/Drives/RaidController0_6"
        },
        {
            "@odata.id": "/redfish/v1/Systems/1/Storages/RaidController_0/Drives/RaidController0_7"
        },
        {
            "@odata.id": "/redfish/v1/Systems/1/Storages/RaidController_0/Drives/RaidController0_8"
        },
        {
            "@odata.id": "/redfish/v1/Systems/1/Storages/RaidController_0/Drives/RaidController0_9"
        }
    ],
    "Drives@odata.count": 8,
    "Id": "0",
    "Links": {
        "Enclosures": null,
        "Enclosures@odata.count": 0
    },
    "Name": "RaidController_0",
    "Redundancy": null,
    "Redundancy@odata.count": 0,
    "StorageControllers": [
        {
            "@odata.id": "/redfish/v1/Systems/1/Storages/RaidController_0#/StorageControllers/0",
            "AssetTag": null,
            "CardModel": "RAID 540-16i PCIe Gen4 12Gb Adapter",
            "Description": "RAID-Control-0",
            "FirmwareVersion": "52.22.0-4775",
            "Manufacturer": "Broadcom",
            "MemberId": "0",
            "Model": "RAID_SAS3816",
            "Name": "RAID 540-16i",
            "Oem": {
                "Public": {
                    "CapacitanceStatus": {
                        "Health": "N/A",
                        "State": "Absent"
                    },
                    "MemorySizeMiB": 0,
                    "SupportedRAIDLevels": [
                        "RAID10",
                        "RAID1",
                        "RAID00",
                        "RAID0"
                    ]
                }
            },
            "SerialNumber": "SPD1051166",
            "SpeedGbps": 12,
            "Status": {
                "Health": "OK",
                "State": "Enabled"
            },
            "SupportedControllerProtocols": [
                "PCIe"
            ],
            "SupportedDeviceProtocols": [
                "SAS",
                "SATA"
            ],
            "SupportedRAIDTypes": [
                "RAID10",
                "RAID1",
                "RAID00",
                "RAID0"
            ]
        }
    ],
    "StorageControllers@odata.count": 1,
    "Volumes": {
        "@odata.id": "/redfish/v1/Systems/1/Storages/RaidController_0/Volumes"
    }
}

3.查看一块硬盘

curl.exe -H "Content-Type: application/json" -sk -u USERID:PASSW0RD -X GET https://10.111.124.230/redfish/v1/Systems/1/Storages/RaidController_0/Drives/RaidController0_0

回显:

D:\programs\curl-7.87.0-win64-mingw\bin>curl.exe -H "Content-Type: application/json" -sk -u USERID:PASSW0RD -X GET https://10.111.124.230/redfish/v1/Systems/1/Storages/RaidController_0/Drives/RaidController0_0 | python -m json.tool
{
    "@odata.context": "/redfish/v1/$metadata#Drive.Drive",
    "@odata.etag": "\"1720056809\"",
    "@odata.id": "/redfish/v1/Systems/1/Storages/RaidController_0/Drives/RaidController0_0",
    "@odata.type": "#Drive.v1_11_0.Drive",
    "AssetTag": null,
    "BlockSizeBytes": 512,
    "CapableSpeedGbs": 12,
    "CapacityBytes": 300000000000,
    "FailurePredicted": false,
    "HotspareType": "None",
    "Id": "RaidController0_0",
    "IndicatorLED": null,
    "Manufacturer": "Lenovo",
    "MediaType": "HDD",
    "Model": "ST300MP0006",
    "Name": "RaidController0_0",
    "NegotiatedSpeedGbs": 12,
    "Protocol": "SAS",
    "Revision": "L362",
    "SerialNumber": "WAE00E2A0000E7253855",
    "Slot": 0,
    "Status": {
        "FDECapable": "Non_FDE",
        "Health": "OK",
        "LeftTime": 255,
        "MediaErrorCount": 0,
        "OtherErrorCount": 0,
        "PreFailCount": 0,
        "Secured": "NotSecured",
        "State": "Enabled"
    },
    "StatusIndicator": "0",
    "Temperature": 32
}

4.查看另一块硬盘

curl.exe -H "Content-Type: application/json" -sk -u USERID:PASSW0RD -X GET https://10.111.124.230/redfish/v1/Systems/1/Storages/RaidController_0/Drives/RaidController0_8

回显:

D:\programs\curl-7.87.0-win64-mingw\bin>curl.exe -H "Content-Type: application/json" -sk -u USERID:PASSW0RD -X GET https://10.111.124.230/redfish/v1/Systems/1/Storages/RaidController_0/Drives/RaidController0_8 | python -m json.tool
{
    "@odata.context": "/redfish/v1/$metadata#Drive.Drive",
    "@odata.etag": "\"1720056809\"",
    "@odata.id": "/redfish/v1/Systems/1/Storages/RaidController_0/Drives/RaidController0_8",
    "@odata.type": "#Drive.v1_11_0.Drive",
    "AssetTag": null,
    "BlockSizeBytes": 512,
    "CapableSpeedGbs": 6,
    "CapacityBytes": 240057409536,
    "FailurePredicted": false,
    "HotspareType": "None",
    "Id": "RaidController0_8",
    "IndicatorLED": null,
    "Manufacturer": "Intel",
    "MediaType": "SSD",
    "Model": "INTEL SSDSC2KB240G8",
    "Name": "RaidController0_8",
    "NegotiatedSpeedGbs": 6,
    "Protocol": "SATA",
    "Revision": "XCV10132",
    "SerialNumber": "BTYF118302TZ240AGN",
    "Slot": 8,
    "Status": {
        "FDECapable": "Non_FDE",
        "Health": "OK",
        "LeftTime": 100,
        "MediaErrorCount": 0,
        "OtherErrorCount": 0,
        "PreFailCount": 0,
        "Secured": "NotSecured",
        "State": "Enabled"
    },
    "StatusIndicator": "0",
    "Temperature": 25
}

5.查看服务器上所有控制器资源

curl.exe -H "Content-Type: application/json" -sk -u USERID:PASSW0RD -X GET https://10.111.124.230/redfish/v1/Systems/1/Storages?$expand=.

回显:

D:\programs\curl-7.87.0-win64-mingw\bin>curl.exe -H "Content-Type: application/json" -sk -u USERID:PASSW0RD -X GET https://10.111.124.230/redfish/v1/Systems/1/Storages?$expand=. | python -m json.tool
{
    "@odata.context": "/redfish/v1/$metadata#StorageCollection.StorageCollection",
    "@odata.etag": "\"1720056809\"",
    "@odata.id": "/redfish/v1/Systems/1/Storages",
    "@odata.type": "#StorageCollection.StorageCollection",
    "Actions": {
        "Oem": {
            "HddLocate": {
                "target": "/redfish/v1/Systems/1/Storages/Actions/Oem/HddLocate"
            }
        }
    },
    "Description": "Collection of Storage resource instances",
    "Members": [
        {
            "@odata.id": "/redfish/v1/Systems/1/Storages/RaidController_0",
            "@odata.type": "#Storage.v1_9_0.Storage",
            "Description": "RaidController_0",
            "Drives": [
                {
                    "@odata.id": "/redfish/v1/Systems/1/Storages/RaidController_0/Drives/RaidController0_0"
                },
                {
                    "@odata.id": "/redfish/v1/Systems/1/Storages/RaidController_0/Drives/RaidController0_1"
                },
                {
                    "@odata.id": "/redfish/v1/Systems/1/Storages/RaidController_0/Drives/RaidController0_4"
                },
                {
                    "@odata.id": "/redfish/v1/Systems/1/Storages/RaidController_0/Drives/RaidController0_5"
                },
                {
                    "@odata.id": "/redfish/v1/Systems/1/Storages/RaidController_0/Drives/RaidController0_6"
                },
                {
                    "@odata.id": "/redfish/v1/Systems/1/Storages/RaidController_0/Drives/RaidController0_7"
                },
                {
                    "@odata.id": "/redfish/v1/Systems/1/Storages/RaidController_0/Drives/RaidController0_8"
                },
                {
                    "@odata.id": "/redfish/v1/Systems/1/Storages/RaidController_0/Drives/RaidController0_9"
                }
            ],
            "Drives@odata.count": 8,
            "Id": "0",
            "Links": {
                "Enclosures": null,
                "Enclosures@odata.count": 0
            },
            "Name": "RaidController_0",
            "Redundancy": null,
            "Redundancy@odata.count": 0,
            "StorageControllers": [
                {
                    "@odata.id": "/redfish/v1/Systems/1/Storages/RaidController_0#/StorageControllers/0",
                    "AssetTag": null,
                    "CardModel": "RAID 540-16i PCIe Gen4 12Gb Adapter",
                    "Description": "RAID-Control-0",
                    "FirmwareVersion": "52.22.0-4775",
                    "Manufacturer": "Broadcom",
                    "MemberId": "0",
                    "Model": "RAID_SAS3816",
                    "Name": "RAID 540-16i",
                    "Oem": {
                        "Public": {
                            "CapacitanceStatus": {
                                "Health": "N/A",
                                "State": "Absent"
                            },
                            "MemorySizeMiB": 0,
                            "SupportedRAIDLevels": [
                                "RAID10",
                                "RAID1",
                                "RAID00",
                                "RAID0"
                            ]
                        }
                    },
                    "SerialNumber": "SPD1051166",
                    "SpeedGbps": 12,
                    "Status": {
                        "Health": "OK",
                        "State": "Enabled"
                    },
                    "SupportedControllerProtocols": [
                        "PCIe"
                    ],
                    "SupportedDeviceProtocols": [
                        "SAS",
                        "SATA"
                    ],
                    "SupportedRAIDTypes": [
                        "RAID10",
                        "RAID1",
                        "RAID00",
                        "RAID0"
                    ]
                }
            ],
            "StorageControllers@odata.count": 1,
            "Volumes": {
                "@odata.id": "/redfish/v1/Systems/1/Storages/RaidController_0/Volumes"
            }
        },
        {
            "@odata.id": "/redfish/v1/Systems/1/Storages/StorageUnit_0",
            "@odata.type": "#Storage.v1_9_0.Storage",
            "Description": "Storage0",
            "Drives@odata.count": 0,
            "Id": "StorageUnit_0",
            "Links": {
                "Enclosures": null,
                "Enclosures@odata.count": 0
            },
            "Name": "StorageUnit_0",
            "Redundancy": null,
            "Redundancy@odata.count": 0,
            "StorageControllers": [
                {
                    "@odata.id": "/redfish/v1/Systems/1/Storages/StorageUnit_0#/StorageControllers/0",
                    "AssetTag": "SCSI_Controller_0",
                    "FirmwareVersion": "Not Available",
                    "Manufacturer": "Broadcom",
                    "MemberId": "0",
                    "Model": "Not Available",
                    "Name": "SCSI_Controller_0",
                    "Oem": {
                        "Public": {
                            "MemorySizeMiB": 0
                        }
                    },
                    "SerialNumber": "Not Available",
                    "SpeedGbps": 16,
                    "Status": {
                        "Health": "OK",
                        "State": "Enabled"
                    },
                    "SupportedControllerProtocols": [
                        "PCIe"
                    ],
                    "SupportedDeviceProtocols": [
                        "SAS",
                        "SATA"
                    ]
                },
                {
                    "@odata.id": "/redfish/v1/Systems/1/Storages/StorageUnit_0#/StorageControllers/1",
                    "AssetTag": "(USB_Controller_1)",
                    "FirmwareVersion": "1.20",
                    "Manufacturer": "Intel",
                    "MemberId": "1",
                    "Model": "PCH USB xHCI",
                    "Name": "USB_Controller_1",
                    "Oem": {
                        "Public": {
                            "MemorySizeMiB": 0
                        }
                    },
                    "SerialNumber": "Not Available",
                    "SpeedGbps": 5,
                    "Status": {
                        "Health": "OK",
                        "State": "Enabled"
                    },
                    "SupportedControllerProtocols": [
                        "USB",
                        "PCIe"
                    ],
                    "SupportedDeviceProtocols": [
                        "USB"
                    ]
                },
                {
                    "@odata.id": "/redfish/v1/Systems/1/Storages/StorageUnit_0#/StorageControllers/2",
                    "AssetTag": "(SATA_Controller_2)",
                    "FirmwareVersion": "1.0",
                    "Manufacturer": "Intel",
                    "MemberId": "2",
                    "Model": "SATA0 AHCI",
                    "Name": "SATA_Controller_2",
                    "Oem": {
                        "Public": {
                            "MemorySizeMiB": 0
                        }
                    },
                    "SerialNumber": "Not Available",
                    "SpeedGbps": 6,
                    "Status": {
                        "Health": "OK",
                        "State": "Enabled"
                    },
                    "SupportedControllerProtocols": [
                        "AHCI",
                        "SATA",
                        "PCIe"
                    ],
                    "SupportedDeviceProtocols": [
                        "AHCI",
                        "SATA"
                    ]
                },
                {
                    "@odata.id": "/redfish/v1/Systems/1/Storages/StorageUnit_0#/StorageControllers/3",
                    "AssetTag": "(SATA_Controller_3)",
                    "FirmwareVersion": "1.0",
                    "Manufacturer": "Intel",
                    "MemberId": "3",
                    "Model": "SATA1 AHCI",
                    "Name": "SATA_Controller_3",
                    "Oem": {
                        "Public": {
                            "MemorySizeMiB": 0
                        }
                    },
                    "SerialNumber": "Not Available",
                    "SpeedGbps": 6,
                    "Status": {
                        "Health": "OK",
                        "State": "Enabled"
                    },
                    "SupportedControllerProtocols": [
                        "AHCI",
                        "SATA",
                        "PCIe"
                    ],
                    "SupportedDeviceProtocols": [
                        "AHCI",
                        "SATA"
                    ]
                },
                {
                    "@odata.id": "/redfish/v1/Systems/1/Storages/StorageUnit_0#/StorageControllers/4",
                    "AssetTag": "(SATA_Controller_4)",
                    "FirmwareVersion": "1.0",
                    "Manufacturer": "Intel",
                    "MemberId": "4",
                    "Model": "SATA2 AHCI",
                    "Name": "SATA_Controller_4",
                    "Oem": {
                        "Public": {
                            "MemorySizeMiB": 0
                        }
                    },
                    "SerialNumber": "Not Available",
                    "SpeedGbps": 6,
                    "Status": {
                        "Health": "OK",
                        "State": "Enabled"
                    },
                    "SupportedControllerProtocols": [
                        "AHCI",
                        "SATA",
                        "PCIe"
                    ],
                    "SupportedDeviceProtocols": [
                        "AHCI",
                        "SATA"
                    ]
                }
            ],
            "StorageControllers@odata.count": 5,
            "Volumes": {
                "@odata.id": "/redfish/v1/Systems/1/Storages/StorageUnit_0/Volumes"
            }
        }
    ],
    "Members@odata.count": 2,
    "Name": "Storage Collection",
    "Oem": {
        "HddLocateStatus": "/redfish/v1/Systems/1/Storages/Oem/HddLocateStatus"
    }
}

6.配置1个Raid1阵列

POST https://10.111.124.230/redfish/v1/Systems/1/Storages/RaidController_0/Volumes

请求头:

X-Auth-Token:{TOKEN}
Content-Type: application/json
If-Match: {ifmatch_value}
请求消息体(raw):
{
"Name":"Raid1pm",
"RAIDType":"RAID1",
"StripSizeBytes":"64K",
"ReadCachePolicyType":"Off",
"WriteCachePolicyType":"WriteThrough",
"VirtualDeviceSize":223,
"Oem":{
"Public":{
"DiskCachePolicy":"Unchanged",
"Initialization":"Quick_Initialization",
"AccessPolicy":"Read-Write",
"Device":[
"RaidController0_8"
"RaidController0_9"
]
 }
 }
}

回显:

Windows:D:\programs\curl-7.87.0-win64-mingw\bin>curl.exe -sk -u USERID:PASSW0RD -X POST "https://10.111.124.230/redfish/v1/Systems/1/Storages/RaidController_0/Volumes" --header "Content-Type: application/json" --header "If-Match: *" -d "{\"Name\": \"Raid1pm\", \"RAIDType\": \"RAID1\",\"StripSizeBytes\": \"64K\",\"ReadCachePolicyType\": \"Off\",\"WriteCachePolicyType\": \"WriteThrough\",\"VirtualDeviceSize\": 223,\"Oem\": {\"Public\": {\"DiskCachePolicy\": \"Unchanged\",\"Initialization\": \"Quick_Initialization\",\"AccessPolicy\": \"Read-Write\",\"Device\": [\"RaidController0_8\", \"RaidController0_9\"]}}}"
Linux:./curl -sk -u USERID:PASSW0RD -X POST '{"Name":"Raid1pm","RAIDType":"RAID1","StripSizeBytes":"64K","ReadCachePolicyType":"Off","WriteCachePolicyType":"WriteThrough","VirtualDeviceSize":223,"Oem":{"Public":{"DiskCachePolicy":"Unchanged","Initialization":"Quick_Initialization","AccessPolicy":"Read-Write","Device":["RaidController0_8","RaidController0_9"]}}}' https://10.111.124.230/redfish/v1/Systems/1/Storages/RaidController_0/Volumes --header "Content-Type: application/json" --header "If-Match: *"

7.检查Raid1阵列

curl.exe -H "Content-Type: application/json" -sk -u USERID:PASSW0RD -X GET https://10.111.124.230/redfish/v1/Systems/1/Storages/RaidController_0/Volumes

回显:

D:\programs\curl-7.87.0-win64-mingw\bin>curl.exe -H "Content-Type: application/json" -sk -u USERID:PASSW0RD -X GET https://10.111.124.230/redfish/v1/Systems/1/Storages/RaidController_0/Volumes | python -m json.tool
{
    "@odata.context": "/redfish/v1/$metadata#VolumeCollection.VolumeCollection",
    "@odata.etag": "\"1720056809\"",
    "@odata.id": "/redfish/v1/Systems/1/Storages/RaidController_0/Volumes",
    "@odata.type": "#VolumeCollection.VolumeCollection",
    "Description": "The Collection for Volumes",
    "Members": [
        {
            "@odata.id": "/redfish/v1/Systems/1/Storages/RaidController_0/Volumes/LogicDrivers0"
        }
    ],
    "Members@odata.count": 1,
    "Name": "Volume Collection"
}

7.检查Raid1阵列

curl.exe -H "Content-Type: application/json" -sk -u USERID:PASSW0RD -X GET https://10.111.124.230/redfish/v1/Systems/1/Storages/RaidController_0/Volumes/LogicDrivers0

回显:

D:\programs\curl-7.87.0-win64-mingw\bin>curl.exe -H "Content-Type: application/json" -sk -u USERID:PASSW0RD -X GET https://10.111.124.230/redfish/v1/Systems/1/Storages/RaidController_0/Volumes/LogicDrivers0 | python -m json.tool
{
    "@odata.context": "/redfish/v1/$metadata#Volume.Volume",
    "@odata.etag": "\"1720071210\"",
    "@odata.id": "/redfish/v1/Systems/1/Storages/RaidController_0/Volumes/LogicDrivers0",
    "@odata.type": "#Volume.v1_5_0.Volume",
    "CapacityBytes": 238999830528,
    "Encrypted": null,
    "Id": "LogicDrivers0",
    "Links": {
        "Drives": [
            {
                "@odata.id": "/redfish/v1/Systems/1/Storages/RaidController_0/Drives/RaidController0_8"
            },
            {
                "@odata.id": "/redfish/v1/Systems/1/Storages/RaidController_0/Drives/RaidController0_9"
            }
        ],
        "Drives@odata.count": 2
    },
    "Name": "LogicDrivers0",
    "Oem": {
        "Public": {
            "AccessPolicy": "Read-Write",
            "CachePolicy": "Unchanged",
            "IOPolicy": "DirectIO",
            "Initialization": "No_Initialization",
            "NumDrivePerSpan": 2,
            "RaidControllerID": 7282,
            "ReadPolicy": "Off",
            "SpanNumber": 1,
            "StripSize": "64K",
            "VolumeName": "Raid1pm",
            "VolumeRaidLevel": "RAID1",
            "WritePolicy": "WriteThrough"
        }
    },
    "ReadCachePolicy": "Off",
    "Status": {
        "Health": "OK",
        "State": "Enabled"
    },
    "StripSizeBytes": 65536,
    "VolumeType": "StripedWithParity"
}

8.删除Raid1阵列

DELETE https://10.111.124.230/redfish/v1/Systems/1/Storages/RaidController_0/Volumes/LogicDrivers0

回显:

D:\programs\curl-7.87.0-win64-mingw\bin>curl.exe -H "Content-Type: application/json" -sk -u USERID:PASSW0RD -X DELETE https://10.111.124.230/redfish/v1/Systems/1/Storages/RaidController_0/Volumes/LogicDrivers0 | python -m json.tool

日志收集:
1.BMC 一键收集日志

POST https://10.111.124.230/redfish/v1/Managers/1/LogServices/Actions/Oem/Public/CollectAllLog

回显:

D:\programs\curl-7.87.0-win64-mingw\bin>curl.exe -sk -u USERID:PASSW0RD -X POST https://10.111.124.230/redfish/v1/Managers/1/LogServices/Actions/Oem/Public/CollectAllLog --header "X-Auth-Token: TOKEN" -d "{\"Oem\": {\"Public\": {*}}}" | python -m json.tool
{
    "Oem": {
        "Public": {
            "Status": 0
        }
    }
}

2.查询 BMC 一键收集日志进度

GET https://10.111.124.230/redfish/v1/Managers/1/LogServices/Actions/Oem/Public/CollectProgress

回显:

D:\programs\curl-7.87.0-win64-mingw\bin>curl.exe -sk -u USERID:PASSW0RD -X GET "https://10.111.124.230/redfish/v1/Managers/1/LogServices/Actions/Oem/Public/CollectProgress" | python -m json.tool
{
    "@odata.context": "/redfish/v1/$metadata#LogService.LogService",
    "@odata.etag": "\"1720406138\"",
    "@odata.id": "/redfish/v1/Managers/1/LogServices/Actions/Oem/Public/CollectProgress",
    "@odata.type": "#LogService.v1_1_3.LogService",
    "Oem": {
        "Public": {
            "Progress": 100,
            "Status": 0
        }
    }
}

3.BMC 下载一键收集日志

GET https://10.111.124.230/redfish/v1/Managers/1/LogServices/Actions/Oem/Public/DownloadAllLog

回显:

D:\programs\curl-7.87.0-win64-mingw\bin>curl.exe -sk -u USERID:PASSW0RD -X GET https://10.111.124.230/redfish/v1/Managers/1/LogServices/Actions/Oem/Public/DownloadAllLog --output D:\1\ONEKEY1.zip

更新固件:
1.上传固件

POST https://{bmc_ip}/redfish/v1/UpdateService/Actions/Oem/UpdateService.UploadFirmwareImage

回显:

D:\programs\curl-7.87.0-win64-mingw\bin>curl.exe -sk -u USERID:PASSW0RD -X POST https://10.111.124.230/redfish/v1/UpdateService/Actions/Oem/UpdateService.UploadFirmwareImage --header "X-Auth-Token: TOKEN" -F "image_file=@D:\1\bmc.ima" -F "image_type=BMC"

2.更新固件

POST https://10.111.124.230/redfish/v1/UpdateService/Actions/Oem/UpdateService.BMCFwUpdate

回显:

D:\programs\curl-7.87.0-win64-mingw\bin>curl.exe -sk -u USERID:PASSW0RD -X POST https://10.111.124.230/redfish/v1/UpdateService/Actions/Oem/UpdateService.BMCFwUpdate --header "X-Auth-Token: TOKEN" --header "Content-Type: application/json" -d "{\"FlashType\":\"DUALIMAGEFwUpdate\" , \"UploadSelector\":\"Image2\"}" | python -m json.tool
{
    "@odata.type": "#UpdateService.v1_6_0.UpdateService",
    "Messages": [
        {
            "@odata.type": "#Message.v1_0_8.Message",
            "Message": "A new task /redfish/v1/TaskService/Tasks/1 was created.",
            "MessageArgs": [
                "/redfish/v1/TaskService/Tasks/1"
            ],
            "MessageId": "Task.1.0.New",
            "Resolution": "None",
            "Severity": "OK"
        },
        {
            "@odata.type": "#Message.v1_0_8.Message",
            "Message": "Device is preparing flash firmware for action UpdateService.BMCFwUpdate.",
            "MessageArgs": [
                "UpdateService.BMCFwUpdate"
            ],
            "MessageId": "UpdateService.1.0.PrepareUpdate",
            "Resolution": "None",
            "Severity": "OK"
        }
    ]
}

3.查看BMC是否开始更新动作

GET https://10.111.124.230/redfish/v1/TaskService/Tasks/1

回显:

https://10.111.124.230/redfish/v1/TaskService/Tasks/1
{
    "@odata.context": "/redfish/v1/$metadata#Task.Task",
    "@odata.etag": "\"1720425331\"",
    "@odata.id": "/redfish/v1/TaskService/Tasks/1",
    "@odata.type": "#Task.v1_4_2.Task",
    "Description": "Task for Update Service Task",
    "Id": "1",
    "Messages": [
        {
            "@odata.type": "#Message.v1_0_8.Message",
            "Message": "Task /redfish/v1/UpdateService/Actions/Oem/UpdateService.BMCFwUpdate is running normally.",
            "MessageArgs": [
                "/redfish/v1/UpdateService/Actions/Oem/UpdateService.BMCFwUpdate"
            ],
            "MessageId": "Task.1.0.Running",
            "Resolution": "None",
            "Severity": "OK"
        },
        {
            "@odata.type": "#Message.v1_0_8.Message",
            "Message": "Device is preparing flash area for action /redfish/v1/UpdateService/Actions/Oem/UpdateService.BMCFwUpdate.",
            "MessageArgs": [
                "/redfish/v1/UpdateService/Actions/Oem/UpdateService.BMCFwUpdate"
            ],
            "MessageId": "UpdateService.1.0.PrepareFlashArea",
            "Resolution": "None",
            "Severity": "OK"
        }
    ],
    "Name": "Update Service Task",
    "StartTime": "2024-07-08T15:55:30+08:00",
    "TaskState": "Running",
    "TaskStatus": "OK"
}

此处评论已关闭