xref: /openbmc/bmcweb/redfish-core/include/redfish.hpp (revision a7405d5fe77fa9e324c22cb29ea08029fc023f4e)
1 /*
2 // Copyright (c) 2018-2019 Intel Corporation
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //      http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 */
16 #pragma once
17 
18 #include "account_service.hpp"
19 #include "aggregation_service.hpp"
20 #include "bios.hpp"
21 #include "cable.hpp"
22 #include "certificate_service.hpp"
23 #include "chassis.hpp"
24 #include "environment_metrics.hpp"
25 #include "ethernet.hpp"
26 #include "event_service.hpp"
27 #include "fabric_adapters.hpp"
28 #include "hypervisor_system.hpp"
29 #include "log_services.hpp"
30 #include "manager_diagnostic_data.hpp"
31 #include "managers.hpp"
32 #include "memory.hpp"
33 #include "message_registries.hpp"
34 #include "metric_report.hpp"
35 #include "metric_report_definition.hpp"
36 #include "network_protocol.hpp"
37 #include "pcie.hpp"
38 #include "pcie_slots.hpp"
39 #include "power.hpp"
40 #include "power_subsystem.hpp"
41 #include "processor.hpp"
42 #include "redfish_sessions.hpp"
43 #include "redfish_v1.hpp"
44 #include "roles.hpp"
45 #include "sensors.hpp"
46 #include "service_root.hpp"
47 #include "storage.hpp"
48 #include "systems.hpp"
49 #include "task.hpp"
50 #include "telemetry_service.hpp"
51 #include "thermal.hpp"
52 #include "thermal_subsystem.hpp"
53 #include "trigger.hpp"
54 #include "update_service.hpp"
55 #include "virtual_media.hpp"
56 
57 namespace redfish
58 {
59 /*
60  * @brief Top level class installing and providing Redfish services
61  */
62 class RedfishService
63 {
64   public:
65     /*
66      * @brief Redfish service constructor
67      *
68      * Loads Redfish configuration and installs schema resources
69      *
70      * @param[in] app   Crow app on which Redfish will initialize
71      */
72     explicit RedfishService(App& app)
73     {
74         requestAccountServiceRoutes(app);
75 #ifdef BMCWEB_ENABLE_REDFISH_AGGREGATION
76         requestAggregationServiceRoutes(app);
77 #endif
78         requestRoutesRoles(app);
79         requestRoutesRoleCollection(app);
80         requestRoutesServiceRoot(app);
81         requestRoutesNetworkProtocol(app);
82         requestRoutesSession(app);
83         requestEthernetInterfacesRoutes(app);
84 #ifdef BMCWEB_ALLOW_DEPRECATED_POWER_THERMAL
85         requestRoutesThermal(app);
86         requestRoutesPower(app);
87 #endif
88 #ifdef BMCWEB_NEW_POWERSUBSYSTEM_THERMALSUBSYSTEM
89         requestRoutesEnvironmentMetrics(app);
90         requestRoutesPowerSubsystem(app);
91         requestRoutesThermalSubsystem(app);
92 #endif
93         requestRoutesManagerCollection(app);
94         requestRoutesManager(app);
95         requestRoutesManagerResetAction(app);
96         requestRoutesManagerResetActionInfo(app);
97         requestRoutesManagerResetToDefaultsAction(app);
98         requestRoutesManagerDiagnosticData(app);
99         requestRoutesChassisCollection(app);
100         requestRoutesChassis(app);
101         requestRoutesChassisResetAction(app);
102         requestRoutesChassisResetActionInfo(app);
103         requestRoutesChassisDrive(app);
104         requestRoutesChassisDriveName(app);
105         requestRoutesUpdateService(app);
106         requestRoutesStorageCollection(app);
107         requestRoutesStorage(app);
108         requestRoutesDrive(app);
109         requestRoutesCable(app);
110         requestRoutesCableCollection(app);
111 #ifdef BMCWEB_INSECURE_ENABLE_REDFISH_FW_TFTP_UPDATE
112         requestRoutesUpdateServiceActionsSimpleUpdate(app);
113 #endif
114         requestRoutesSoftwareInventoryCollection(app);
115         requestRoutesSoftwareInventory(app);
116 
117         requestRoutesSystemLogServiceCollection(app);
118         requestRoutesEventLogService(app);
119         requestRoutesPostCodesEntryAdditionalData(app);
120 
121         requestRoutesPostCodesLogService(app);
122         requestRoutesPostCodesClear(app);
123         requestRoutesPostCodesEntry(app);
124         requestRoutesPostCodesEntryCollection(app);
125 
126 #ifdef BMCWEB_ENABLE_REDFISH_DUMP_LOG
127         requestRoutesSystemDumpService(app);
128         requestRoutesSystemDumpEntryCollection(app);
129         requestRoutesSystemDumpEntry(app);
130         requestRoutesSystemDumpCreate(app);
131         requestRoutesSystemDumpClear(app);
132 
133         requestRoutesBMCDumpService(app);
134         requestRoutesBMCDumpEntryCollection(app);
135         requestRoutesBMCDumpEntry(app);
136         requestRoutesBMCDumpCreate(app);
137         requestRoutesBMCDumpClear(app);
138 
139         requestRoutesFaultLogDumpService(app);
140         requestRoutesFaultLogDumpEntryCollection(app);
141         requestRoutesFaultLogDumpEntry(app);
142         requestRoutesFaultLogDumpClear(app);
143 #endif
144 
145 #ifndef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
146         requestRoutesJournalEventLogEntryCollection(app);
147         requestRoutesJournalEventLogEntry(app);
148         requestRoutesJournalEventLogClear(app);
149 #endif
150 
151         requestRoutesBMCLogServiceCollection(app);
152 #ifdef BMCWEB_ENABLE_REDFISH_BMC_JOURNAL
153         requestRoutesBMCJournalLogService(app);
154         requestRoutesBMCJournalLogEntryCollection(app);
155         requestRoutesBMCJournalLogEntry(app);
156 #endif
157 
158 #ifdef BMCWEB_ENABLE_REDFISH_CPU_LOG
159         requestRoutesCrashdumpService(app);
160         requestRoutesCrashdumpEntryCollection(app);
161         requestRoutesCrashdumpEntry(app);
162         requestRoutesCrashdumpFile(app);
163         requestRoutesCrashdumpClear(app);
164         requestRoutesCrashdumpCollect(app);
165 #endif // BMCWEB_ENABLE_REDFISH_CPU_LOG
166 
167         requestRoutesProcessorCollection(app);
168         requestRoutesProcessor(app);
169         requestRoutesOperatingConfigCollection(app);
170         requestRoutesOperatingConfig(app);
171         requestRoutesMemoryCollection(app);
172         requestRoutesMemory(app);
173 
174         requestRoutesSystemsCollection(app);
175         requestRoutesSystems(app);
176         requestRoutesSystemActionsReset(app);
177         requestRoutesSystemResetActionInfo(app);
178         requestRoutesBiosService(app);
179         requestRoutesBiosReset(app);
180 
181 #ifdef BMCWEB_ENABLE_VM_NBDPROXY
182         requestNBDVirtualMediaRoutes(app);
183 #endif // BMCWEB_ENABLE_VM_NBDPROXY
184 
185 #ifdef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
186         requestRoutesDBusLogServiceActionsClear(app);
187         requestRoutesDBusEventLogEntryCollection(app);
188         requestRoutesDBusEventLogEntry(app);
189         requestRoutesDBusEventLogEntryDownload(app);
190 #endif
191 
192 #ifdef BMCWEB_ENABLE_REDFISH_HOST_LOGGER
193         requestRoutesSystemHostLogger(app);
194         requestRoutesSystemHostLoggerCollection(app);
195         requestRoutesSystemHostLoggerLogEntry(app);
196 #endif
197 
198         requestRoutesMessageRegistryFileCollection(app);
199         requestRoutesMessageRegistryFile(app);
200         requestRoutesMessageRegistry(app);
201 
202         requestRoutesCertificateService(app);
203         requestRoutesHTTPSCertificate(app);
204         requestRoutesLDAPCertificate(app);
205         requestRoutesTrustStoreCertificate(app);
206 
207         requestRoutesSystemPCIeFunctionCollection(app);
208         requestRoutesSystemPCIeFunction(app);
209         requestRoutesSystemPCIeDeviceCollection(app);
210         requestRoutesSystemPCIeDevice(app);
211 
212         requestRoutesSensorCollection(app);
213         requestRoutesSensor(app);
214 
215         requestRoutesTaskMonitor(app);
216         requestRoutesTaskService(app);
217         requestRoutesTaskCollection(app);
218         requestRoutesTask(app);
219         requestRoutesEventService(app);
220         requestRoutesEventDestinationCollection(app);
221         requestRoutesEventDestination(app);
222         requestRoutesFabricAdapters(app);
223         requestRoutesFabricAdapterCollection(app);
224         requestRoutesSubmitTestEvent(app);
225 
226         requestRoutesHypervisorSystems(app);
227 
228         requestRoutesTelemetryService(app);
229         requestRoutesMetricReportDefinitionCollection(app);
230         requestRoutesMetricReportDefinition(app);
231         requestRoutesMetricReportCollection(app);
232         requestRoutesMetricReport(app);
233         requestRoutesTriggerCollection(app);
234         requestRoutesTrigger(app);
235 
236         // Note, this must be the last route registered
237         requestRoutesRedfish(app);
238     }
239 };
240 
241 } // namespace redfish
242