LogService: Add support for Fault Log
The corresponding log service is at
/redfish/v1/Managers/bmc/LogServices/FaultLog
Fault Log is a new type of dump for aggregating fault data. For details
please see
https://github.com/openbmc/docs/blob/master/designs/hw-fault-monitor.md
We're currently assuming we'll have a single Fault Log instance per
BMC, which can support multiple host processors.
Tested:
First enabled redfish-dump-log option
Fault Log showed up in the expected LogService collection:
./curl_bin -k -H "X-Auth-Token: $token" -X GET http://${bmc}/redfish/v1/Managers/bmc/LogServices/
{
"@odata.id": "/redfish/v1/Managers/bmc/LogServices",
"@odata.type": "#LogServiceCollection.LogServiceCollection",
"Description": "Collection of LogServices for this Manager",
"Members": [
{
"@odata.id": "/redfish/v1/Managers/bmc/LogServices/Journal"
},
{
"@odata.id": "/redfish/v1/Managers/bmc/LogServices/Dump"
},
{
"@odata.id": "/redfish/v1/Managers/bmc/LogServices/FaultLog"
}
],
"Members@odata.count": 3,
"Name": "Open BMC Log Services Collection"
}
FaultLog dump entries are created when a fault is detected by a BMC
daemon -- we don't support FaultLog dump entry creation requested by
a Redfish client via the CollectDiagnosticData LogService action.
Fault Log CollectDiagnosticData returned Not Found (HTTP error
404) as expected:
$curl -k -H "X-Auth-Token: $token" -X POST http://${bmc}/redfish/v1/Managers/bmc/LogServices/FaultLog/Actions/LogService.CollectDiagnosticData -d '{"DiagnosticDataType":"Manager", "OEMDiagnosticDataType":"FaultLog"}'
Not Found
Generated Fault Log dump entries via BMC console:
busctl call xyz.openbmc_project.Dump.Manager /xyz/openbmc_project/dump/faultlog xyz.openbmc_project.Dump.Create CreateDump a{sv} 0
Retrieved Fault Log dump entries (including with query parameters top and skip):
curl -k -H "X-Auth-Token: $token" -X GET
http://${bmc}/redfish/v1/Managers/bmc/LogServices/FaultLog/Entries/1
curl -k -H "X-Auth-Token: $token" -X GET
http://${bmc}/redfish/v1/Managers/bmc/LogServices/FaultLog/Entries
curl -k -H "X-Auth-Token: $token" -X GET
http://${bmc}/redfish/v1/Managers/bmc/LogServices/FaultLog/Entries?\$skip=2
curl -k -H "X-Auth-Token: $token" -X GET http://${bmc}/redfish/v1/Managers/bmc/LogServices/FaultLog/Entries?\$top=3
Deleted Fault Log dump entry:
curl -k -H "X-Auth-Token: $token" -X DELETE http://${bmc}/redfish/v1/Managers/bmc/LogServices/FaultLog/Entries/1
Note: The following command to clear the Fault Log will not work until
Fault Log entries have the required D-Bus interface implemented
(xyz.openbmc_project.Dump.Entry.FaultLog):
curl -k -H "X-Auth-Token: $token" -X POST http://${bmc}/redfish/v1/Managers/bmc/LogServices/FaultLog/Actions/LogService.ClearLog
Redfish Service Validator succeeded on the following URIs:
/redfish/v1/Managers/bmc/LogServices
/redfish/v1/Managers/bmc/LogServices/FaultLog
/redfish/v1/Managers/bmc/LogServices/FaultLog/Entries
Also did cursory testing of BMC Dump (/redfish/v1/Managers/bmc/LogServices/Dump/)
and System Dump (/redfish/v1/Systems/system/LogServices/Dump/) for code
paths that were refactored.
Signed-off-by: Claire Weinan <cweinan@google.com>
Change-Id: I80b5444e61263f79e89b10abd556d59af6f17c8c
diff --git a/redfish-core/include/redfish.hpp b/redfish-core/include/redfish.hpp
index b7dd3b3..c961b2d 100644
--- a/redfish-core/include/redfish.hpp
+++ b/redfish-core/include/redfish.hpp
@@ -119,6 +119,11 @@
requestRoutesBMCDumpEntry(app);
requestRoutesBMCDumpCreate(app);
requestRoutesBMCDumpClear(app);
+
+ requestRoutesFaultLogDumpService(app);
+ requestRoutesFaultLogDumpEntryCollection(app);
+ requestRoutesFaultLogDumpEntry(app);
+ requestRoutesFaultLogDumpClear(app);
#endif
#ifndef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES