Borawski.Lukasz | b6df6dc | 2018-01-24 10:20:45 +0100 | [diff] [blame] | 1 | /* |
Jason M. Bills | 70304cb | 2019-03-27 12:03:59 -0700 | [diff] [blame] | 2 | // Copyright (c) 2018-2019 Intel Corporation |
Borawski.Lukasz | b6df6dc | 2018-01-24 10:20:45 +0100 | [diff] [blame] | 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | */ |
| 16 | #pragma once |
| 17 | |
Nan Zhou | 4e7efda | 2022-10-25 21:12:32 +0000 | [diff] [blame^] | 18 | #include "account_service.hpp" |
| 19 | #include "bios.hpp" |
| 20 | #include "cable.hpp" |
| 21 | #include "certificate_service.hpp" |
| 22 | #include "chassis.hpp" |
| 23 | #include "ethernet.hpp" |
| 24 | #include "event_service.hpp" |
| 25 | #include "hypervisor_system.hpp" |
| 26 | #include "log_services.hpp" |
| 27 | #include "manager_diagnostic_data.hpp" |
| 28 | #include "managers.hpp" |
| 29 | #include "memory.hpp" |
| 30 | #include "message_registries.hpp" |
| 31 | #include "metric_report.hpp" |
| 32 | #include "metric_report_definition.hpp" |
| 33 | #include "network_protocol.hpp" |
| 34 | #include "pcie.hpp" |
| 35 | #include "power.hpp" |
| 36 | #include "power_subsystem.hpp" |
| 37 | #include "processor.hpp" |
| 38 | #include "redfish_sessions.hpp" |
| 39 | #include "redfish_v1.hpp" |
| 40 | #include "roles.hpp" |
| 41 | #include "sensors.hpp" |
| 42 | #include "service_root.hpp" |
| 43 | #include "storage.hpp" |
| 44 | #include "systems.hpp" |
| 45 | #include "task.hpp" |
| 46 | #include "telemetry_service.hpp" |
| 47 | #include "thermal.hpp" |
| 48 | #include "thermal_subsystem.hpp" |
| 49 | #include "trigger.hpp" |
| 50 | #include "update_service.hpp" |
| 51 | #include "virtual_media.hpp" |
Borawski.Lukasz | b6df6dc | 2018-01-24 10:20:45 +0100 | [diff] [blame] | 52 | |
Ed Tanous | 1abe55e | 2018-09-05 08:30:59 -0700 | [diff] [blame] | 53 | namespace redfish |
| 54 | { |
Borawski.Lukasz | b6df6dc | 2018-01-24 10:20:45 +0100 | [diff] [blame] | 55 | /* |
| 56 | * @brief Top level class installing and providing Redfish services |
| 57 | */ |
Ed Tanous | 1abe55e | 2018-09-05 08:30:59 -0700 | [diff] [blame] | 58 | class RedfishService |
| 59 | { |
| 60 | public: |
| 61 | /* |
| 62 | * @brief Redfish service constructor |
| 63 | * |
| 64 | * Loads Redfish configuration and installs schema resources |
| 65 | * |
| 66 | * @param[in] app Crow app on which Redfish will initialize |
| 67 | */ |
Ed Tanous | 4e23a44 | 2022-06-06 09:57:26 -0700 | [diff] [blame] | 68 | explicit RedfishService(App& app) |
Ed Tanous | 1abe55e | 2018-09-05 08:30:59 -0700 | [diff] [blame] | 69 | { |
Ed Tanous | 6c51eab | 2021-06-03 12:30:29 -0700 | [diff] [blame] | 70 | requestAccountServiceRoutes(app); |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 71 | requestRoutesRoles(app); |
| 72 | requestRoutesRoleCollection(app); |
| 73 | requestRoutesServiceRoot(app); |
| 74 | requestRoutesNetworkProtocol(app); |
Ed Tanous | faa34cc | 2021-06-03 13:27:02 -0700 | [diff] [blame] | 75 | requestRoutesSession(app); |
Ed Tanous | bf648f7 | 2021-06-03 15:00:14 -0700 | [diff] [blame] | 76 | requestEthernetInterfacesRoutes(app); |
zhanghch05 | 0256b69 | 2021-06-12 10:26:52 +0800 | [diff] [blame] | 77 | #ifdef BMCWEB_ALLOW_DEPRECATED_POWER_THERMAL |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 78 | requestRoutesThermal(app); |
zhanghch05 | 0256b69 | 2021-06-12 10:26:52 +0800 | [diff] [blame] | 79 | requestRoutesPower(app); |
| 80 | #endif |
Xiaochao Ma | 2973963 | 2021-03-02 15:53:13 +0800 | [diff] [blame] | 81 | #ifdef BMCWEB_NEW_POWERSUBSYSTEM_THERMALSUBSYSTEM |
Chicago Duan | 77b3643 | 2021-02-05 15:48:26 +0800 | [diff] [blame] | 82 | requestRoutesPowerSubsystem(app); |
Xiaochao Ma | 2973963 | 2021-03-02 15:53:13 +0800 | [diff] [blame] | 83 | requestRoutesThermalSubsystem(app); |
| 84 | #endif |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 85 | requestRoutesManagerCollection(app); |
| 86 | requestRoutesManager(app); |
| 87 | requestRoutesManagerResetAction(app); |
| 88 | requestRoutesManagerResetActionInfo(app); |
| 89 | requestRoutesManagerResetToDefaultsAction(app); |
Sui Chen | a51fc2d | 2022-07-14 17:21:53 -0700 | [diff] [blame] | 90 | requestRoutesManagerDiagnosticData(app); |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 91 | requestRoutesChassisCollection(app); |
| 92 | requestRoutesChassis(app); |
| 93 | requestRoutesChassisResetAction(app); |
| 94 | requestRoutesChassisResetActionInfo(app); |
John Edward Broadbent | 92903bd | 2022-04-26 13:40:59 -0700 | [diff] [blame] | 95 | requestRoutesChassisDrive(app); |
John Edward Broadbent | e56ed6b | 2022-04-26 13:40:59 -0700 | [diff] [blame] | 96 | requestRoutesChassisDriveName(app); |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 97 | requestRoutesUpdateService(app); |
| 98 | requestRoutesStorageCollection(app); |
| 99 | requestRoutesStorage(app); |
| 100 | requestRoutesDrive(app); |
Shantappa Teekappanavar | 9c929be | 2021-12-16 19:02:52 -0600 | [diff] [blame] | 101 | requestRoutesCable(app); |
| 102 | requestRoutesCableCollection(app); |
Andrew Geissler | 0554c98 | 2019-04-23 14:40:12 -0500 | [diff] [blame] | 103 | #ifdef BMCWEB_INSECURE_ENABLE_REDFISH_FW_TFTP_UPDATE |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 104 | requestRoutesUpdateServiceActionsSimpleUpdate(app); |
Andrew Geissler | 0554c98 | 2019-04-23 14:40:12 -0500 | [diff] [blame] | 105 | #endif |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 106 | requestRoutesSoftwareInventoryCollection(app); |
| 107 | requestRoutesSoftwareInventory(app); |
Jason M. Bills | c4bf637 | 2018-11-05 13:48:27 -0800 | [diff] [blame] | 108 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 109 | requestRoutesSystemLogServiceCollection(app); |
| 110 | requestRoutesEventLogService(app); |
George Liu | 647b3cd | 2021-07-05 12:43:56 +0800 | [diff] [blame] | 111 | requestRoutesPostCodesEntryAdditionalData(app); |
ZhikuiRen | a3316fc | 2020-01-29 14:58:08 -0800 | [diff] [blame] | 112 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 113 | requestRoutesPostCodesLogService(app); |
| 114 | requestRoutesPostCodesClear(app); |
| 115 | requestRoutesPostCodesEntry(app); |
| 116 | requestRoutesPostCodesEntryCollection(app); |
ZhikuiRen | a3316fc | 2020-01-29 14:58:08 -0800 | [diff] [blame] | 117 | |
Asmitha Karunanithi | 5cb1dd2 | 2020-05-07 04:35:02 -0500 | [diff] [blame] | 118 | #ifdef BMCWEB_ENABLE_REDFISH_DUMP_LOG |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 119 | requestRoutesSystemDumpService(app); |
| 120 | requestRoutesSystemDumpEntryCollection(app); |
| 121 | requestRoutesSystemDumpEntry(app); |
| 122 | requestRoutesSystemDumpCreate(app); |
| 123 | requestRoutesSystemDumpClear(app); |
Asmitha Karunanithi | 5cb1dd2 | 2020-05-07 04:35:02 -0500 | [diff] [blame] | 124 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 125 | requestRoutesBMCDumpService(app); |
| 126 | requestRoutesBMCDumpEntryCollection(app); |
| 127 | requestRoutesBMCDumpEntry(app); |
| 128 | requestRoutesBMCDumpCreate(app); |
| 129 | requestRoutesBMCDumpClear(app); |
Claire Weinan | fdd2690 | 2022-03-01 14:18:25 -0800 | [diff] [blame] | 130 | |
| 131 | requestRoutesFaultLogDumpService(app); |
| 132 | requestRoutesFaultLogDumpEntryCollection(app); |
| 133 | requestRoutesFaultLogDumpEntry(app); |
| 134 | requestRoutesFaultLogDumpClear(app); |
raviteja-b | c9bb686 | 2020-02-03 11:53:32 -0600 | [diff] [blame] | 135 | #endif |
| 136 | |
Anthony Wilson | 08a4e4b | 2019-04-12 08:23:05 -0500 | [diff] [blame] | 137 | #ifndef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 138 | requestRoutesJournalEventLogEntryCollection(app); |
| 139 | requestRoutesJournalEventLogEntry(app); |
| 140 | requestRoutesJournalEventLogClear(app); |
Anthony Wilson | 08a4e4b | 2019-04-12 08:23:05 -0500 | [diff] [blame] | 141 | #endif |
Jason M. Bills | c4bf637 | 2018-11-05 13:48:27 -0800 | [diff] [blame] | 142 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 143 | requestRoutesBMCLogServiceCollection(app); |
Jason M. Bills | c4bf637 | 2018-11-05 13:48:27 -0800 | [diff] [blame] | 144 | #ifdef BMCWEB_ENABLE_REDFISH_BMC_JOURNAL |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 145 | requestRoutesBMCJournalLogService(app); |
| 146 | requestRoutesBMCJournalLogEntryCollection(app); |
| 147 | requestRoutesBMCJournalLogEntry(app); |
Jason M. Bills | c4bf637 | 2018-11-05 13:48:27 -0800 | [diff] [blame] | 148 | #endif |
Ed Tanous | 1da66f7 | 2018-07-27 16:13:37 -0700 | [diff] [blame] | 149 | |
| 150 | #ifdef BMCWEB_ENABLE_REDFISH_CPU_LOG |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 151 | requestRoutesCrashdumpService(app); |
| 152 | requestRoutesCrashdumpEntryCollection(app); |
| 153 | requestRoutesCrashdumpEntry(app); |
| 154 | requestRoutesCrashdumpFile(app); |
| 155 | requestRoutesCrashdumpClear(app); |
| 156 | requestRoutesCrashdumpCollect(app); |
Ed Tanous | 1da66f7 | 2018-07-27 16:13:37 -0700 | [diff] [blame] | 157 | #endif // BMCWEB_ENABLE_REDFISH_CPU_LOG |
| 158 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 159 | requestRoutesProcessorCollection(app); |
| 160 | requestRoutesProcessor(app); |
| 161 | requestRoutesOperatingConfigCollection(app); |
| 162 | requestRoutesOperatingConfig(app); |
| 163 | requestRoutesMemoryCollection(app); |
| 164 | requestRoutesMemory(app); |
Rapkiewicz, Pawel | 443c293 | 2018-10-22 15:08:49 +0200 | [diff] [blame] | 165 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 166 | requestRoutesSystemsCollection(app); |
| 167 | requestRoutesSystems(app); |
| 168 | requestRoutesSystemActionsReset(app); |
| 169 | requestRoutesSystemResetActionInfo(app); |
| 170 | requestRoutesBiosService(app); |
| 171 | requestRoutesBiosReset(app); |
Ed Tanous | 22db172 | 2021-06-09 10:53:51 -0700 | [diff] [blame] | 172 | |
Przemyslaw Czarnowski | 107077d | 2019-07-11 10:16:43 +0200 | [diff] [blame] | 173 | #ifdef BMCWEB_ENABLE_VM_NBDPROXY |
Ed Tanous | 22db172 | 2021-06-09 10:53:51 -0700 | [diff] [blame] | 174 | requestNBDVirtualMediaRoutes(app); |
Przemyslaw Czarnowski | 107077d | 2019-07-11 10:16:43 +0200 | [diff] [blame] | 175 | #endif // BMCWEB_ENABLE_VM_NBDPROXY |
Ed Tanous | 22db172 | 2021-06-09 10:53:51 -0700 | [diff] [blame] | 176 | |
Andrew Geissler | cb92c03 | 2018-08-17 07:56:14 -0700 | [diff] [blame] | 177 | #ifdef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 178 | requestRoutesDBusLogServiceActionsClear(app); |
| 179 | requestRoutesDBusEventLogEntryCollection(app); |
| 180 | requestRoutesDBusEventLogEntry(app); |
| 181 | requestRoutesDBusEventLogEntryDownload(app); |
Andrew Geissler | cb92c03 | 2018-08-17 07:56:14 -0700 | [diff] [blame] | 182 | #endif |
Tanous | f00032d | 2018-11-05 01:18:10 -0300 | [diff] [blame] | 183 | |
Spencer Ku | b7028eb | 2021-10-26 15:27:35 +0800 | [diff] [blame] | 184 | #ifdef BMCWEB_ENABLE_REDFISH_HOST_LOGGER |
| 185 | requestRoutesSystemHostLogger(app); |
| 186 | requestRoutesSystemHostLoggerCollection(app); |
| 187 | requestRoutesSystemHostLoggerLogEntry(app); |
| 188 | #endif |
| 189 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 190 | requestRoutesMessageRegistryFileCollection(app); |
| 191 | requestRoutesMessageRegistryFile(app); |
| 192 | requestRoutesMessageRegistry(app); |
Anthony Wilson | 95a3eca | 2019-06-11 10:44:47 -0500 | [diff] [blame] | 193 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 194 | requestRoutesCertificateService(app); |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 195 | requestRoutesHTTPSCertificate(app); |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 196 | requestRoutesLDAPCertificate(app); |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 197 | requestRoutesTrustStoreCertificate(app); |
Sunitha Harish | 462023a | 2020-02-19 08:34:59 -0600 | [diff] [blame] | 198 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 199 | requestRoutesSystemPCIeFunctionCollection(app); |
| 200 | requestRoutesSystemPCIeFunction(app); |
| 201 | requestRoutesSystemPCIeDeviceCollection(app); |
| 202 | requestRoutesSystemPCIeDevice(app); |
Sunitha Harish | 462023a | 2020-02-19 08:34:59 -0600 | [diff] [blame] | 203 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 204 | requestRoutesSensorCollection(app); |
| 205 | requestRoutesSensor(app); |
Sunitha Harish | 462023a | 2020-02-19 08:34:59 -0600 | [diff] [blame] | 206 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 207 | requestRoutesTaskMonitor(app); |
| 208 | requestRoutesTaskService(app); |
| 209 | requestRoutesTaskCollection(app); |
| 210 | requestRoutesTask(app); |
| 211 | requestRoutesEventService(app); |
| 212 | requestRoutesEventDestinationCollection(app); |
| 213 | requestRoutesEventDestination(app); |
| 214 | requestRoutesSubmitTestEvent(app); |
| 215 | |
Ed Tanous | b898395 | 2021-06-03 14:55:44 -0700 | [diff] [blame] | 216 | hypervisor::requestRoutesHypervisorSystems(app); |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 217 | |
| 218 | requestRoutesTelemetryService(app); |
| 219 | requestRoutesMetricReportDefinitionCollection(app); |
| 220 | requestRoutesMetricReportDefinition(app); |
| 221 | requestRoutesMetricReportCollection(app); |
| 222 | requestRoutesMetricReport(app); |
Lukasz Kazmierczak | 07148cf | 2021-08-02 11:08:53 +0200 | [diff] [blame] | 223 | requestRoutesTriggerCollection(app); |
Lukasz Kazmierczak | 1b7e696 | 2021-08-02 13:40:27 +0200 | [diff] [blame] | 224 | requestRoutesTrigger(app); |
Ed Tanous | f65fca6 | 2022-05-24 12:49:41 -0700 | [diff] [blame] | 225 | |
Ed Tanous | 8c623a9 | 2022-05-24 11:54:51 -0700 | [diff] [blame] | 226 | // Note, this must be the last route registered |
Ed Tanous | f65fca6 | 2022-05-24 12:49:41 -0700 | [diff] [blame] | 227 | requestRoutesRedfish(app); |
Borawski.Lukasz | c1a46bd | 2018-02-08 13:31:59 +0100 | [diff] [blame] | 228 | } |
Borawski.Lukasz | b6df6dc | 2018-01-24 10:20:45 +0100 | [diff] [blame] | 229 | }; |
| 230 | |
Ed Tanous | 1abe55e | 2018-09-05 08:30:59 -0700 | [diff] [blame] | 231 | } // namespace redfish |