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