blob: 303cca51379c7c9dd251cc1b9186c745d23fc0a1 [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"
29#include "pcie.hpp"
Ed Tanous3cd70722024-04-06 09:24:01 -070030#include "power.hpp"
31#include "power_subsystem.hpp"
32#include "power_supply.hpp"
33#include "processor.hpp"
34#include "redfish_sessions.hpp"
35#include "redfish_v1.hpp"
36#include "roles.hpp"
37#include "sensors.hpp"
38#include "service_root.hpp"
39#include "storage.hpp"
40#include "systems.hpp"
41#include "task.hpp"
42#include "telemetry_service.hpp"
43#include "thermal.hpp"
44#include "thermal_metrics.hpp"
45#include "thermal_subsystem.hpp"
46#include "trigger.hpp"
47#include "update_service.hpp"
48#include "virtual_media.hpp"
49
50namespace redfish
51{
52
53RedfishService::RedfishService(App& app)
54{
Ed Tanous090ab8e2024-05-18 16:07:23 -070055 requestRoutesMetadata(app);
56
Ed Tanous3cd70722024-04-06 09:24:01 -070057 requestAccountServiceRoutes(app);
Ed Tanous25b54db2024-04-17 15:40:31 -070058 if constexpr (BMCWEB_REDFISH_AGGREGATION)
59 {
60 requestRoutesAggregationService(app);
61 requestRoutesAggregationSourceCollection(app);
62 requestRoutesAggregationSource(app);
63 }
Ed Tanous3cd70722024-04-06 09:24:01 -070064 requestRoutesRoles(app);
65 requestRoutesRoleCollection(app);
66 requestRoutesServiceRoot(app);
67 requestRoutesNetworkProtocol(app);
68 requestRoutesSession(app);
69 requestEthernetInterfacesRoutes(app);
Ed Tanous25b54db2024-04-17 15:40:31 -070070 if constexpr (BMCWEB_REDFISH_ALLOW_DEPRECATED_POWER_THERMAL)
71 {
72 requestRoutesThermal(app);
73 requestRoutesPower(app);
74 }
75 if constexpr (BMCWEB_REDFISH_NEW_POWERSUBSYSTEM_THERMALSUBSYSTEM)
76 {
77 requestRoutesEnvironmentMetrics(app);
78 requestRoutesPowerSubsystem(app);
79 requestRoutesPowerSupply(app);
80 requestRoutesPowerSupplyCollection(app);
81 requestRoutesThermalMetrics(app);
82 requestRoutesThermalSubsystem(app);
83 requestRoutesFan(app);
84 requestRoutesFanCollection(app);
85 }
Ed Tanous3cd70722024-04-06 09:24:01 -070086 requestRoutesManagerCollection(app);
87 requestRoutesManager(app);
88 requestRoutesManagerResetAction(app);
89 requestRoutesManagerResetActionInfo(app);
90 requestRoutesManagerResetToDefaultsAction(app);
91 requestRoutesManagerDiagnosticData(app);
92 requestRoutesChassisCollection(app);
93 requestRoutesChassis(app);
94 requestRoutesChassisResetAction(app);
95 requestRoutesChassisResetActionInfo(app);
96 requestRoutesChassisDrive(app);
97 requestRoutesChassisDriveName(app);
98 requestRoutesUpdateService(app);
99 requestRoutesStorageCollection(app);
100 requestRoutesStorage(app);
101 requestRoutesStorageControllerCollection(app);
102 requestRoutesStorageController(app);
103 requestRoutesDrive(app);
104 requestRoutesCable(app);
105 requestRoutesCableCollection(app);
Ed Tanous3cd70722024-04-06 09:24:01 -0700106
107 requestRoutesSystemLogServiceCollection(app);
108 requestRoutesEventLogService(app);
109 requestRoutesPostCodesEntryAdditionalData(app);
110
111 requestRoutesPostCodesLogService(app);
112 requestRoutesPostCodesClear(app);
113 requestRoutesPostCodesEntry(app);
114 requestRoutesPostCodesEntryCollection(app);
115
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 Tanous36a59ea2024-05-01 16:23:54 -0700137 if constexpr (!BMCWEB_REDFISH_DBUS_LOG)
Ed Tanous25b54db2024-04-17 15:40:31 -0700138 {
139 requestRoutesJournalEventLogEntryCollection(app);
140 requestRoutesJournalEventLogEntry(app);
141 requestRoutesJournalEventLogClear(app);
142 }
Ed Tanous3cd70722024-04-06 09:24:01 -0700143
144 requestRoutesBMCLogServiceCollection(app);
Ed Tanous25b54db2024-04-17 15:40:31 -0700145 if constexpr (BMCWEB_REDFISH_BMC_JOURNAL)
146 {
147 requestRoutesBMCJournalLogService(app);
148 requestRoutesBMCJournalLogEntryCollection(app);
149 requestRoutesBMCJournalLogEntry(app);
150 }
Ed Tanous3cd70722024-04-06 09:24:01 -0700151
Ed Tanous25b54db2024-04-17 15:40:31 -0700152 if constexpr (BMCWEB_REDFISH_CPU_LOG)
153 {
154 requestRoutesCrashdumpService(app);
155 requestRoutesCrashdumpEntryCollection(app);
156 requestRoutesCrashdumpEntry(app);
157 requestRoutesCrashdumpFile(app);
158 requestRoutesCrashdumpClear(app);
159 requestRoutesCrashdumpCollect(app);
160 }
Ed Tanous3cd70722024-04-06 09:24:01 -0700161
162 requestRoutesProcessorCollection(app);
163 requestRoutesProcessor(app);
164 requestRoutesOperatingConfigCollection(app);
165 requestRoutesOperatingConfig(app);
166 requestRoutesMemoryCollection(app);
167 requestRoutesMemory(app);
168
169 requestRoutesSystems(app);
170
171 requestRoutesBiosService(app);
172 requestRoutesBiosReset(app);
173
Ed Tanous25b54db2024-04-17 15:40:31 -0700174 if constexpr (BMCWEB_VM_NBDPROXY)
175 {
176 requestNBDVirtualMediaRoutes(app);
177 }
Ed Tanous3cd70722024-04-06 09:24:01 -0700178
Ed Tanous25b54db2024-04-17 15:40:31 -0700179 if constexpr (BMCWEB_REDFISH_DBUS_LOG)
180 {
181 requestRoutesDBusLogServiceActionsClear(app);
182 requestRoutesDBusEventLogEntryCollection(app);
183 requestRoutesDBusEventLogEntry(app);
184 requestRoutesDBusEventLogEntryDownload(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
223 requestRoutesHypervisorSystems(app);
224
225 requestRoutesTelemetryService(app);
226 requestRoutesMetricReportDefinitionCollection(app);
227 requestRoutesMetricReportDefinition(app);
228 requestRoutesMetricReportCollection(app);
229 requestRoutesMetricReport(app);
230 requestRoutesTriggerCollection(app);
231 requestRoutesTrigger(app);
232
233 // Note, this must be the last route registered
234 requestRoutesRedfish(app);
235}
236
237} // namespace redfish