Lines Matching +full:redfish +full:- +full:messages

1 // SPDX-License-Identifier: Apache-2.0
2 // SPDX-FileCopyrightText: Copyright OpenBMC Authors
3 // SPDX-FileCopyrightText: Copyright 2018 Intel Corporation
33 #include <asm-generic/errno.h>
34 #include <systemd/sd-bus.h>
73 namespace redfish namespace
153 if (entryStream >> std::get_time(&timeStruct, "%Y-%m-%dT%H:%M:%S")) in getUniqueEntryID()
182 static const std::string redfishLogFilename = "redfish"; in getRedfishLogFiles()
184 // Loop through the directory looking for redfish log files in getRedfishLogFiles()
188 // If we find a redfish log file, save the path in getRedfishLogFiles()
242 messages::internalError(asyncResp->res); in parseDumpEntryFromDbusObject()
259 messages::internalError(asyncResp->res); in parseDumpEntryFromDbusObject()
277 messages::internalError(asyncResp->res); in parseDumpEntryFromDbusObject()
296 messages::internalError(asyncResp->res); in parseDumpEntryFromDbusObject()
308 messages::internalError(asyncResp->res); in parseDumpEntryFromDbusObject()
315 messages::internalError(asyncResp->res); in parseDumpEntryFromDbusObject()
331 std::format("/redfish/v1/Managers/{}/LogServices/Dump/Entries/", in getDumpEntriesPath()
337 std::format("/redfish/v1/Managers/{}/LogServices/FaultLog/Entries/", in getDumpEntriesPath()
343 std::format("/redfish/v1/Systems/{}/LogServices/Dump/Entries/", in getDumpEntriesPath()
363 messages::internalError(asyncResp->res); in getDumpEntryCollection()
376 messages::internalError(asyncResp->res); in getDumpEntryCollection()
387 asyncResp->res.jsonValue["@odata.type"] = in getDumpEntryCollection()
389 asyncResp->res.jsonValue["@odata.id"] = std::move(odataIdStr); in getDumpEntryCollection()
390 asyncResp->res.jsonValue["Name"] = dumpType + " Dump Entries"; in getDumpEntryCollection()
391 asyncResp->res.jsonValue["Description"] = in getDumpEntryCollection()
441 redfish::time_utils::getDateTimeUintUs(timestampUs); in getDumpEntryCollection()
466 asyncResp->res.jsonValue["Members@odata.count"] = in getDumpEntryCollection()
468 asyncResp->res.jsonValue["Members"] = std::move(entriesArray); in getDumpEntryCollection()
479 messages::internalError(asyncResp->res); in getDumpEntryById()
492 messages::internalError(asyncResp->res); in getDumpEntryById()
524 messages::resourceNotFound(asyncResp->res, in getDumpEntryById()
529 asyncResp->res.jsonValue["@odata.type"] = in getDumpEntryById()
531 asyncResp->res.jsonValue["@odata.id"] = entriesPath + entryID; in getDumpEntryById()
532 asyncResp->res.jsonValue["Id"] = entryID; in getDumpEntryById()
533 asyncResp->res.jsonValue["EntryType"] = "Event"; in getDumpEntryById()
534 asyncResp->res.jsonValue["Name"] = dumpType + " Dump Entry"; in getDumpEntryById()
535 asyncResp->res.jsonValue["Created"] = in getDumpEntryById()
536 redfish::time_utils::getDateTimeUintUs(timestampUs); in getDumpEntryById()
540 asyncResp->res.jsonValue["Originator"] = originatorId; in getDumpEntryById()
541 asyncResp->res.jsonValue["OriginatorType"] = originatorType; in getDumpEntryById()
546 asyncResp->res.jsonValue["DiagnosticDataType"] = "Manager"; in getDumpEntryById()
547 asyncResp->res.jsonValue["AdditionalDataURI"] = in getDumpEntryById()
549 asyncResp->res.jsonValue["AdditionalDataSizeBytes"] = size; in getDumpEntryById()
553 asyncResp->res.jsonValue["DiagnosticDataType"] = "OEM"; in getDumpEntryById()
554 asyncResp->res.jsonValue["OEMDiagnosticDataType"] = in getDumpEntryById()
556 asyncResp->res.jsonValue["AdditionalDataURI"] = in getDumpEntryById()
558 asyncResp->res.jsonValue["AdditionalDataSizeBytes"] = size; in getDumpEntryById()
564 messages::resourceNotFound(asyncResp->res, dumpType + " dump", in getDumpEntryById()
582 messages::resourceNotFound(asyncResp->res, "LogEntry", entryID); in deleteDumpEntry()
588 messages::internalError(asyncResp->res); in deleteDumpEntry()
593 crow::connections::systemBus->async_method_call( in deleteDumpEntry()
605 messages::internalError(res); in checkSizeLimit()
615 messages::internalError(res); in checkSizeLimit()
622 messages::internalError(res); in checkSizeLimit()
635 messages::resourceNotFound(asyncResp->res, "EntryAttachment", entryID); in downloadEntryCallback()
641 messages::internalError(asyncResp->res); in downloadEntryCallback()
650 messages::internalError(asyncResp->res); in downloadEntryCallback()
653 int fd = -1; in downloadEntryCallback()
658 messages::internalError(asyncResp->res); in downloadEntryCallback()
661 if (!checkSizeLimit(fd, asyncResp->res)) in downloadEntryCallback()
668 if (!asyncResp->res.openFd(fd, bmcweb::EncodingType::Base64)) in downloadEntryCallback()
670 messages::internalError(asyncResp->res); in downloadEntryCallback()
674 asyncResp->res.addHeader( in downloadEntryCallback()
678 if (!asyncResp->res.openFd(fd)) in downloadEntryCallback()
680 messages::internalError(asyncResp->res); in downloadEntryCallback()
684 asyncResp->res.addHeader(boost::beast::http::field::content_type, in downloadEntryCallback()
685 "application/octet-stream"); in downloadEntryCallback()
695 messages::resourceNotFound(asyncResp->res, dumpType + " dump", entryID); in downloadDumpEntry()
709 crow::connections::systemBus->async_method_call( in downloadDumpEntry()
722 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in downloadEventLogEntry()
728 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in downloadEventLogEntry()
744 crow::connections::systemBus->async_method_call( in downloadEventLogEntry()
789 return std::format("/redfish/v1/Managers/{}/LogServices/Dump/Entries/", in getDumpEntryPath()
794 return std::format("/redfish/v1/Systems/{}/LogServices/Dump/Entries/", in getDumpEntryPath()
813 messages::internalError(asyncResp->res); in createDumpTaskCallback()
817 crow::connections::systemBus->async_method_call( in createDumpTaskCallback()
826 messages::internalError(asyncResp->res); in createDumpTaskCallback()
841 messages::internalError(asyncResp->res); in createDumpTaskCallback()
845 pRoot->FirstChildElement("interface"); in createDumpTaskCallback()
851 interfaceNode->Attribute("name"); in createDumpTaskCallback()
858 interfaceNode->NextSiblingElement("interface"); in createDumpTaskCallback()
864 interfaceNode = interfaceNode->NextSiblingElement("interface"); in createDumpTaskCallback()
876 taskData->messages.emplace_back( in createDumpTaskCallback()
877 messages::internalError()); in createDumpTaskCallback()
878 taskData->state = "Cancelled"; in createDumpTaskCallback()
895 taskData->state = "Cancelled"; in createDumpTaskCallback()
909 nlohmann::json retMessage = messages::success(); in createDumpTaskCallback()
910 taskData->messages.emplace_back(retMessage); in createDumpTaskCallback()
913 "/redfish/v1/Managers/{}/LogServices/Dump/Entries/{}", in createDumpTaskCallback()
919 taskData->payload->httpHeaders.emplace_back( in createDumpTaskCallback()
924 taskData->state = "Completed"; in createDumpTaskCallback()
933 task->startTimer(std::chrono::minutes(6)); in createDumpTaskCallback()
934 task->populateResp(asyncResp->res); in createDumpTaskCallback()
935 task->payload.emplace(payload); in createDumpTaskCallback()
947 messages::internalError(asyncResp->res); in createDump()
954 if (!redfish::json_util::readJsonAction( // in createDump()
955 req, asyncResp->res, // in createDump()
969 messages::actionParameterMissing( in createDump()
970 asyncResp->res, "CollectDiagnosticData", in createDump()
978 messages::internalError(asyncResp->res); in createDump()
981 dumpPath = std::format("/redfish/v1/Systems/{}/LogServices/Dump/", in createDump()
990 messages::actionParameterMissing( in createDump()
991 asyncResp->res, "CollectDiagnosticData", "DiagnosticDataType"); in createDump()
998 messages::internalError(asyncResp->res); in createDump()
1001 dumpPath = std::format("/redfish/v1/Managers/{}/LogServices/Dump/", in createDump()
1007 messages::internalError(asyncResp->res); in createDump()
1018 req.session->clientIp); in createDump()
1024 crow::connections::systemBus->async_method_call( in createDump()
1035 messages::internalError(asyncResp->res); in createDump()
1040 dbusError->name, dbusError->message); in createDump()
1043 dbusError->name) in createDump()
1045 messages::resourceInStandby(asyncResp->res); in createDump()
1050 dbusError->name) in createDump()
1052 messages::serviceDisabled(asyncResp->res, dumpPath); in createDump()
1057 dbusError->name) in createDump()
1059 messages::resourceInUse(asyncResp->res); in createDump()
1069 messages::internalError(asyncResp->res); in createDump()
1082 crow::connections::systemBus->async_method_call( in clearDump()
1087 messages::internalError(asyncResp->res); in clearDump()
1133 BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/") in requestRoutesSystemLogServiceCollection()
1134 .privileges(redfish::privileges::getLogServiceCollection) in requestRoutesSystemLogServiceCollection()
1140 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in requestRoutesSystemLogServiceCollection()
1147 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesSystemLogServiceCollection()
1153 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesSystemLogServiceCollection()
1160 asyncResp->res.jsonValue["@odata.type"] = in requestRoutesSystemLogServiceCollection()
1162 asyncResp->res.jsonValue["@odata.id"] = in requestRoutesSystemLogServiceCollection()
1163 std::format("/redfish/v1/Systems/{}/LogServices", in requestRoutesSystemLogServiceCollection()
1165 asyncResp->res.jsonValue["Name"] = "System Log Services Collection"; in requestRoutesSystemLogServiceCollection()
1166 asyncResp->res.jsonValue["Description"] = in requestRoutesSystemLogServiceCollection()
1169 asyncResp->res.jsonValue["Members"]; in requestRoutesSystemLogServiceCollection()
1173 std::format("/redfish/v1/Systems/{}/LogServices/EventLog", in requestRoutesSystemLogServiceCollection()
1180 std::format("/redfish/v1/Systems/{}/LogServices/Dump", in requestRoutesSystemLogServiceCollection()
1189 std::format("/redfish/v1/Systems/{}/LogServices/Crashdump", in requestRoutesSystemLogServiceCollection()
1198 std::format("/redfish/v1/Systems/{}/LogServices/HostLogger", in requestRoutesSystemLogServiceCollection()
1202 asyncResp->res.jsonValue["Members@odata.count"] = in requestRoutesSystemLogServiceCollection()
1223 asyncResp->res.jsonValue["Members"]; in requestRoutesSystemLogServiceCollection()
1226 "/redfish/v1/Systems/{}/LogServices/PostCodes", in requestRoutesSystemLogServiceCollection()
1232 asyncResp->res.jsonValue["Members@odata.count"] = in requestRoutesSystemLogServiceCollection()
1243 BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/EventLog/") in requestRoutesEventLogService()
1244 .privileges(redfish::privileges::getLogService) in requestRoutesEventLogService()
1250 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in requestRoutesEventLogService()
1256 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesEventLogService()
1260 asyncResp->res.jsonValue["@odata.id"] = in requestRoutesEventLogService()
1261 std::format("/redfish/v1/Systems/{}/LogServices/EventLog", in requestRoutesEventLogService()
1263 asyncResp->res.jsonValue["@odata.type"] = in requestRoutesEventLogService()
1265 asyncResp->res.jsonValue["Name"] = "Event Log Service"; in requestRoutesEventLogService()
1266 asyncResp->res.jsonValue["Description"] = in requestRoutesEventLogService()
1268 asyncResp->res.jsonValue["Id"] = "EventLog"; in requestRoutesEventLogService()
1269 asyncResp->res.jsonValue["OverWritePolicy"] = in requestRoutesEventLogService()
1273 redfish::time_utils::getDateTimeOffsetNow(); in requestRoutesEventLogService()
1275 asyncResp->res.jsonValue["DateTime"] = redfishDateTimeOffset.first; in requestRoutesEventLogService()
1276 asyncResp->res.jsonValue["DateTimeLocalOffset"] = in requestRoutesEventLogService()
1279 asyncResp->res.jsonValue["Entries"]["@odata.id"] = std::format( in requestRoutesEventLogService()
1280 "/redfish/v1/Systems/{}/LogServices/EventLog/Entries", in requestRoutesEventLogService()
1282 asyncResp->res in requestRoutesEventLogService()
1286 "/redfish/v1/Systems/{}/LogServices/EventLog/Actions/LogService.ClearLog", in requestRoutesEventLogService()
1296 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in handleSystemsLogServicesEventLogActionsClearPost()
1302 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in handleSystemsLogServicesEventLogActionsClearPost()
1319 crow::connections::systemBus->async_method_call( in handleSystemsLogServicesEventLogActionsClearPost()
1324 messages::internalError(asyncResp->res); in handleSystemsLogServicesEventLogActionsClearPost()
1328 messages::success(asyncResp->res); in handleSystemsLogServicesEventLogActionsClearPost()
1339 "/redfish/v1/Systems/<str>/LogServices/EventLog/Actions/LogService.ClearLog/") in requestRoutesJournalEventLogClear()
1356 // The redfish log format is "<Timestamp> <MessageId>,<MessageArgs>" in fillEventLogEntryJson()
1394 messageArgs.resize(message->numberOfArgs); in fillEventLogEntryJson()
1397 redfish::registries::fillMessageArgs(messageArgs, message->message); in fillEventLogEntryJson()
1404 // format which matches the Redfish format except for the fractional seconds in fillEventLogEntryJson()
1410 timestamp.erase(dot, plus - dot); in fillEventLogEntryJson()
1416 "/redfish/v1/Systems/{}/LogServices/EventLog/Entries/{}", in fillEventLogEntryJson()
1424 logEntryJson["Severity"] = message->messageSeverity; in fillEventLogEntryJson()
1439 messages::internalError(asyncResp->res); in fillEventLogLogEntryFromPropertyMap()
1446 "/redfish/v1/Systems/{}/LogServices/EventLog/Entries/{}", in fillEventLogLogEntryFromPropertyMap()
1458 if ((entry.Resolution != nullptr) && !entry.Resolution->empty()) in fillEventLogLogEntryFromPropertyMap()
1466 redfish::time_utils::getDateTimeUintMs(entry.Timestamp); in fillEventLogLogEntryFromPropertyMap()
1468 redfish::time_utils::getDateTimeUintMs(entry.UpdateTimestamp); in fillEventLogLogEntryFromPropertyMap()
1472 "/redfish/v1/Systems/{}/LogServices/EventLog/Entries/{}/attachment", in fillEventLogLogEntryFromPropertyMap()
1488 messages::internalError(asyncResp->res); in afterLogEntriesGetManagedObjects()
1519 redfish::json_util::sortJsonArrayByKey(entriesArray, "Id"); in afterLogEntriesGetManagedObjects()
1520 asyncResp->res.jsonValue["Members@odata.count"] = entriesArray.size(); in afterLogEntriesGetManagedObjects()
1521 asyncResp->res.jsonValue["Members"] = std::move(entriesArray); in afterLogEntriesGetManagedObjects()
1534 if (!redfish::setUpRedfishRouteWithDelegation(app, req, asyncResp, in handleSystemsLogServiceEventLogLogEntryCollection()
1542 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in handleSystemsLogServiceEventLogLogEntryCollection()
1548 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in handleSystemsLogServiceEventLogLogEntryCollection()
1558 asyncResp->res.jsonValue["@odata.type"] = in handleSystemsLogServiceEventLogLogEntryCollection()
1560 asyncResp->res.jsonValue["@odata.id"] = in handleSystemsLogServiceEventLogLogEntryCollection()
1561 std::format("/redfish/v1/Systems/{}/LogServices/EventLog/Entries", in handleSystemsLogServiceEventLogLogEntryCollection()
1563 asyncResp->res.jsonValue["Name"] = "System Event Log Entries"; in handleSystemsLogServiceEventLogLogEntryCollection()
1564 asyncResp->res.jsonValue["Description"] = in handleSystemsLogServiceEventLogLogEntryCollection()
1567 nlohmann::json& logEntryArray = asyncResp->res.jsonValue["Members"]; in handleSystemsLogServiceEventLogLogEntryCollection()
1606 messages::internalError(asyncResp->res); in handleSystemsLogServiceEventLogLogEntryCollection()
1621 asyncResp->res.jsonValue["Members@odata.count"] = entryCount; in handleSystemsLogServiceEventLogLogEntryCollection()
1624 asyncResp->res.jsonValue["Members@odata.nextLink"] = in handleSystemsLogServiceEventLogLogEntryCollection()
1626 "/redfish/v1/Systems/{}/LogServices/EventLog/Entries?$skip={}", in handleSystemsLogServiceEventLogLogEntryCollection()
1633 BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/EventLog/Entries/") in requestRoutesJournalEventLogEntryCollection()
1634 .privileges(redfish::privileges::getLogEntryCollection) in requestRoutesJournalEventLogEntryCollection()
1644 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in handleSystemsLogServiceEventLogEntriesGet()
1651 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in handleSystemsLogServiceEventLogEntriesGet()
1658 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in handleSystemsLogServiceEventLogEntriesGet()
1699 messages::internalError(asyncResp->res); in handleSystemsLogServiceEventLogEntriesGet()
1702 asyncResp->res.jsonValue.update(bmcLogEntry); in handleSystemsLogServiceEventLogEntriesGet()
1708 messages::resourceNotFound(asyncResp->res, "LogEntry", targetID); in handleSystemsLogServiceEventLogEntriesGet()
1714 app, "/redfish/v1/Systems/<str>/LogServices/EventLog/Entries/<str>/") in requestRoutesJournalEventLogEntry()
1715 .privileges(redfish::privileges::getLogEntry) in requestRoutesJournalEventLogEntry()
1725 asyncResp->res.jsonValue["@odata.type"] = in dBusEventLogEntryCollection()
1727 asyncResp->res.jsonValue["@odata.id"] = in dBusEventLogEntryCollection()
1728 std::format("/redfish/v1/Systems/{}/LogServices/EventLog/Entries", in dBusEventLogEntryCollection()
1730 asyncResp->res.jsonValue["Name"] = "System Event Log Entries"; in dBusEventLogEntryCollection()
1731 asyncResp->res.jsonValue["Description"] = in dBusEventLogEntryCollection()
1747 BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/EventLog/Entries/") in requestRoutesDBusEventLogEntryCollection()
1748 .privileges(redfish::privileges::getLogEntryCollection) in requestRoutesDBusEventLogEntryCollection()
1753 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in requestRoutesDBusEventLogEntryCollection()
1760 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesDBusEventLogEntryCollection()
1766 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesDBusEventLogEntryCollection()
1788 messages::resourceNotFound(asyncResp->res, "EventLogEntry", in dBusEventLogEntryGet()
1796 messages::internalError(asyncResp->res); in dBusEventLogEntryGet()
1801 asyncResp->res.jsonValue); in dBusEventLogEntryGet()
1812 if (!json_util::readJsonPatch(req, asyncResp->res, "Resolved", resolved)) in dBusEventLogEntryPatch()
1839 messages::resourceNotFound(asyncResp->res, "LogEntry", entryID); in dBusEventLogEntryDelete()
1845 asyncResp->res.result( in dBusEventLogEntryDelete()
1850 asyncResp->res.result(boost::beast::http::status::ok); in dBusEventLogEntryDelete()
1854 crow::connections::systemBus->async_method_call( in dBusEventLogEntryDelete()
1863 app, "/redfish/v1/Systems/<str>/LogServices/EventLog/Entries/<str>/") in requestRoutesDBusEventLogEntry()
1864 .privileges(redfish::privileges::getLogEntry) in requestRoutesDBusEventLogEntry()
1869 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in requestRoutesDBusEventLogEntry()
1876 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesDBusEventLogEntry()
1882 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesDBusEventLogEntry()
1891 app, "/redfish/v1/Systems/<str>/LogServices/EventLog/Entries/<str>/") in requestRoutesDBusEventLogEntry()
1892 .privileges(redfish::privileges::patchLogEntry) in requestRoutesDBusEventLogEntry()
1897 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in requestRoutesDBusEventLogEntry()
1904 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesDBusEventLogEntry()
1910 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesDBusEventLogEntry()
1919 app, "/redfish/v1/Systems/<str>/LogServices/EventLog/Entries/<str>/") in requestRoutesDBusEventLogEntry()
1920 .privileges(redfish::privileges::deleteLogEntry) in requestRoutesDBusEventLogEntry()
1926 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in requestRoutesDBusEventLogEntry()
1933 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesDBusEventLogEntry()
1939 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesDBusEventLogEntry()
1952 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in handleBMCLogServicesCollectionGet()
1959 messages::resourceNotFound(asyncResp->res, "Manager", managerId); in handleBMCLogServicesCollectionGet()
1965 asyncResp->res.jsonValue["@odata.type"] = in handleBMCLogServicesCollectionGet()
1967 asyncResp->res.jsonValue["@odata.id"] = boost::urls::format( in handleBMCLogServicesCollectionGet()
1968 "/redfish/v1/Managers/{}/LogServices", BMCWEB_REDFISH_MANAGER_URI_NAME); in handleBMCLogServicesCollectionGet()
1969 asyncResp->res.jsonValue["Name"] = "Open BMC Log Services Collection"; in handleBMCLogServicesCollectionGet()
1970 asyncResp->res.jsonValue["Description"] = in handleBMCLogServicesCollectionGet()
1972 nlohmann::json& logServiceArray = asyncResp->res.jsonValue["Members"]; in handleBMCLogServicesCollectionGet()
1979 boost::urls::format("/redfish/v1/Managers/{}/LogServices/Journal", in handleBMCLogServicesCollectionGet()
1984 asyncResp->res.jsonValue["Members@odata.count"] = logServiceArray.size(); in handleBMCLogServicesCollectionGet()
2007 asyncResp->res.jsonValue["Members"]; in handleBMCLogServicesCollectionGet()
2015 "/redfish/v1/Managers/{}/LogServices/Dump", in handleBMCLogServicesCollectionGet()
2023 "/redfish/v1/Managers/{}/LogServices/FaultLog", in handleBMCLogServicesCollectionGet()
2029 asyncResp->res.jsonValue["Members@odata.count"] = in handleBMCLogServicesCollectionGet()
2037 BMCWEB_ROUTE(app, "/redfish/v1/Managers/<str>/LogServices/") in requestRoutesBMCLogServiceCollection()
2038 .privileges(redfish::privileges::getLogServiceCollection) in requestRoutesBMCLogServiceCollection()
2054 dumpPath = std::format("/redfish/v1/Managers/{}/LogServices/Dump", in getDumpServiceInfo()
2061 dumpPath = std::format("/redfish/v1/Managers/{}/LogServices/FaultLog", in getDumpServiceInfo()
2068 dumpPath = std::format("/redfish/v1/Systems/{}/LogServices/Dump", in getDumpServiceInfo()
2077 messages::internalError(asyncResp->res); in getDumpServiceInfo()
2081 asyncResp->res.jsonValue["@odata.id"] = dumpPath; in getDumpServiceInfo()
2082 asyncResp->res.jsonValue["@odata.type"] = "#LogService.v1_2_0.LogService"; in getDumpServiceInfo()
2083 asyncResp->res.jsonValue["Name"] = "Dump LogService"; in getDumpServiceInfo()
2084 asyncResp->res.jsonValue["Description"] = dumpType + " Dump LogService"; in getDumpServiceInfo()
2085 asyncResp->res.jsonValue["Id"] = std::filesystem::path(dumpPath).filename(); in getDumpServiceInfo()
2086 asyncResp->res.jsonValue["OverWritePolicy"] = overWritePolicy; in getDumpServiceInfo()
2089 redfish::time_utils::getDateTimeOffsetNow(); in getDumpServiceInfo()
2090 asyncResp->res.jsonValue["DateTime"] = redfishDateTimeOffset.first; in getDumpServiceInfo()
2091 asyncResp->res.jsonValue["DateTimeLocalOffset"] = in getDumpServiceInfo()
2094 asyncResp->res.jsonValue["Entries"]["@odata.id"] = dumpPath + "/Entries"; in getDumpServiceInfo()
2098 asyncResp->res.jsonValue["Actions"]["#LogService.CollectDiagnosticData"] in getDumpServiceInfo()
2122 asyncResp->res.jsonValue["Actions"]["#LogService.ClearLog"] in getDumpServiceInfo()
2136 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in handleLogServicesDumpServiceGet()
2143 messages::resourceNotFound(asyncResp->res, "Manager", managerId); in handleLogServicesDumpServiceGet()
2155 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in handleLogServicesDumpServiceComputerSystemGet()
2161 messages::resourceNotFound(asyncResp->res, "ComputerSystem", chassisId); in handleLogServicesDumpServiceComputerSystemGet()
2172 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in handleLogServicesDumpEntriesCollectionGet()
2179 messages::resourceNotFound(asyncResp->res, "Manager", managerId); in handleLogServicesDumpEntriesCollectionGet()
2190 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in handleLogServicesDumpEntriesCollectionComputerSystemGet()
2196 messages::resourceNotFound(asyncResp->res, "ComputerSystem", chassisId); in handleLogServicesDumpEntriesCollectionComputerSystemGet()
2207 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in handleLogServicesDumpEntryGet()
2213 messages::resourceNotFound(asyncResp->res, "Manager", managerId); in handleLogServicesDumpEntryGet()
2224 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in handleLogServicesDumpEntryComputerSystemGet()
2230 messages::resourceNotFound(asyncResp->res, "ComputerSystem", chassisId); in handleLogServicesDumpEntryComputerSystemGet()
2241 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in handleLogServicesDumpEntryDelete()
2248 messages::resourceNotFound(asyncResp->res, "Manager", managerId); in handleLogServicesDumpEntryDelete()
2259 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in handleLogServicesDumpEntryComputerSystemDelete()
2265 messages::resourceNotFound(asyncResp->res, "ComputerSystem", chassisId); in handleLogServicesDumpEntryComputerSystemDelete()
2276 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in handleLogServicesDumpEntryDownloadGet()
2283 messages::resourceNotFound(asyncResp->res, "Manager", managerId); in handleLogServicesDumpEntryDownloadGet()
2294 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in handleDBusEventLogEntryDownloadGet()
2302 asyncResp->res.result(boost::beast::http::status::bad_request); in handleDBusEventLogEntryDownloadGet()
2313 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in handleLogServicesDumpCollectDiagnosticDataPost()
2319 messages::resourceNotFound(asyncResp->res, "Manager", managerId); in handleLogServicesDumpCollectDiagnosticDataPost()
2331 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in handleLogServicesDumpCollectDiagnosticDataComputerSystemPost()
2339 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in handleLogServicesDumpCollectDiagnosticDataComputerSystemPost()
2345 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in handleLogServicesDumpCollectDiagnosticDataComputerSystemPost()
2357 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in handleLogServicesDumpClearLogPost()
2364 messages::resourceNotFound(asyncResp->res, "Manager", managerId); in handleLogServicesDumpClearLogPost()
2375 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in handleLogServicesDumpClearLogComputerSystemPost()
2382 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in handleLogServicesDumpClearLogComputerSystemPost()
2388 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in handleLogServicesDumpClearLogComputerSystemPost()
2397 BMCWEB_ROUTE(app, "/redfish/v1/Managers/<str>/LogServices/Dump/") in requestRoutesBMCDumpService()
2398 .privileges(redfish::privileges::getLogService) in requestRoutesBMCDumpService()
2405 BMCWEB_ROUTE(app, "/redfish/v1/Managers/<str>/LogServices/Dump/Entries/") in requestRoutesBMCDumpEntryCollection()
2406 .privileges(redfish::privileges::getLogEntryCollection) in requestRoutesBMCDumpEntryCollection()
2414 "/redfish/v1/Managers/<str>/LogServices/Dump/Entries/<str>/") in requestRoutesBMCDumpEntry()
2415 .privileges(redfish::privileges::getLogEntry) in requestRoutesBMCDumpEntry()
2420 "/redfish/v1/Managers/<str>/LogServices/Dump/Entries/<str>/") in requestRoutesBMCDumpEntry()
2421 .privileges(redfish::privileges::deleteLogEntry) in requestRoutesBMCDumpEntry()
2430 "/redfish/v1/Managers/<str>/LogServices/Dump/Entries/<str>/attachment/") in requestRoutesBMCDumpEntryDownload()
2431 .privileges(redfish::privileges::getLogEntry) in requestRoutesBMCDumpEntryDownload()
2440 "/redfish/v1/Managers/<str>/LogServices/Dump/Actions/LogService.CollectDiagnosticData/") in requestRoutesBMCDumpCreate()
2441 .privileges(redfish::privileges::postLogService) in requestRoutesBMCDumpCreate()
2451 "/redfish/v1/Managers/<str>/LogServices/Dump/Actions/LogService.ClearLog/") in requestRoutesBMCDumpClear()
2452 .privileges(redfish::privileges::postLogService) in requestRoutesBMCDumpClear()
2461 "/redfish/v1/Systems/<str>/LogServices/EventLog/Entries/<str>/attachment/") in requestRoutesDBusEventLogEntryDownload()
2462 .privileges(redfish::privileges::getLogEntry) in requestRoutesDBusEventLogEntryDownload()
2469 BMCWEB_ROUTE(app, "/redfish/v1/Managers/<str>/LogServices/FaultLog/") in requestRoutesFaultLogDumpService()
2470 .privileges(redfish::privileges::getLogService) in requestRoutesFaultLogDumpService()
2478 "/redfish/v1/Managers/<str>/LogServices/FaultLog/Entries/") in requestRoutesFaultLogDumpEntryCollection()
2479 .privileges(redfish::privileges::getLogEntryCollection) in requestRoutesFaultLogDumpEntryCollection()
2488 app, "/redfish/v1/Managers/<str>/LogServices/FaultLog/Entries/<str>/") in requestRoutesFaultLogDumpEntry()
2489 .privileges(redfish::privileges::getLogEntry) in requestRoutesFaultLogDumpEntry()
2494 app, "/redfish/v1/Managers/<str>/LogServices/FaultLog/Entries/<str>/") in requestRoutesFaultLogDumpEntry()
2495 .privileges(redfish::privileges::deleteLogEntry) in requestRoutesFaultLogDumpEntry()
2504 "/redfish/v1/Managers/<str>/LogServices/FaultLog/Actions/LogService.ClearLog/") in requestRoutesFaultLogDumpClear()
2505 .privileges(redfish::privileges::postLogService) in requestRoutesFaultLogDumpClear()
2512 BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/Dump/") in requestRoutesSystemDumpService()
2513 .privileges(redfish::privileges::getLogService) in requestRoutesSystemDumpService()
2520 BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/Dump/Entries/") in requestRoutesSystemDumpEntryCollection()
2521 .privileges(redfish::privileges::getLogEntryCollection) in requestRoutesSystemDumpEntryCollection()
2530 "/redfish/v1/Systems/<str>/LogServices/Dump/Entries/<str>/") in requestRoutesSystemDumpEntry()
2531 .privileges(redfish::privileges::getLogEntry) in requestRoutesSystemDumpEntry()
2536 "/redfish/v1/Systems/<str>/LogServices/Dump/Entries/<str>/") in requestRoutesSystemDumpEntry()
2537 .privileges(redfish::privileges::deleteLogEntry) in requestRoutesSystemDumpEntry()
2546 "/redfish/v1/Systems/<str>/LogServices/Dump/Actions/LogService.CollectDiagnosticData/") in requestRoutesSystemDumpCreate()
2547 .privileges(redfish::privileges::postLogService) in requestRoutesSystemDumpCreate()
2557 "/redfish/v1/Systems/<str>/LogServices/Dump/Actions/LogService.ClearLog/") in requestRoutesSystemDumpClear()
2558 .privileges(redfish::privileges::postLogService) in requestRoutesSystemDumpClear()
2565 // Note: Deviated from redfish privilege registry for GET & HEAD in requestRoutesCrashdumpService()
2570 BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/Crashdump/") in requestRoutesCrashdumpService()
2572 //.privileges(redfish::privileges::getLogService) in requestRoutesCrashdumpService()
2579 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in requestRoutesCrashdumpService()
2586 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesCrashdumpService()
2592 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesCrashdumpService()
2599 asyncResp->res.jsonValue["@odata.id"] = in requestRoutesCrashdumpService()
2600 std::format("/redfish/v1/Systems/{}/LogServices/Crashdump", in requestRoutesCrashdumpService()
2602 asyncResp->res.jsonValue["@odata.type"] = in requestRoutesCrashdumpService()
2604 asyncResp->res.jsonValue["Name"] = "Open BMC Oem Crashdump Service"; in requestRoutesCrashdumpService()
2605 asyncResp->res.jsonValue["Description"] = "Oem Crashdump Service"; in requestRoutesCrashdumpService()
2606 asyncResp->res.jsonValue["Id"] = "Crashdump"; in requestRoutesCrashdumpService()
2607 asyncResp->res.jsonValue["OverWritePolicy"] = in requestRoutesCrashdumpService()
2609 asyncResp->res.jsonValue["MaxNumberOfRecords"] = 3; in requestRoutesCrashdumpService()
2612 redfish::time_utils::getDateTimeOffsetNow(); in requestRoutesCrashdumpService()
2613 asyncResp->res.jsonValue["DateTime"] = redfishDateTimeOffset.first; in requestRoutesCrashdumpService()
2614 asyncResp->res.jsonValue["DateTimeLocalOffset"] = in requestRoutesCrashdumpService()
2617 asyncResp->res.jsonValue["Entries"]["@odata.id"] = std::format( in requestRoutesCrashdumpService()
2618 "/redfish/v1/Systems/{}/LogServices/Crashdump/Entries", in requestRoutesCrashdumpService()
2620 asyncResp->res.jsonValue["Actions"]["#LogService.ClearLog"] in requestRoutesCrashdumpService()
2622 "/redfish/v1/Systems/{}/LogServices/Crashdump/Actions/LogService.ClearLog", in requestRoutesCrashdumpService()
2624 asyncResp->res in requestRoutesCrashdumpService()
2627 … "/redfish/v1/Systems/{}/LogServices/Crashdump/Actions/LogService.CollectDiagnosticData", in requestRoutesCrashdumpService()
2636 "/redfish/v1/Systems/<str>/LogServices/Crashdump/Actions/LogService.ClearLog/") in requestRoutesCrashdumpClear()
2638 //.privileges(redfish::privileges::postLogService) in requestRoutesCrashdumpClear()
2644 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in requestRoutesCrashdumpClear()
2651 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesCrashdumpClear()
2657 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesCrashdumpClear()
2661 crow::connections::systemBus->async_method_call( in requestRoutesCrashdumpClear()
2666 messages::internalError(asyncResp->res); in requestRoutesCrashdumpClear()
2669 messages::success(asyncResp->res); in requestRoutesCrashdumpClear()
2690 messages::resourceNotFound(asyncResp->res, "LogEntry", in logCrashdumpEntry()
2695 messages::internalError(asyncResp->res); in logCrashdumpEntry()
2707 messages::resourceNotFound(asyncResp->res, "LogEntry", logID); in logCrashdumpEntry()
2713 "/redfish/v1/Systems/{}/LogServices/Crashdump/Entries/", in logCrashdumpEntry()
2719 "/redfish/v1/Systems/{}/LogServices/Crashdump/Entries/{}", in logCrashdumpEntry()
2735 asyncResp->res.jsonValue["Members@odata.count"] = in logCrashdumpEntry()
2750 // Note: Deviated from redfish privilege registry for GET & HEAD in requestRoutesCrashdumpEntryCollection()
2756 "/redfish/v1/Systems/<str>/LogServices/Crashdump/Entries/") in requestRoutesCrashdumpEntryCollection()
2758 //.privileges(redfish::privileges::postLogEntryCollection) in requestRoutesCrashdumpEntryCollection()
2765 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in requestRoutesCrashdumpEntryCollection()
2772 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesCrashdumpEntryCollection()
2778 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesCrashdumpEntryCollection()
2796 messages::internalError(asyncResp->res); in requestRoutesCrashdumpEntryCollection()
2800 asyncResp->res.jsonValue["@odata.type"] = in requestRoutesCrashdumpEntryCollection()
2802 asyncResp->res.jsonValue["@odata.id"] = std::format( in requestRoutesCrashdumpEntryCollection()
2803 "/redfish/v1/Systems/{}/LogServices/Crashdump/Entries", in requestRoutesCrashdumpEntryCollection()
2805 asyncResp->res.jsonValue["Name"] = in requestRoutesCrashdumpEntryCollection()
2807 asyncResp->res.jsonValue["Description"] = in requestRoutesCrashdumpEntryCollection()
2809 asyncResp->res.jsonValue["Members"] = in requestRoutesCrashdumpEntryCollection()
2811 asyncResp->res.jsonValue["Members@odata.count"] = 0; in requestRoutesCrashdumpEntryCollection()
2824 asyncResp->res.jsonValue["Members"]); in requestRoutesCrashdumpEntryCollection()
2832 // Note: Deviated from redfish privilege registry for GET & HEAD in requestRoutesCrashdumpEntry()
2836 app, "/redfish/v1/Systems/<str>/LogServices/Crashdump/Entries/<str>/") in requestRoutesCrashdumpEntry()
2838 // .privileges(redfish::privileges::getLogEntry) in requestRoutesCrashdumpEntry()
2844 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in requestRoutesCrashdumpEntry()
2851 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesCrashdumpEntry()
2857 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesCrashdumpEntry()
2862 logCrashdumpEntry(asyncResp, logID, asyncResp->res.jsonValue); in requestRoutesCrashdumpEntry()
2868 // Note: Deviated from redfish privilege registry for GET & HEAD in requestRoutesCrashdumpFile()
2872 "/redfish/v1/Systems/<str>/LogServices/Crashdump/Entries/<str>/<str>/") in requestRoutesCrashdumpFile()
2873 .privileges(redfish::privileges::getLogEntry) in requestRoutesCrashdumpFile()
2880 // not a Redfish resource. in requestRoutesCrashdumpFile()
2885 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesCrashdumpFile()
2891 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesCrashdumpFile()
2907 messages::internalError(asyncResp->res); in requestRoutesCrashdumpFile()
2921 messages::resourceNotFound(asyncResp->res, in requestRoutesCrashdumpFile()
2929 messages::resourceNotFound(asyncResp->res, in requestRoutesCrashdumpFile()
2934 if (asyncResp->res.openFile(dbusFilepath) != in requestRoutesCrashdumpFile()
2937 messages::resourceNotFound(asyncResp->res, in requestRoutesCrashdumpFile()
2944 asyncResp->res.addHeader( in requestRoutesCrashdumpFile()
2978 // Note: Deviated from redfish privilege registry for GET & HEAD in requestRoutesCrashdumpCollect()
2982 "/redfish/v1/Systems/<str>/LogServices/Crashdump/Actions/LogService.CollectDiagnosticData/") in requestRoutesCrashdumpCollect()
2984 //.privileges(redfish::privileges::postLogService) in requestRoutesCrashdumpCollect()
2990 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in requestRoutesCrashdumpCollect()
2998 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesCrashdumpCollect()
3004 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesCrashdumpCollect()
3011 if (!redfish::json_util::readJsonAction( // in requestRoutesCrashdumpCollect()
3012 req, asyncResp->res, // in requestRoutesCrashdumpCollect()
3024 messages::actionParameterValueFormatError( in requestRoutesCrashdumpCollect()
3025 asyncResp->res, diagnosticDataType, in requestRoutesCrashdumpCollect()
3060 messages::actionParameterValueFormatError( in requestRoutesCrashdumpCollect()
3061 asyncResp->res, oemDiagnosticDataType, in requestRoutesCrashdumpCollect()
3075 messages::resourceInStandby(asyncResp->res); in requestRoutesCrashdumpCollect()
3080 messages::serviceTemporarilyUnavailable( in requestRoutesCrashdumpCollect()
3081 asyncResp->res, "60"); in requestRoutesCrashdumpCollect()
3085 messages::internalError(asyncResp->res); in requestRoutesCrashdumpCollect()
3097 taskData->messages.emplace_back( in requestRoutesCrashdumpCollect()
3098 messages::taskCompletedOK( in requestRoutesCrashdumpCollect()
3100 taskData->index))); in requestRoutesCrashdumpCollect()
3101 taskData->state = "Completed"; in requestRoutesCrashdumpCollect()
3107 task->startTimer(std::chrono::minutes(5)); in requestRoutesCrashdumpCollect()
3108 task->populateResp(asyncResp->res); in requestRoutesCrashdumpCollect()
3109 task->payload.emplace(std::move(payload)); in requestRoutesCrashdumpCollect()
3112 crow::connections::systemBus->async_method_call( in requestRoutesCrashdumpCollect()
3130 asyncResp->res.result( in dBusLogServiceActionsClear()
3135 asyncResp->res.result(boost::beast::http::status::no_content); in dBusLogServiceActionsClear()
3139 crow::connections::systemBus->async_method_call( in dBusLogServiceActionsClear()
3158 "/redfish/v1/Systems/<str>/LogServices/EventLog/Actions/LogService.ClearLog/") in requestRoutesDBusLogServiceActionsClear()
3159 .privileges(redfish::privileges::postLogService) in requestRoutesDBusLogServiceActionsClear()
3164 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in requestRoutesDBusLogServiceActionsClear()
3171 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesDBusLogServiceActionsClear()
3177 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesDBusLogServiceActionsClear()
3185 } // namespace redfish