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" |
Lukasz Kazmierczak | 07148cf | 2021-08-02 11:08:53 +0200 | [diff] [blame] | 47 | #include "../lib/trigger.hpp" |
Jennifer Lee | 729dae7 | 2018-04-24 15:59:34 -0700 | [diff] [blame] | 48 | #include "../lib/update_service.hpp" |
Przemyslaw Czarnowski | 107077d | 2019-07-11 10:16:43 +0200 | [diff] [blame] | 49 | #include "../lib/virtual_media.hpp" |
Borawski.Lukasz | b6df6dc | 2018-01-24 10:20:45 +0100 | [diff] [blame] | 50 | |
Ed Tanous | 1abe55e | 2018-09-05 08:30:59 -0700 | [diff] [blame] | 51 | namespace redfish |
| 52 | { |
Borawski.Lukasz | b6df6dc | 2018-01-24 10:20:45 +0100 | [diff] [blame] | 53 | /* |
| 54 | * @brief Top level class installing and providing Redfish services |
| 55 | */ |
Ed Tanous | 1abe55e | 2018-09-05 08:30:59 -0700 | [diff] [blame] | 56 | class RedfishService |
| 57 | { |
| 58 | public: |
| 59 | /* |
| 60 | * @brief Redfish service constructor |
| 61 | * |
| 62 | * Loads Redfish configuration and installs schema resources |
| 63 | * |
| 64 | * @param[in] app Crow app on which Redfish will initialize |
| 65 | */ |
Ed Tanous | 4e23a44 | 2022-06-06 09:57:26 -0700 | [diff] [blame] | 66 | explicit RedfishService(App& app) |
Ed Tanous | 1abe55e | 2018-09-05 08:30:59 -0700 | [diff] [blame] | 67 | { |
Ed Tanous | 6c51eab | 2021-06-03 12:30:29 -0700 | [diff] [blame] | 68 | requestAccountServiceRoutes(app); |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 69 | requestRoutesRoles(app); |
| 70 | requestRoutesRoleCollection(app); |
| 71 | requestRoutesServiceRoot(app); |
| 72 | requestRoutesNetworkProtocol(app); |
Ed Tanous | faa34cc | 2021-06-03 13:27:02 -0700 | [diff] [blame] | 73 | requestRoutesSession(app); |
Ed Tanous | bf648f7 | 2021-06-03 15:00:14 -0700 | [diff] [blame] | 74 | requestEthernetInterfacesRoutes(app); |
zhanghch05 | 0256b69 | 2021-06-12 10:26:52 +0800 | [diff] [blame] | 75 | #ifdef BMCWEB_ALLOW_DEPRECATED_POWER_THERMAL |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 76 | requestRoutesThermal(app); |
zhanghch05 | 0256b69 | 2021-06-12 10:26:52 +0800 | [diff] [blame] | 77 | requestRoutesPower(app); |
| 78 | #endif |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 79 | requestRoutesManagerCollection(app); |
| 80 | requestRoutesManager(app); |
| 81 | requestRoutesManagerResetAction(app); |
| 82 | requestRoutesManagerResetActionInfo(app); |
| 83 | requestRoutesManagerResetToDefaultsAction(app); |
Sui Chen | a51fc2d | 2022-07-14 17:21:53 -0700 | [diff] [blame] | 84 | requestRoutesManagerDiagnosticData(app); |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 85 | requestRoutesChassisCollection(app); |
| 86 | requestRoutesChassis(app); |
| 87 | requestRoutesChassisResetAction(app); |
| 88 | requestRoutesChassisResetActionInfo(app); |
John Edward Broadbent | 92903bd | 2022-04-26 13:40:59 -0700 | [diff] [blame] | 89 | requestRoutesChassisDrive(app); |
John Edward Broadbent | e56ed6b | 2022-04-26 13:40:59 -0700 | [diff] [blame] | 90 | requestRoutesChassisDriveName(app); |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 91 | requestRoutesUpdateService(app); |
| 92 | requestRoutesStorageCollection(app); |
| 93 | requestRoutesStorage(app); |
| 94 | requestRoutesDrive(app); |
Shantappa Teekappanavar | 9c929be | 2021-12-16 19:02:52 -0600 | [diff] [blame] | 95 | requestRoutesCable(app); |
| 96 | requestRoutesCableCollection(app); |
Andrew Geissler | 0554c98 | 2019-04-23 14:40:12 -0500 | [diff] [blame] | 97 | #ifdef BMCWEB_INSECURE_ENABLE_REDFISH_FW_TFTP_UPDATE |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 98 | requestRoutesUpdateServiceActionsSimpleUpdate(app); |
Andrew Geissler | 0554c98 | 2019-04-23 14:40:12 -0500 | [diff] [blame] | 99 | #endif |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 100 | requestRoutesSoftwareInventoryCollection(app); |
| 101 | requestRoutesSoftwareInventory(app); |
Jason M. Bills | c4bf637 | 2018-11-05 13:48:27 -0800 | [diff] [blame] | 102 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 103 | requestRoutesSystemLogServiceCollection(app); |
| 104 | requestRoutesEventLogService(app); |
George Liu | 647b3cd | 2021-07-05 12:43:56 +0800 | [diff] [blame] | 105 | requestRoutesPostCodesEntryAdditionalData(app); |
ZhikuiRen | a3316fc | 2020-01-29 14:58:08 -0800 | [diff] [blame] | 106 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 107 | requestRoutesPostCodesLogService(app); |
| 108 | requestRoutesPostCodesClear(app); |
| 109 | requestRoutesPostCodesEntry(app); |
| 110 | requestRoutesPostCodesEntryCollection(app); |
ZhikuiRen | a3316fc | 2020-01-29 14:58:08 -0800 | [diff] [blame] | 111 | |
Asmitha Karunanithi | 5cb1dd2 | 2020-05-07 04:35:02 -0500 | [diff] [blame] | 112 | #ifdef BMCWEB_ENABLE_REDFISH_DUMP_LOG |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 113 | requestRoutesSystemDumpService(app); |
| 114 | requestRoutesSystemDumpEntryCollection(app); |
| 115 | requestRoutesSystemDumpEntry(app); |
| 116 | requestRoutesSystemDumpCreate(app); |
| 117 | requestRoutesSystemDumpClear(app); |
Asmitha Karunanithi | 5cb1dd2 | 2020-05-07 04:35:02 -0500 | [diff] [blame] | 118 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 119 | requestRoutesBMCDumpService(app); |
| 120 | requestRoutesBMCDumpEntryCollection(app); |
| 121 | requestRoutesBMCDumpEntry(app); |
| 122 | requestRoutesBMCDumpCreate(app); |
| 123 | requestRoutesBMCDumpClear(app); |
Claire Weinan | fdd2690 | 2022-03-01 14:18:25 -0800 | [diff] [blame] | 124 | |
| 125 | requestRoutesFaultLogDumpService(app); |
| 126 | requestRoutesFaultLogDumpEntryCollection(app); |
| 127 | requestRoutesFaultLogDumpEntry(app); |
| 128 | requestRoutesFaultLogDumpClear(app); |
raviteja-b | c9bb686 | 2020-02-03 11:53:32 -0600 | [diff] [blame] | 129 | #endif |
| 130 | |
Anthony Wilson | 08a4e4b | 2019-04-12 08:23:05 -0500 | [diff] [blame] | 131 | #ifndef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 132 | requestRoutesJournalEventLogEntryCollection(app); |
| 133 | requestRoutesJournalEventLogEntry(app); |
| 134 | requestRoutesJournalEventLogClear(app); |
Anthony Wilson | 08a4e4b | 2019-04-12 08:23:05 -0500 | [diff] [blame] | 135 | #endif |
Jason M. Bills | c4bf637 | 2018-11-05 13:48:27 -0800 | [diff] [blame] | 136 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 137 | requestRoutesBMCLogServiceCollection(app); |
Jason M. Bills | c4bf637 | 2018-11-05 13:48:27 -0800 | [diff] [blame] | 138 | #ifdef BMCWEB_ENABLE_REDFISH_BMC_JOURNAL |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 139 | requestRoutesBMCJournalLogService(app); |
| 140 | requestRoutesBMCJournalLogEntryCollection(app); |
| 141 | requestRoutesBMCJournalLogEntry(app); |
Jason M. Bills | c4bf637 | 2018-11-05 13:48:27 -0800 | [diff] [blame] | 142 | #endif |
Ed Tanous | 1da66f7 | 2018-07-27 16:13:37 -0700 | [diff] [blame] | 143 | |
| 144 | #ifdef BMCWEB_ENABLE_REDFISH_CPU_LOG |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 145 | requestRoutesCrashdumpService(app); |
| 146 | requestRoutesCrashdumpEntryCollection(app); |
| 147 | requestRoutesCrashdumpEntry(app); |
| 148 | requestRoutesCrashdumpFile(app); |
| 149 | requestRoutesCrashdumpClear(app); |
| 150 | requestRoutesCrashdumpCollect(app); |
Ed Tanous | 1da66f7 | 2018-07-27 16:13:37 -0700 | [diff] [blame] | 151 | #endif // BMCWEB_ENABLE_REDFISH_CPU_LOG |
| 152 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 153 | requestRoutesProcessorCollection(app); |
| 154 | requestRoutesProcessor(app); |
| 155 | requestRoutesOperatingConfigCollection(app); |
| 156 | requestRoutesOperatingConfig(app); |
| 157 | requestRoutesMemoryCollection(app); |
| 158 | requestRoutesMemory(app); |
Rapkiewicz, Pawel | 443c293 | 2018-10-22 15:08:49 +0200 | [diff] [blame] | 159 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 160 | requestRoutesSystemsCollection(app); |
| 161 | requestRoutesSystems(app); |
| 162 | requestRoutesSystemActionsReset(app); |
| 163 | requestRoutesSystemResetActionInfo(app); |
| 164 | requestRoutesBiosService(app); |
| 165 | requestRoutesBiosReset(app); |
Ed Tanous | 22db172 | 2021-06-09 10:53:51 -0700 | [diff] [blame] | 166 | |
Przemyslaw Czarnowski | 107077d | 2019-07-11 10:16:43 +0200 | [diff] [blame] | 167 | #ifdef BMCWEB_ENABLE_VM_NBDPROXY |
Ed Tanous | 22db172 | 2021-06-09 10:53:51 -0700 | [diff] [blame] | 168 | requestNBDVirtualMediaRoutes(app); |
Przemyslaw Czarnowski | 107077d | 2019-07-11 10:16:43 +0200 | [diff] [blame] | 169 | #endif // BMCWEB_ENABLE_VM_NBDPROXY |
Ed Tanous | 22db172 | 2021-06-09 10:53:51 -0700 | [diff] [blame] | 170 | |
Andrew Geissler | cb92c03 | 2018-08-17 07:56:14 -0700 | [diff] [blame] | 171 | #ifdef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 172 | requestRoutesDBusLogServiceActionsClear(app); |
| 173 | requestRoutesDBusEventLogEntryCollection(app); |
| 174 | requestRoutesDBusEventLogEntry(app); |
| 175 | requestRoutesDBusEventLogEntryDownload(app); |
Andrew Geissler | cb92c03 | 2018-08-17 07:56:14 -0700 | [diff] [blame] | 176 | #endif |
Tanous | f00032d | 2018-11-05 01:18:10 -0300 | [diff] [blame] | 177 | |
Spencer Ku | b7028eb | 2021-10-26 15:27:35 +0800 | [diff] [blame] | 178 | #ifdef BMCWEB_ENABLE_REDFISH_HOST_LOGGER |
| 179 | requestRoutesSystemHostLogger(app); |
| 180 | requestRoutesSystemHostLoggerCollection(app); |
| 181 | requestRoutesSystemHostLoggerLogEntry(app); |
| 182 | #endif |
| 183 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 184 | requestRoutesMessageRegistryFileCollection(app); |
| 185 | requestRoutesMessageRegistryFile(app); |
| 186 | requestRoutesMessageRegistry(app); |
Anthony Wilson | 95a3eca | 2019-06-11 10:44:47 -0500 | [diff] [blame] | 187 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 188 | requestRoutesCertificateService(app); |
| 189 | requestRoutesCertificateActionGenerateCSR(app); |
| 190 | requestRoutesCertificateActionsReplaceCertificate(app); |
| 191 | requestRoutesHTTPSCertificate(app); |
| 192 | requestRoutesHTTPSCertificateCollection(app); |
| 193 | requestRoutesCertificateLocations(app); |
| 194 | requestRoutesLDAPCertificateCollection(app); |
| 195 | requestRoutesLDAPCertificate(app); |
| 196 | requestRoutesTrustStoreCertificateCollection(app); |
| 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 |