[Redfish] Fixed PATCH behavior of IndicatorLED in ComputerSystem
Patching IndicatorLED to "Lit" was not working. Also modified the
response code to 204 no-content for successful PATCH request.
Tested:
PATCH /redfish/v1/Systems/system HTTP/1.1
{
"IndicatorLED": "Lit"
}
Response:
204 No Content
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",
"Actions": {
"#ComputerSystem.Reset": {
"ResetType@Redfish.AllowableValues": [
"On",
"ForceOff",
"GracefulRestart",
"GracefulShutdown"
],
"target": "/redfish/v1/Systems/system/Actions/ComputerSystem.Reset"
}
},
"Boot": {
"BootSourceOverrideEnabled": "Disabled",
"BootSourceOverrideMode": "Legacy",
"BootSourceOverrideTarget": "None",
"BootSourceOverrideTarget@Redfish.AllowableValues": [
"None",
"Pxe",
"Hdd",
"Cd",
"Diags",
"BiosSetup"
]
},
"Description": "Computer System",
"Id": "system",
"IndicatorLED": "Lit",
"LogServices": {
"@odata.id": "/redfish/v1/Systems/system/LogServices"
},
"Memory": {
"@odata.id": "/redfish/v1/Systems/system/Memory"
},
"MemorySummary": {
"Status": {
"State": "Disabled"
},
"TotalSystemMemoryGiB": 0
},
"Name": "Computer System",
"PowerState": "On",
"ProcessorSummary": {
"Count": 4,
"Model": "Intel Xeon processor",
"Status": {
"State": "Enabled"
}
},
"Processors": {
"@odata.id": "/redfish/v1/Systems/system/Processors"
},
"Status": {
"State": "Enabled"
},
"SystemType": "Physical",
"UUID": "13876882-7708-4200-bcf2-2c5681218bc8"
}
Signed-off-by: Jennifer Lee <jennifer1.lee@intel.com>
Change-Id: I8ae152190ee9f122e8580903a9d5e687b2fd9e13
diff --git a/redfish-core/lib/systems.hpp b/redfish-core/lib/systems.hpp
index a76f2c4..70e9dac 100644
--- a/redfish-core/lib/systems.hpp
+++ b/redfish-core/lib/systems.hpp
@@ -1189,7 +1189,7 @@
}
auto asyncResp = std::make_shared<AsyncResp>(res);
- messages::success(asyncResp->res);
+ asyncResp->res.result(boost::beast::http::status::no_content);
if (bootProps)
{
@@ -1208,9 +1208,9 @@
if (indicatorLed)
{
std::string dbusLedState;
- if (*indicatorLed == "On")
+ if (*indicatorLed == "Lit")
{
- dbusLedState = "xyz.openbmc_project.Led.Physical.Action.Lit";
+ dbusLedState = "xyz.openbmc_project.Led.Physical.Action.On";
}
else if (*indicatorLed == "Blinking")
{
@@ -1227,9 +1227,6 @@
return;
}
- getHostState(asyncResp);
- getComputerSystem(asyncResp);
-
// Update led group
BMCWEB_LOG_DEBUG << "Update led group.";
crow::connections::systemBus->async_method_call(