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