xref: /openbmc/bmcweb/redfish-core/src/redfish.cpp (revision 102a4cda)
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 "metric_report.hpp"
25 #include "metric_report_definition.hpp"
26 #include "network_protocol.hpp"
27 #include "pcie.hpp"
28 #include "power.hpp"
29 #include "power_subsystem.hpp"
30 #include "power_supply.hpp"
31 #include "processor.hpp"
32 #include "redfish_sessions.hpp"
33 #include "redfish_v1.hpp"
34 #include "roles.hpp"
35 #include "sensors.hpp"
36 #include "service_root.hpp"
37 #include "storage.hpp"
38 #include "systems.hpp"
39 #include "task.hpp"
40 #include "telemetry_service.hpp"
41 #include "thermal.hpp"
42 #include "thermal_metrics.hpp"
43 #include "thermal_subsystem.hpp"
44 #include "trigger.hpp"
45 #include "update_service.hpp"
46 #include "virtual_media.hpp"
47 
48 namespace redfish
49 {
50 
51 RedfishService::RedfishService(App& app)
52 {
53     requestAccountServiceRoutes(app);
54     if constexpr (BMCWEB_REDFISH_AGGREGATION)
55     {
56         requestRoutesAggregationService(app);
57         requestRoutesAggregationSourceCollection(app);
58         requestRoutesAggregationSource(app);
59     }
60     requestRoutesRoles(app);
61     requestRoutesRoleCollection(app);
62     requestRoutesServiceRoot(app);
63     requestRoutesNetworkProtocol(app);
64     requestRoutesSession(app);
65     requestEthernetInterfacesRoutes(app);
66     if constexpr (BMCWEB_REDFISH_ALLOW_DEPRECATED_POWER_THERMAL)
67     {
68         requestRoutesThermal(app);
69         requestRoutesPower(app);
70     }
71     if constexpr (BMCWEB_REDFISH_NEW_POWERSUBSYSTEM_THERMALSUBSYSTEM)
72     {
73         requestRoutesEnvironmentMetrics(app);
74         requestRoutesPowerSubsystem(app);
75         requestRoutesPowerSupply(app);
76         requestRoutesPowerSupplyCollection(app);
77         requestRoutesThermalMetrics(app);
78         requestRoutesThermalSubsystem(app);
79         requestRoutesFan(app);
80         requestRoutesFanCollection(app);
81     }
82     requestRoutesManagerCollection(app);
83     requestRoutesManager(app);
84     requestRoutesManagerResetAction(app);
85     requestRoutesManagerResetActionInfo(app);
86     requestRoutesManagerResetToDefaultsAction(app);
87     requestRoutesManagerDiagnosticData(app);
88     requestRoutesChassisCollection(app);
89     requestRoutesChassis(app);
90     requestRoutesChassisResetAction(app);
91     requestRoutesChassisResetActionInfo(app);
92     requestRoutesChassisDrive(app);
93     requestRoutesChassisDriveName(app);
94     requestRoutesUpdateService(app);
95     requestRoutesStorageCollection(app);
96     requestRoutesStorage(app);
97     requestRoutesStorageControllerCollection(app);
98     requestRoutesStorageController(app);
99     requestRoutesDrive(app);
100     requestRoutesCable(app);
101     requestRoutesCableCollection(app);
102 
103     requestRoutesSystemLogServiceCollection(app);
104     requestRoutesEventLogService(app);
105     requestRoutesPostCodesEntryAdditionalData(app);
106 
107     requestRoutesPostCodesLogService(app);
108     requestRoutesPostCodesClear(app);
109     requestRoutesPostCodesEntry(app);
110     requestRoutesPostCodesEntryCollection(app);
111 
112     if constexpr (BMCWEB_REDFISH_DUMP_LOG)
113     {
114         requestRoutesSystemDumpService(app);
115         requestRoutesSystemDumpEntryCollection(app);
116         requestRoutesSystemDumpEntry(app);
117         requestRoutesSystemDumpCreate(app);
118         requestRoutesSystemDumpClear(app);
119 
120         requestRoutesBMCDumpService(app);
121         requestRoutesBMCDumpEntryCollection(app);
122         requestRoutesBMCDumpEntry(app);
123         requestRoutesBMCDumpEntryDownload(app);
124         requestRoutesBMCDumpCreate(app);
125         requestRoutesBMCDumpClear(app);
126 
127         requestRoutesFaultLogDumpService(app);
128         requestRoutesFaultLogDumpEntryCollection(app);
129         requestRoutesFaultLogDumpEntry(app);
130         requestRoutesFaultLogDumpClear(app);
131     }
132 
133     if constexpr (!BMCWEB_REDFISH_DBUS_LOG)
134     {
135         requestRoutesJournalEventLogEntryCollection(app);
136         requestRoutesJournalEventLogEntry(app);
137         requestRoutesJournalEventLogClear(app);
138     }
139 
140     requestRoutesBMCLogServiceCollection(app);
141     if constexpr (BMCWEB_REDFISH_BMC_JOURNAL)
142     {
143         requestRoutesBMCJournalLogService(app);
144         requestRoutesBMCJournalLogEntryCollection(app);
145         requestRoutesBMCJournalLogEntry(app);
146     }
147 
148     if constexpr (BMCWEB_REDFISH_CPU_LOG)
149     {
150         requestRoutesCrashdumpService(app);
151         requestRoutesCrashdumpEntryCollection(app);
152         requestRoutesCrashdumpEntry(app);
153         requestRoutesCrashdumpFile(app);
154         requestRoutesCrashdumpClear(app);
155         requestRoutesCrashdumpCollect(app);
156     }
157 
158     requestRoutesProcessorCollection(app);
159     requestRoutesProcessor(app);
160     requestRoutesOperatingConfigCollection(app);
161     requestRoutesOperatingConfig(app);
162     requestRoutesMemoryCollection(app);
163     requestRoutesMemory(app);
164 
165     requestRoutesSystems(app);
166 
167     requestRoutesBiosService(app);
168     requestRoutesBiosReset(app);
169 
170     if constexpr (BMCWEB_VM_NBDPROXY)
171     {
172         requestNBDVirtualMediaRoutes(app);
173     }
174 
175     if constexpr (BMCWEB_REDFISH_DBUS_LOG)
176     {
177         requestRoutesDBusLogServiceActionsClear(app);
178         requestRoutesDBusEventLogEntryCollection(app);
179         requestRoutesDBusEventLogEntry(app);
180         requestRoutesDBusEventLogEntryDownload(app);
181     }
182 
183     if constexpr (BMCWEB_REDFISH_HOST_LOGGER)
184     {
185         requestRoutesSystemHostLogger(app);
186         requestRoutesSystemHostLoggerCollection(app);
187         requestRoutesSystemHostLoggerLogEntry(app);
188     }
189 
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 
219     requestRoutesHypervisorSystems(app);
220 
221     requestRoutesTelemetryService(app);
222     requestRoutesMetricReportDefinitionCollection(app);
223     requestRoutesMetricReportDefinition(app);
224     requestRoutesMetricReportCollection(app);
225     requestRoutesMetricReport(app);
226     requestRoutesTriggerCollection(app);
227     requestRoutesTrigger(app);
228 
229     // Note, this must be the last route registered
230     requestRoutesRedfish(app);
231 }
232 
233 } // namespace redfish
234