Redfish: Added OCP mandatory properties
- Manager: Added SerialConsole, Links/ManagerForChassis and Links/ManagerForChassis@odata.count
- System: Added Links/Chassis, Links/ManagedBy, Status, BiosVersion
- Power: Added placeholder for PowerControl
Tested:
GET /redfish/v1/Systems/system HTTP/1.1
Response:
{
"@odata.context": "/redfish/v1/$metadata#ComputerSystem.ComputerSystem",
"@odata.id": "/redfish/v1/Systems/system",
"@odata.type": "#ComputerSystem.v1_6_0.ComputerSystem",
......
"BiosVersion": "SE5C620.86B.01.00.0361.120520162351",
......
"Description": "Computer System",
"Id": "system",
"IndicatorLED": "Off",
"Links": {
"Chassis": [
{
"@odata.id": "/redfish/v1/Chassis/R1000_Chassis"
}
],
"ManagedBy": [
{
"@odata.id": "/redfish/v1/Managers/bmc"
}
]
},
......
"Processors": {
"@odata.id": "/redfish/v1/Systems/system/Processors"
},
"Status": {
"Health": "OK",
"State": "Enabled"
},
"SystemType": "Physical",
"UUID": "13876882-7708-4200-bcf2-2c5681218bc8"
}
GET /redfish/v1/Managers/bmc HTTP/1.1
Response:
{
"@odata.context": "/redfish/v1/$metadata#Manager.Manager",
"@odata.id": "/redfish/v1/Managers/bmc",
"@odata.type": "#Manager.v1_3_0.Manager",
......
"Description": "Baseboard Management Controller",
"Linkn"fces": {
"@odata.id": "/redfish/v1/Managers/bmc/EthernetInterfaces"
},
"FirmwareVersion": "2.7.0-dev-266-g111d297-d14e857",
"Id": "bmc",
Links: {
"ManagerForChassis": [
{
"@odata.id": "/redfish/v1/Chassis/R1000_Chassis"
}
],
"ManagerForChassis@odata.count": 1,
"ManagerForServers": [
{
"@odata.id": "/redfish/v1/Systems/system"
}
],
"ManagerForServers@odata.count": 1
},
......
"SerialConsole": {
"ConnectTypesSupported": [
"IPMI",
"SSH"
],
"ServiceEnabled": true
},
"Status": {
"Health": "OK",
"State": "Enabled"
},
"UUID": "067b4e8d-6c29-475c-92a1-6590d4e5818c"
}
GET /redfish/v1/Chassis/R1000_Chassis/Power HTTP/1.1
Response:
{
"@odata.context": "/redfish/v1/$metadata#Power.Power",
"@odata.id": "/redfish/v1/Chassis/R1000_Chassis/Power",
"@odata.type": "#Power.v1_2_1.Power",
"Id": "Power",
"Name": "Power",
"PowerControl": []
}
Signed-off-by: Jennifer Lee <jennifer1.lee@intel.com>
Change-Id: I61d8ba493ad689d7062e1f8bfd26d9a0d80230da
diff --git a/redfish-core/lib/power.hpp b/redfish-core/lib/power.hpp
index b5951d5..07b4b38 100644
--- a/redfish-core/lib/power.hpp
+++ b/redfish-core/lib/power.hpp
@@ -52,6 +52,8 @@
}
const std::string& chassis_name = params[0];
+ res.jsonValue["PowerControl"] = nlohmann::json::array();
+
auto sensorAsyncResp = std::make_shared<SensorsAsyncResp>(
res, chassis_name, typeList, "Power");