blob: 9162bffcda5568aee218cc2cce470e291cadec24 [file] [log] [blame]
Ed Tanous40e9b922024-09-10 13:50:16 -07001// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright OpenBMC Authors
Ed Tanous3cd70722024-04-06 09:24:01 -07003#include "redfish.hpp"
4
Ed Tanous5b904292024-04-16 11:10:17 -07005#include "bmcweb_config.h"
6
Ed Tanous3cd70722024-04-06 09:24:01 -07007#include "account_service.hpp"
8#include "aggregation_service.hpp"
9#include "app.hpp"
10#include "bios.hpp"
11#include "cable.hpp"
12#include "certificate_service.hpp"
13#include "chassis.hpp"
14#include "environment_metrics.hpp"
15#include "ethernet.hpp"
16#include "event_service.hpp"
17#include "eventservice_sse.hpp"
18#include "fabric_adapters.hpp"
19#include "fan.hpp"
20#include "hypervisor_system.hpp"
21#include "log_services.hpp"
22#include "manager_diagnostic_data.hpp"
Ed Tanousb0983db2024-07-17 11:37:25 -070023#include "manager_logservices_journal.hpp"
Ed Tanous3cd70722024-04-06 09:24:01 -070024#include "managers.hpp"
25#include "memory.hpp"
26#include "message_registries.hpp"
Ed Tanous090ab8e2024-05-18 16:07:23 -070027#include "metadata.hpp"
Ed Tanous3cd70722024-04-06 09:24:01 -070028#include "metric_report.hpp"
29#include "metric_report_definition.hpp"
30#include "network_protocol.hpp"
Ed Tanousd5c01722024-06-16 12:10:33 -070031#include "odata.hpp"
rohitpaic1a75eb2025-01-03 19:13:36 +053032#include "openbmc/openbmc_managers.hpp"
Ed Tanous3cd70722024-04-06 09:24:01 -070033#include "pcie.hpp"
Ed Tanous3cd70722024-04-06 09:24:01 -070034#include "power.hpp"
35#include "power_subsystem.hpp"
36#include "power_supply.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"
Ed Tanouse21126e2024-09-03 17:32:00 -070045#include "systems_logservices_hostlogger.hpp"
Ed Tanous8d2f8682024-09-03 17:03:29 -070046#include "systems_logservices_postcodes.hpp"
Ed Tanous3cd70722024-04-06 09:24:01 -070047#include "task.hpp"
48#include "telemetry_service.hpp"
49#include "thermal.hpp"
50#include "thermal_metrics.hpp"
51#include "thermal_subsystem.hpp"
52#include "trigger.hpp"
53#include "update_service.hpp"
54#include "virtual_media.hpp"
55
56namespace redfish
57{
58
59RedfishService::RedfishService(App& app)
60{
Ed Tanous090ab8e2024-05-18 16:07:23 -070061 requestRoutesMetadata(app);
Ed Tanousd5c01722024-06-16 12:10:33 -070062 requestRoutesOdata(app);
Ed Tanous090ab8e2024-05-18 16:07:23 -070063
Ed Tanous3cd70722024-04-06 09:24:01 -070064 requestAccountServiceRoutes(app);
Ed Tanous25b54db2024-04-17 15:40:31 -070065 if constexpr (BMCWEB_REDFISH_AGGREGATION)
66 {
67 requestRoutesAggregationService(app);
68 requestRoutesAggregationSourceCollection(app);
69 requestRoutesAggregationSource(app);
70 }
Ed Tanous3cd70722024-04-06 09:24:01 -070071 requestRoutesRoles(app);
72 requestRoutesRoleCollection(app);
73 requestRoutesServiceRoot(app);
74 requestRoutesNetworkProtocol(app);
75 requestRoutesSession(app);
76 requestEthernetInterfacesRoutes(app);
Ed Tanous25b54db2024-04-17 15:40:31 -070077 if constexpr (BMCWEB_REDFISH_ALLOW_DEPRECATED_POWER_THERMAL)
78 {
79 requestRoutesThermal(app);
80 requestRoutesPower(app);
81 }
82 if constexpr (BMCWEB_REDFISH_NEW_POWERSUBSYSTEM_THERMALSUBSYSTEM)
83 {
84 requestRoutesEnvironmentMetrics(app);
85 requestRoutesPowerSubsystem(app);
86 requestRoutesPowerSupply(app);
87 requestRoutesPowerSupplyCollection(app);
88 requestRoutesThermalMetrics(app);
89 requestRoutesThermalSubsystem(app);
90 requestRoutesFan(app);
91 requestRoutesFanCollection(app);
92 }
Ed Tanous3cd70722024-04-06 09:24:01 -070093 requestRoutesManager(app);
94 requestRoutesManagerResetAction(app);
Ed Tanous3cd70722024-04-06 09:24:01 -070095 requestRoutesManagerDiagnosticData(app);
96 requestRoutesChassisCollection(app);
97 requestRoutesChassis(app);
98 requestRoutesChassisResetAction(app);
99 requestRoutesChassisResetActionInfo(app);
100 requestRoutesChassisDrive(app);
101 requestRoutesChassisDriveName(app);
102 requestRoutesUpdateService(app);
103 requestRoutesStorageCollection(app);
104 requestRoutesStorage(app);
105 requestRoutesStorageControllerCollection(app);
106 requestRoutesStorageController(app);
107 requestRoutesDrive(app);
108 requestRoutesCable(app);
109 requestRoutesCableCollection(app);
Ed Tanous3cd70722024-04-06 09:24:01 -0700110
111 requestRoutesSystemLogServiceCollection(app);
112 requestRoutesEventLogService(app);
Ed Tanous3cd70722024-04-06 09:24:01 -0700113
Ed Tanous8d2f8682024-09-03 17:03:29 -0700114 requestRoutesSystemsLogServicesPostCode(app);
Ed Tanous3cd70722024-04-06 09:24:01 -0700115
Ed Tanous25b54db2024-04-17 15:40:31 -0700116 if constexpr (BMCWEB_REDFISH_DUMP_LOG)
117 {
118 requestRoutesSystemDumpService(app);
119 requestRoutesSystemDumpEntryCollection(app);
120 requestRoutesSystemDumpEntry(app);
121 requestRoutesSystemDumpCreate(app);
122 requestRoutesSystemDumpClear(app);
Ed Tanous3cd70722024-04-06 09:24:01 -0700123
Ed Tanous25b54db2024-04-17 15:40:31 -0700124 requestRoutesBMCDumpService(app);
125 requestRoutesBMCDumpEntryCollection(app);
126 requestRoutesBMCDumpEntry(app);
127 requestRoutesBMCDumpEntryDownload(app);
128 requestRoutesBMCDumpCreate(app);
129 requestRoutesBMCDumpClear(app);
Ed Tanous3cd70722024-04-06 09:24:01 -0700130
Ed Tanous25b54db2024-04-17 15:40:31 -0700131 requestRoutesFaultLogDumpService(app);
132 requestRoutesFaultLogDumpEntryCollection(app);
133 requestRoutesFaultLogDumpEntry(app);
134 requestRoutesFaultLogDumpClear(app);
135 }
Ed Tanous3cd70722024-04-06 09:24:01 -0700136
Ed Tanous3cd70722024-04-06 09:24:01 -0700137 requestRoutesBMCLogServiceCollection(app);
Ed Tanous84177a22024-07-17 11:48:55 -0700138
Ed Tanous25b54db2024-04-17 15:40:31 -0700139 if constexpr (BMCWEB_REDFISH_BMC_JOURNAL)
140 {
141 requestRoutesBMCJournalLogService(app);
Ed Tanous25b54db2024-04-17 15:40:31 -0700142 }
Ed Tanous3cd70722024-04-06 09:24:01 -0700143
Ed Tanous25b54db2024-04-17 15:40:31 -0700144 if constexpr (BMCWEB_REDFISH_CPU_LOG)
145 {
146 requestRoutesCrashdumpService(app);
147 requestRoutesCrashdumpEntryCollection(app);
148 requestRoutesCrashdumpEntry(app);
149 requestRoutesCrashdumpFile(app);
150 requestRoutesCrashdumpClear(app);
151 requestRoutesCrashdumpCollect(app);
152 }
Ed Tanous3cd70722024-04-06 09:24:01 -0700153
154 requestRoutesProcessorCollection(app);
155 requestRoutesProcessor(app);
156 requestRoutesOperatingConfigCollection(app);
157 requestRoutesOperatingConfig(app);
158 requestRoutesMemoryCollection(app);
159 requestRoutesMemory(app);
160
161 requestRoutesSystems(app);
162
163 requestRoutesBiosService(app);
164 requestRoutesBiosReset(app);
165
Ed Tanous25b54db2024-04-17 15:40:31 -0700166 if constexpr (BMCWEB_VM_NBDPROXY)
167 {
168 requestNBDVirtualMediaRoutes(app);
169 }
Ed Tanous3cd70722024-04-06 09:24:01 -0700170
Ed Tanous25b54db2024-04-17 15:40:31 -0700171 if constexpr (BMCWEB_REDFISH_DBUS_LOG)
172 {
173 requestRoutesDBusLogServiceActionsClear(app);
174 requestRoutesDBusEventLogEntryCollection(app);
175 requestRoutesDBusEventLogEntry(app);
176 requestRoutesDBusEventLogEntryDownload(app);
177 }
Alexander Hansena782e262024-08-12 14:04:06 +0200178 else
179 {
180 requestRoutesJournalEventLogEntryCollection(app);
181 requestRoutesJournalEventLogEntry(app);
182 requestRoutesJournalEventLogClear(app);
183 }
Ed Tanous3cd70722024-04-06 09:24:01 -0700184
Ed Tanous25b54db2024-04-17 15:40:31 -0700185 if constexpr (BMCWEB_REDFISH_HOST_LOGGER)
186 {
Ed Tanouse21126e2024-09-03 17:32:00 -0700187 requestRoutesSystemsLogServiceHostlogger(app);
Ed Tanous25b54db2024-04-17 15:40:31 -0700188 }
Ed Tanous3cd70722024-04-06 09:24:01 -0700189
190 requestRoutesMessageRegistryFileCollection(app);
191 requestRoutesMessageRegistryFile(app);
192 requestRoutesMessageRegistry(app);
193
194 requestRoutesCertificateService(app);
195 requestRoutesHTTPSCertificate(app);
196 requestRoutesLDAPCertificate(app);
197 requestRoutesTrustStoreCertificate(app);
198
199 requestRoutesSystemPCIeFunctionCollection(app);
200 requestRoutesSystemPCIeFunction(app);
201 requestRoutesSystemPCIeDeviceCollection(app);
202 requestRoutesSystemPCIeDevice(app);
203
204 requestRoutesSensorCollection(app);
205 requestRoutesSensor(app);
206
207 requestRoutesTaskMonitor(app);
208 requestRoutesTaskService(app);
209 requestRoutesTaskCollection(app);
210 requestRoutesTask(app);
211 requestRoutesEventService(app);
212 requestRoutesEventServiceSse(app);
213 requestRoutesEventDestinationCollection(app);
214 requestRoutesEventDestination(app);
215 requestRoutesFabricAdapters(app);
216 requestRoutesFabricAdapterCollection(app);
217 requestRoutesSubmitTestEvent(app);
218
Gunnar Mills68896202024-08-21 11:34:20 -0500219 if constexpr (BMCWEB_HYPERVISOR_COMPUTER_SYSTEM)
220 {
221 requestRoutesHypervisorSystems(app);
222 }
Ed Tanous3cd70722024-04-06 09:24:01 -0700223
224 requestRoutesTelemetryService(app);
225 requestRoutesMetricReportDefinitionCollection(app);
226 requestRoutesMetricReportDefinition(app);
227 requestRoutesMetricReportCollection(app);
228 requestRoutesMetricReport(app);
229 requestRoutesTriggerCollection(app);
230 requestRoutesTrigger(app);
231
232 // Note, this must be the last route registered
233 requestRoutesRedfish(app);
rohitpaic1a75eb2025-01-03 19:13:36 +0530234
235 requestRoutesOpenBmcManager(*this);
236
237 validate();
Ed Tanous3cd70722024-04-06 09:24:01 -0700238}
239
240} // namespace redfish