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