blob: 61f2762281d1710527c005d9597bf2e58aa10ee2 [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"
Ed Tanouse21126e2024-09-03 17:32:00 -070042#include "systems_logservices_hostlogger.hpp"
Ed Tanous8d2f8682024-09-03 17:03:29 -070043#include "systems_logservices_postcodes.hpp"
Ed Tanous3cd70722024-04-06 09:24:01 -070044#include "task.hpp"
45#include "telemetry_service.hpp"
46#include "thermal.hpp"
47#include "thermal_metrics.hpp"
48#include "thermal_subsystem.hpp"
49#include "trigger.hpp"
50#include "update_service.hpp"
51#include "virtual_media.hpp"
52
53namespace redfish
54{
55
56RedfishService::RedfishService(App& app)
57{
Ed Tanous090ab8e2024-05-18 16:07:23 -070058 requestRoutesMetadata(app);
Ed Tanousd5c01722024-06-16 12:10:33 -070059 requestRoutesOdata(app);
Ed Tanous090ab8e2024-05-18 16:07:23 -070060
Ed Tanous3cd70722024-04-06 09:24:01 -070061 requestAccountServiceRoutes(app);
Ed Tanous25b54db2024-04-17 15:40:31 -070062 if constexpr (BMCWEB_REDFISH_AGGREGATION)
63 {
64 requestRoutesAggregationService(app);
65 requestRoutesAggregationSourceCollection(app);
66 requestRoutesAggregationSource(app);
67 }
Ed Tanous3cd70722024-04-06 09:24:01 -070068 requestRoutesRoles(app);
69 requestRoutesRoleCollection(app);
70 requestRoutesServiceRoot(app);
71 requestRoutesNetworkProtocol(app);
72 requestRoutesSession(app);
73 requestEthernetInterfacesRoutes(app);
Ed Tanous25b54db2024-04-17 15:40:31 -070074 if constexpr (BMCWEB_REDFISH_ALLOW_DEPRECATED_POWER_THERMAL)
75 {
76 requestRoutesThermal(app);
77 requestRoutesPower(app);
78 }
79 if constexpr (BMCWEB_REDFISH_NEW_POWERSUBSYSTEM_THERMALSUBSYSTEM)
80 {
81 requestRoutesEnvironmentMetrics(app);
82 requestRoutesPowerSubsystem(app);
83 requestRoutesPowerSupply(app);
84 requestRoutesPowerSupplyCollection(app);
85 requestRoutesThermalMetrics(app);
86 requestRoutesThermalSubsystem(app);
87 requestRoutesFan(app);
88 requestRoutesFanCollection(app);
89 }
Ed Tanous3cd70722024-04-06 09:24:01 -070090 requestRoutesManagerCollection(app);
91 requestRoutesManager(app);
92 requestRoutesManagerResetAction(app);
93 requestRoutesManagerResetActionInfo(app);
94 requestRoutesManagerResetToDefaultsAction(app);
95 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);
234}
235
236} // namespace redfish