blob: e81691f7a73aac39cc83273a4431f68690681643 [file] [log] [blame]
Ed Tanous3cd70722024-04-06 09:24:01 -07001#include "redfish.hpp"
2
Ed Tanous5b904292024-04-16 11:10:17 -07003#include "bmcweb_config.h"
4
Ed Tanous3cd70722024-04-06 09:24:01 -07005#include "account_service.hpp"
6#include "aggregation_service.hpp"
7#include "app.hpp"
8#include "bios.hpp"
9#include "cable.hpp"
10#include "certificate_service.hpp"
11#include "chassis.hpp"
12#include "environment_metrics.hpp"
13#include "ethernet.hpp"
14#include "event_service.hpp"
15#include "eventservice_sse.hpp"
16#include "fabric_adapters.hpp"
17#include "fan.hpp"
18#include "hypervisor_system.hpp"
19#include "log_services.hpp"
20#include "manager_diagnostic_data.hpp"
Ed Tanousb0983db2024-07-17 11:37:25 -070021#include "manager_logservices_journal.hpp"
Ed Tanous3cd70722024-04-06 09:24:01 -070022#include "managers.hpp"
23#include "memory.hpp"
24#include "message_registries.hpp"
Ed Tanous090ab8e2024-05-18 16:07:23 -070025#include "metadata.hpp"
Ed Tanous3cd70722024-04-06 09:24:01 -070026#include "metric_report.hpp"
27#include "metric_report_definition.hpp"
28#include "network_protocol.hpp"
Ed Tanousd5c01722024-06-16 12:10:33 -070029#include "odata.hpp"
Ed Tanous3cd70722024-04-06 09:24:01 -070030#include "pcie.hpp"
Ed Tanous3cd70722024-04-06 09:24:01 -070031#include "power.hpp"
32#include "power_subsystem.hpp"
33#include "power_supply.hpp"
34#include "processor.hpp"
35#include "redfish_sessions.hpp"
36#include "redfish_v1.hpp"
37#include "roles.hpp"
38#include "sensors.hpp"
39#include "service_root.hpp"
40#include "storage.hpp"
41#include "systems.hpp"
42#include "task.hpp"
43#include "telemetry_service.hpp"
44#include "thermal.hpp"
45#include "thermal_metrics.hpp"
46#include "thermal_subsystem.hpp"
47#include "trigger.hpp"
48#include "update_service.hpp"
49#include "virtual_media.hpp"
50
51namespace redfish
52{
53
54RedfishService::RedfishService(App& app)
55{
Ed Tanous090ab8e2024-05-18 16:07:23 -070056 requestRoutesMetadata(app);
Ed Tanousd5c01722024-06-16 12:10:33 -070057 requestRoutesOdata(app);
Ed Tanous090ab8e2024-05-18 16:07:23 -070058
Ed Tanous3cd70722024-04-06 09:24:01 -070059 requestAccountServiceRoutes(app);
Ed Tanous25b54db2024-04-17 15:40:31 -070060 if constexpr (BMCWEB_REDFISH_AGGREGATION)
61 {
62 requestRoutesAggregationService(app);
63 requestRoutesAggregationSourceCollection(app);
64 requestRoutesAggregationSource(app);
65 }
Ed Tanous3cd70722024-04-06 09:24:01 -070066 requestRoutesRoles(app);
67 requestRoutesRoleCollection(app);
68 requestRoutesServiceRoot(app);
69 requestRoutesNetworkProtocol(app);
70 requestRoutesSession(app);
71 requestEthernetInterfacesRoutes(app);
Ed Tanous25b54db2024-04-17 15:40:31 -070072 if constexpr (BMCWEB_REDFISH_ALLOW_DEPRECATED_POWER_THERMAL)
73 {
74 requestRoutesThermal(app);
75 requestRoutesPower(app);
76 }
77 if constexpr (BMCWEB_REDFISH_NEW_POWERSUBSYSTEM_THERMALSUBSYSTEM)
78 {
79 requestRoutesEnvironmentMetrics(app);
80 requestRoutesPowerSubsystem(app);
81 requestRoutesPowerSupply(app);
82 requestRoutesPowerSupplyCollection(app);
83 requestRoutesThermalMetrics(app);
84 requestRoutesThermalSubsystem(app);
85 requestRoutesFan(app);
86 requestRoutesFanCollection(app);
87 }
Ed Tanous3cd70722024-04-06 09:24:01 -070088 requestRoutesManagerCollection(app);
89 requestRoutesManager(app);
90 requestRoutesManagerResetAction(app);
91 requestRoutesManagerResetActionInfo(app);
92 requestRoutesManagerResetToDefaultsAction(app);
93 requestRoutesManagerDiagnosticData(app);
94 requestRoutesChassisCollection(app);
95 requestRoutesChassis(app);
96 requestRoutesChassisResetAction(app);
97 requestRoutesChassisResetActionInfo(app);
98 requestRoutesChassisDrive(app);
99 requestRoutesChassisDriveName(app);
100 requestRoutesUpdateService(app);
101 requestRoutesStorageCollection(app);
102 requestRoutesStorage(app);
103 requestRoutesStorageControllerCollection(app);
104 requestRoutesStorageController(app);
105 requestRoutesDrive(app);
106 requestRoutesCable(app);
107 requestRoutesCableCollection(app);
Ed Tanous3cd70722024-04-06 09:24:01 -0700108
109 requestRoutesSystemLogServiceCollection(app);
110 requestRoutesEventLogService(app);
111 requestRoutesPostCodesEntryAdditionalData(app);
112
113 requestRoutesPostCodesLogService(app);
114 requestRoutesPostCodesClear(app);
115 requestRoutesPostCodesEntry(app);
116 requestRoutesPostCodesEntryCollection(app);
117
Ed Tanous25b54db2024-04-17 15:40:31 -0700118 if constexpr (BMCWEB_REDFISH_DUMP_LOG)
119 {
120 requestRoutesSystemDumpService(app);
121 requestRoutesSystemDumpEntryCollection(app);
122 requestRoutesSystemDumpEntry(app);
123 requestRoutesSystemDumpCreate(app);
124 requestRoutesSystemDumpClear(app);
Ed Tanous3cd70722024-04-06 09:24:01 -0700125
Ed Tanous25b54db2024-04-17 15:40:31 -0700126 requestRoutesBMCDumpService(app);
127 requestRoutesBMCDumpEntryCollection(app);
128 requestRoutesBMCDumpEntry(app);
129 requestRoutesBMCDumpEntryDownload(app);
130 requestRoutesBMCDumpCreate(app);
131 requestRoutesBMCDumpClear(app);
Ed Tanous3cd70722024-04-06 09:24:01 -0700132
Ed Tanous25b54db2024-04-17 15:40:31 -0700133 requestRoutesFaultLogDumpService(app);
134 requestRoutesFaultLogDumpEntryCollection(app);
135 requestRoutesFaultLogDumpEntry(app);
136 requestRoutesFaultLogDumpClear(app);
137 }
Ed Tanous3cd70722024-04-06 09:24:01 -0700138
Ed Tanous3cd70722024-04-06 09:24:01 -0700139 requestRoutesBMCLogServiceCollection(app);
Ed Tanous84177a22024-07-17 11:48:55 -0700140
Ed Tanous25b54db2024-04-17 15:40:31 -0700141 if constexpr (BMCWEB_REDFISH_BMC_JOURNAL)
142 {
143 requestRoutesBMCJournalLogService(app);
Ed Tanous25b54db2024-04-17 15:40:31 -0700144 }
Ed Tanous3cd70722024-04-06 09:24:01 -0700145
Ed Tanous25b54db2024-04-17 15:40:31 -0700146 if constexpr (BMCWEB_REDFISH_CPU_LOG)
147 {
148 requestRoutesCrashdumpService(app);
149 requestRoutesCrashdumpEntryCollection(app);
150 requestRoutesCrashdumpEntry(app);
151 requestRoutesCrashdumpFile(app);
152 requestRoutesCrashdumpClear(app);
153 requestRoutesCrashdumpCollect(app);
154 }
Ed Tanous3cd70722024-04-06 09:24:01 -0700155
156 requestRoutesProcessorCollection(app);
157 requestRoutesProcessor(app);
158 requestRoutesOperatingConfigCollection(app);
159 requestRoutesOperatingConfig(app);
160 requestRoutesMemoryCollection(app);
161 requestRoutesMemory(app);
162
163 requestRoutesSystems(app);
164
165 requestRoutesBiosService(app);
166 requestRoutesBiosReset(app);
167
Ed Tanous25b54db2024-04-17 15:40:31 -0700168 if constexpr (BMCWEB_VM_NBDPROXY)
169 {
170 requestNBDVirtualMediaRoutes(app);
171 }
Ed Tanous3cd70722024-04-06 09:24:01 -0700172
Ed Tanous25b54db2024-04-17 15:40:31 -0700173 if constexpr (BMCWEB_REDFISH_DBUS_LOG)
174 {
175 requestRoutesDBusLogServiceActionsClear(app);
176 requestRoutesDBusEventLogEntryCollection(app);
177 requestRoutesDBusEventLogEntry(app);
178 requestRoutesDBusEventLogEntryDownload(app);
179 }
Alexander Hansena782e262024-08-12 14:04:06 +0200180 else
181 {
182 requestRoutesJournalEventLogEntryCollection(app);
183 requestRoutesJournalEventLogEntry(app);
184 requestRoutesJournalEventLogClear(app);
185 }
Ed Tanous3cd70722024-04-06 09:24:01 -0700186
Ed Tanous25b54db2024-04-17 15:40:31 -0700187 if constexpr (BMCWEB_REDFISH_HOST_LOGGER)
188 {
189 requestRoutesSystemHostLogger(app);
190 requestRoutesSystemHostLoggerCollection(app);
191 requestRoutesSystemHostLoggerLogEntry(app);
192 }
Ed Tanous3cd70722024-04-06 09:24:01 -0700193
194 requestRoutesMessageRegistryFileCollection(app);
195 requestRoutesMessageRegistryFile(app);
196 requestRoutesMessageRegistry(app);
197
198 requestRoutesCertificateService(app);
199 requestRoutesHTTPSCertificate(app);
200 requestRoutesLDAPCertificate(app);
201 requestRoutesTrustStoreCertificate(app);
202
203 requestRoutesSystemPCIeFunctionCollection(app);
204 requestRoutesSystemPCIeFunction(app);
205 requestRoutesSystemPCIeDeviceCollection(app);
206 requestRoutesSystemPCIeDevice(app);
207
208 requestRoutesSensorCollection(app);
209 requestRoutesSensor(app);
210
211 requestRoutesTaskMonitor(app);
212 requestRoutesTaskService(app);
213 requestRoutesTaskCollection(app);
214 requestRoutesTask(app);
215 requestRoutesEventService(app);
216 requestRoutesEventServiceSse(app);
217 requestRoutesEventDestinationCollection(app);
218 requestRoutesEventDestination(app);
219 requestRoutesFabricAdapters(app);
220 requestRoutesFabricAdapterCollection(app);
221 requestRoutesSubmitTestEvent(app);
222
Gunnar Mills68896202024-08-21 11:34:20 -0500223 if constexpr (BMCWEB_HYPERVISOR_COMPUTER_SYSTEM)
224 {
225 requestRoutesHypervisorSystems(app);
226 }
Ed Tanous3cd70722024-04-06 09:24:01 -0700227
228 requestRoutesTelemetryService(app);
229 requestRoutesMetricReportDefinitionCollection(app);
230 requestRoutesMetricReportDefinition(app);
231 requestRoutesMetricReportCollection(app);
232 requestRoutesMetricReport(app);
233 requestRoutesTriggerCollection(app);
234 requestRoutesTrigger(app);
235
236 // Note, this must be the last route registered
237 requestRoutesRedfish(app);
238}
239
240} // namespace redfish