blob: 57378d56e58190adf4941aeebde5073975ad628e [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 Tanous84177a22024-07-17 11:48:55 -0700145
Ed Tanous25b54db2024-04-17 15:40:31 -0700146 if constexpr (BMCWEB_REDFISH_BMC_JOURNAL)
147 {
148 requestRoutesBMCJournalLogService(app);
Ed Tanous25b54db2024-04-17 15:40:31 -0700149 }
Ed Tanous3cd70722024-04-06 09:24:01 -0700150
Ed Tanous25b54db2024-04-17 15:40:31 -0700151 if constexpr (BMCWEB_REDFISH_CPU_LOG)
152 {
153 requestRoutesCrashdumpService(app);
154 requestRoutesCrashdumpEntryCollection(app);
155 requestRoutesCrashdumpEntry(app);
156 requestRoutesCrashdumpFile(app);
157 requestRoutesCrashdumpClear(app);
158 requestRoutesCrashdumpCollect(app);
159 }
Ed Tanous3cd70722024-04-06 09:24:01 -0700160
161 requestRoutesProcessorCollection(app);
162 requestRoutesProcessor(app);
163 requestRoutesOperatingConfigCollection(app);
164 requestRoutesOperatingConfig(app);
165 requestRoutesMemoryCollection(app);
166 requestRoutesMemory(app);
167
168 requestRoutesSystems(app);
169
170 requestRoutesBiosService(app);
171 requestRoutesBiosReset(app);
172
Ed Tanous25b54db2024-04-17 15:40:31 -0700173 if constexpr (BMCWEB_VM_NBDPROXY)
174 {
175 requestNBDVirtualMediaRoutes(app);
176 }
Ed Tanous3cd70722024-04-06 09:24:01 -0700177
Ed Tanous25b54db2024-04-17 15:40:31 -0700178 if constexpr (BMCWEB_REDFISH_DBUS_LOG)
179 {
180 requestRoutesDBusLogServiceActionsClear(app);
181 requestRoutesDBusEventLogEntryCollection(app);
182 requestRoutesDBusEventLogEntry(app);
183 requestRoutesDBusEventLogEntryDownload(app);
184 }
Ed Tanous3cd70722024-04-06 09:24:01 -0700185
Ed Tanous25b54db2024-04-17 15:40:31 -0700186 if constexpr (BMCWEB_REDFISH_HOST_LOGGER)
187 {
188 requestRoutesSystemHostLogger(app);
189 requestRoutesSystemHostLoggerCollection(app);
190 requestRoutesSystemHostLoggerLogEntry(app);
191 }
Ed Tanous3cd70722024-04-06 09:24:01 -0700192
193 requestRoutesMessageRegistryFileCollection(app);
194 requestRoutesMessageRegistryFile(app);
195 requestRoutesMessageRegistry(app);
196
197 requestRoutesCertificateService(app);
198 requestRoutesHTTPSCertificate(app);
199 requestRoutesLDAPCertificate(app);
200 requestRoutesTrustStoreCertificate(app);
201
202 requestRoutesSystemPCIeFunctionCollection(app);
203 requestRoutesSystemPCIeFunction(app);
204 requestRoutesSystemPCIeDeviceCollection(app);
205 requestRoutesSystemPCIeDevice(app);
206
207 requestRoutesSensorCollection(app);
208 requestRoutesSensor(app);
209
210 requestRoutesTaskMonitor(app);
211 requestRoutesTaskService(app);
212 requestRoutesTaskCollection(app);
213 requestRoutesTask(app);
214 requestRoutesEventService(app);
215 requestRoutesEventServiceSse(app);
216 requestRoutesEventDestinationCollection(app);
217 requestRoutesEventDestination(app);
218 requestRoutesFabricAdapters(app);
219 requestRoutesFabricAdapterCollection(app);
220 requestRoutesSubmitTestEvent(app);
221
222 requestRoutesHypervisorSystems(app);
223
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