xref: /openbmc/bmcweb/redfish-core/src/redfish.cpp (revision a529a6aa)
1 #include "redfish.hpp"
2 
3 #include "bmcweb_config.h"
4 
5 #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"
21 #include "managers.hpp"
22 #include "memory.hpp"
23 #include "message_registries.hpp"
24 #include "metadata.hpp"
25 #include "metric_report.hpp"
26 #include "metric_report_definition.hpp"
27 #include "network_protocol.hpp"
28 #include "pcie.hpp"
29 #include "power.hpp"
30 #include "power_subsystem.hpp"
31 #include "power_supply.hpp"
32 #include "processor.hpp"
33 #include "redfish_sessions.hpp"
34 #include "redfish_v1.hpp"
35 #include "roles.hpp"
36 #include "sensors.hpp"
37 #include "service_root.hpp"
38 #include "storage.hpp"
39 #include "systems.hpp"
40 #include "task.hpp"
41 #include "telemetry_service.hpp"
42 #include "thermal.hpp"
43 #include "thermal_metrics.hpp"
44 #include "thermal_subsystem.hpp"
45 #include "trigger.hpp"
46 #include "update_service.hpp"
47 #include "virtual_media.hpp"
48 
49 namespace redfish
50 {
51 
52 RedfishService::RedfishService(App& app)
53 {
54     requestRoutesMetadata(app);
55 
56     requestAccountServiceRoutes(app);
57     if constexpr (BMCWEB_REDFISH_AGGREGATION)
58     {
59         requestRoutesAggregationService(app);
60         requestRoutesAggregationSourceCollection(app);
61         requestRoutesAggregationSource(app);
62     }
63     requestRoutesRoles(app);
64     requestRoutesRoleCollection(app);
65     requestRoutesServiceRoot(app);
66     requestRoutesNetworkProtocol(app);
67     requestRoutesSession(app);
68     requestEthernetInterfacesRoutes(app);
69     if constexpr (BMCWEB_REDFISH_ALLOW_DEPRECATED_POWER_THERMAL)
70     {
71         requestRoutesThermal(app);
72         requestRoutesPower(app);
73     }
74     if constexpr (BMCWEB_REDFISH_NEW_POWERSUBSYSTEM_THERMALSUBSYSTEM)
75     {
76         requestRoutesEnvironmentMetrics(app);
77         requestRoutesPowerSubsystem(app);
78         requestRoutesPowerSupply(app);
79         requestRoutesPowerSupplyCollection(app);
80         requestRoutesThermalMetrics(app);
81         requestRoutesThermalSubsystem(app);
82         requestRoutesFan(app);
83         requestRoutesFanCollection(app);
84     }
85     requestRoutesManagerCollection(app);
86     requestRoutesManager(app);
87     requestRoutesManagerResetAction(app);
88     requestRoutesManagerResetActionInfo(app);
89     requestRoutesManagerResetToDefaultsAction(app);
90     requestRoutesManagerDiagnosticData(app);
91     requestRoutesChassisCollection(app);
92     requestRoutesChassis(app);
93     requestRoutesChassisResetAction(app);
94     requestRoutesChassisResetActionInfo(app);
95     requestRoutesChassisDrive(app);
96     requestRoutesChassisDriveName(app);
97     requestRoutesUpdateService(app);
98     requestRoutesStorageCollection(app);
99     requestRoutesStorage(app);
100     requestRoutesStorageControllerCollection(app);
101     requestRoutesStorageController(app);
102     requestRoutesDrive(app);
103     requestRoutesCable(app);
104     requestRoutesCableCollection(app);
105 
106     requestRoutesSystemLogServiceCollection(app);
107     requestRoutesEventLogService(app);
108     requestRoutesPostCodesEntryAdditionalData(app);
109 
110     requestRoutesPostCodesLogService(app);
111     requestRoutesPostCodesClear(app);
112     requestRoutesPostCodesEntry(app);
113     requestRoutesPostCodesEntryCollection(app);
114 
115     if constexpr (BMCWEB_REDFISH_DUMP_LOG)
116     {
117         requestRoutesSystemDumpService(app);
118         requestRoutesSystemDumpEntryCollection(app);
119         requestRoutesSystemDumpEntry(app);
120         requestRoutesSystemDumpCreate(app);
121         requestRoutesSystemDumpClear(app);
122 
123         requestRoutesBMCDumpService(app);
124         requestRoutesBMCDumpEntryCollection(app);
125         requestRoutesBMCDumpEntry(app);
126         requestRoutesBMCDumpEntryDownload(app);
127         requestRoutesBMCDumpCreate(app);
128         requestRoutesBMCDumpClear(app);
129 
130         requestRoutesFaultLogDumpService(app);
131         requestRoutesFaultLogDumpEntryCollection(app);
132         requestRoutesFaultLogDumpEntry(app);
133         requestRoutesFaultLogDumpClear(app);
134     }
135 
136     if constexpr (!BMCWEB_REDFISH_DBUS_LOG)
137     {
138         requestRoutesJournalEventLogEntryCollection(app);
139         requestRoutesJournalEventLogEntry(app);
140         requestRoutesJournalEventLogClear(app);
141     }
142 
143     requestRoutesBMCLogServiceCollection(app);
144     if constexpr (BMCWEB_REDFISH_BMC_JOURNAL)
145     {
146         requestRoutesBMCJournalLogService(app);
147         requestRoutesBMCJournalLogEntryCollection(app);
148         requestRoutesBMCJournalLogEntry(app);
149     }
150 
151     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     }
160 
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 
173     if constexpr (BMCWEB_VM_NBDPROXY)
174     {
175         requestNBDVirtualMediaRoutes(app);
176     }
177 
178     if constexpr (BMCWEB_REDFISH_DBUS_LOG)
179     {
180         requestRoutesDBusLogServiceActionsClear(app);
181         requestRoutesDBusEventLogEntryCollection(app);
182         requestRoutesDBusEventLogEntry(app);
183         requestRoutesDBusEventLogEntryDownload(app);
184     }
185 
186     if constexpr (BMCWEB_REDFISH_HOST_LOGGER)
187     {
188         requestRoutesSystemHostLogger(app);
189         requestRoutesSystemHostLoggerCollection(app);
190         requestRoutesSystemHostLoggerLogEntry(app);
191     }
192 
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
237