blob: 3cda4ec6d0c69a13bdaf38395ef3a6b5771f6ae9 [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 Tanous36a59ea2024-05-01 16:23:54 -0700139 if constexpr (!BMCWEB_REDFISH_DBUS_LOG)
Ed Tanous25b54db2024-04-17 15:40:31 -0700140 {
141 requestRoutesJournalEventLogEntryCollection(app);
142 requestRoutesJournalEventLogEntry(app);
143 requestRoutesJournalEventLogClear(app);
144 }
Ed Tanous3cd70722024-04-06 09:24:01 -0700145
146 requestRoutesBMCLogServiceCollection(app);
Ed Tanous84177a22024-07-17 11:48:55 -0700147
Ed Tanous25b54db2024-04-17 15:40:31 -0700148 if constexpr (BMCWEB_REDFISH_BMC_JOURNAL)
149 {
150 requestRoutesBMCJournalLogService(app);
Ed Tanous25b54db2024-04-17 15:40:31 -0700151 }
Ed Tanous3cd70722024-04-06 09:24:01 -0700152
Ed Tanous25b54db2024-04-17 15:40:31 -0700153 if constexpr (BMCWEB_REDFISH_CPU_LOG)
154 {
155 requestRoutesCrashdumpService(app);
156 requestRoutesCrashdumpEntryCollection(app);
157 requestRoutesCrashdumpEntry(app);
158 requestRoutesCrashdumpFile(app);
159 requestRoutesCrashdumpClear(app);
160 requestRoutesCrashdumpCollect(app);
161 }
Ed Tanous3cd70722024-04-06 09:24:01 -0700162
163 requestRoutesProcessorCollection(app);
164 requestRoutesProcessor(app);
165 requestRoutesOperatingConfigCollection(app);
166 requestRoutesOperatingConfig(app);
167 requestRoutesMemoryCollection(app);
168 requestRoutesMemory(app);
169
170 requestRoutesSystems(app);
171
172 requestRoutesBiosService(app);
173 requestRoutesBiosReset(app);
174
Ed Tanous25b54db2024-04-17 15:40:31 -0700175 if constexpr (BMCWEB_VM_NBDPROXY)
176 {
177 requestNBDVirtualMediaRoutes(app);
178 }
Ed Tanous3cd70722024-04-06 09:24:01 -0700179
Ed Tanous25b54db2024-04-17 15:40:31 -0700180 if constexpr (BMCWEB_REDFISH_DBUS_LOG)
181 {
182 requestRoutesDBusLogServiceActionsClear(app);
183 requestRoutesDBusEventLogEntryCollection(app);
184 requestRoutesDBusEventLogEntry(app);
185 requestRoutesDBusEventLogEntryDownload(app);
186 }
Ed Tanous3cd70722024-04-06 09:24:01 -0700187
Ed Tanous25b54db2024-04-17 15:40:31 -0700188 if constexpr (BMCWEB_REDFISH_HOST_LOGGER)
189 {
190 requestRoutesSystemHostLogger(app);
191 requestRoutesSystemHostLoggerCollection(app);
192 requestRoutesSystemHostLoggerLogEntry(app);
193 }
Ed Tanous3cd70722024-04-06 09:24:01 -0700194
195 requestRoutesMessageRegistryFileCollection(app);
196 requestRoutesMessageRegistryFile(app);
197 requestRoutesMessageRegistry(app);
198
199 requestRoutesCertificateService(app);
200 requestRoutesHTTPSCertificate(app);
201 requestRoutesLDAPCertificate(app);
202 requestRoutesTrustStoreCertificate(app);
203
204 requestRoutesSystemPCIeFunctionCollection(app);
205 requestRoutesSystemPCIeFunction(app);
206 requestRoutesSystemPCIeDeviceCollection(app);
207 requestRoutesSystemPCIeDevice(app);
208
209 requestRoutesSensorCollection(app);
210 requestRoutesSensor(app);
211
212 requestRoutesTaskMonitor(app);
213 requestRoutesTaskService(app);
214 requestRoutesTaskCollection(app);
215 requestRoutesTask(app);
216 requestRoutesEventService(app);
217 requestRoutesEventServiceSse(app);
218 requestRoutesEventDestinationCollection(app);
219 requestRoutesEventDestination(app);
220 requestRoutesFabricAdapters(app);
221 requestRoutesFabricAdapterCollection(app);
222 requestRoutesSubmitTestEvent(app);
223
224 requestRoutesHypervisorSystems(app);
225
226 requestRoutesTelemetryService(app);
227 requestRoutesMetricReportDefinitionCollection(app);
228 requestRoutesMetricReportDefinition(app);
229 requestRoutesMetricReportCollection(app);
230 requestRoutesMetricReport(app);
231 requestRoutesTriggerCollection(app);
232 requestRoutesTrigger(app);
233
234 // Note, this must be the last route registered
235 requestRoutesRedfish(app);
236}
237
238} // namespace redfish