Return 200 OK for all dumps in LogService.ClearLog
Change:
* Return 200 OK in a dump when doing ClearLog.
Reason:
* Status Code 204 No Content causes user confusion when using things
like curl.
* ClearLog is an Action, so the relevant section of the spec is
"Table - POST (action) status codes".
Tested:
* Ran the ast2600-evb on QEMU and verified that the ClearLog dump for
Managers and Systems returned a 200 status code along with the
expected response data.
[Manager Dump]
```
yahanc@amyc:~$ curl -k -u root:0penBmc -X POST https://127.0.0.1:2443/\
redfish/v1/Managers/bmc/LogServices/Dump/Actions/LogService.ClearLog \
-w "%{http_code}\n"
{
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The request completed successfully.",
"MessageArgs": [],
"MessageId": "Base.1.19.Success",
"MessageSeverity": "OK",
"Resolution": "None."
}
]
}200
yahanc@amyc:~$
```
[Manager FaultLog]
```
yahanc@amyc:~$ curl -k -u root:0penBmc -X POST https://127.0.0.1:2443/\
redfish/v1/Managers/bmc/LogServices/FaultLog/Actions/\
LogService.ClearLog -w "%{http_code}\n"
{
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The request completed successfully.",
"MessageArgs": [],
"MessageId": "Base.1.19.Success",
"MessageSeverity": "OK",
"Resolution": "None."
}
]
}200
yahanc@amyc:~$
```
[System EventLog]
```
yahanc@amyc:~$ curl -k -u root:0penBmc -X POST https://127.0.0.1:2443/\
redfish/v1/Systems/system/LogServices/EventLog/Actions/\
LogService.ClearLog -w "%{http_code}\n"
{
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The request completed successfully.",
"MessageArgs": [],
"MessageId": "Base.1.19.Success",
"MessageSeverity": "OK",
"Resolution": "None."
}
]
}200
yahanc@amyc:~$
```
Change-Id: I85cde45ce5063365866a4b2e76c3b55de7c10e11
Signed-off-by: Amy Chang <yahanc@nvidia.com>
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index 8d29341..c65875a 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -1092,6 +1092,7 @@
messages::internalError(asyncResp->res);
return;
}
+ messages::success(asyncResp->res);
},
"xyz.openbmc_project.Dump.Manager", getDumpPath(dumpType),
"xyz.openbmc_project.Collection.DeleteAll", "DeleteAll");
@@ -3139,7 +3140,7 @@
return;
}
- asyncResp->res.result(boost::beast::http::status::no_content);
+ messages::success(asyncResp->res);
};
// Make call to Logging service to request Clear Log