blob: cf41824e8183d13761509eb456643782eb3084b2 [file] [log] [blame]
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +01001/*
Jason M. Bills70304cb2019-03-27 12:03:59 -07002// Copyright (c) 2018-2019 Intel Corporation
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +01003//
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
Nan Zhou4e7efda2022-10-25 21:12:32 +000018#include "account_service.hpp"
Ed Tanous6c068982023-02-07 15:44:38 -080019#include "aggregation_service.hpp"
Nan Zhou4e7efda2022-10-25 21:12:32 +000020#include "bios.hpp"
21#include "cable.hpp"
22#include "certificate_service.hpp"
23#include "chassis.hpp"
Albert Zhang4ca3ec32021-06-13 14:39:38 +080024#include "environment_metrics.hpp"
Nan Zhou4e7efda2022-10-25 21:12:32 +000025#include "ethernet.hpp"
26#include "event_service.hpp"
Sunny Srivastava31791052021-03-12 10:39:16 -060027#include "fabric_adapters.hpp"
Nan Zhou4e7efda2022-10-25 21:12:32 +000028#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"
Ed Tanous4ce2c1b2023-02-10 11:57:54 -080038#include "pcie_slots.hpp"
Nan Zhou4e7efda2022-10-25 21:12:32 +000039#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"
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +010056
Ed Tanous1abe55e2018-09-05 08:30:59 -070057namespace redfish
58{
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +010059/*
60 * @brief Top level class installing and providing Redfish services
61 */
Ed Tanous1abe55e2018-09-05 08:30:59 -070062class 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 */
Ed Tanous4e23a442022-06-06 09:57:26 -070072 explicit RedfishService(App& app)
Ed Tanous1abe55e2018-09-05 08:30:59 -070073 {
Ed Tanous6c51eab2021-06-03 12:30:29 -070074 requestAccountServiceRoutes(app);
Ed Tanous6c068982023-02-07 15:44:38 -080075#ifdef BMCWEB_ENABLE_REDFISH_AGGREGATION
Carson Labrado8b2521a2023-02-18 02:33:14 +000076 requestRoutesAggregationService(app);
77 requestRoutesAggregationSourceCollection(app);
78 requestRoutesAggregationSource(app);
Ed Tanous6c068982023-02-07 15:44:38 -080079#endif
John Edward Broadbent7e860f12021-04-08 15:57:16 -070080 requestRoutesRoles(app);
81 requestRoutesRoleCollection(app);
82 requestRoutesServiceRoot(app);
83 requestRoutesNetworkProtocol(app);
Ed Tanousfaa34cc2021-06-03 13:27:02 -070084 requestRoutesSession(app);
Ed Tanousbf648f72021-06-03 15:00:14 -070085 requestEthernetInterfacesRoutes(app);
zhanghch050256b692021-06-12 10:26:52 +080086#ifdef BMCWEB_ALLOW_DEPRECATED_POWER_THERMAL
John Edward Broadbent7e860f12021-04-08 15:57:16 -070087 requestRoutesThermal(app);
zhanghch050256b692021-06-12 10:26:52 +080088 requestRoutesPower(app);
89#endif
Xiaochao Ma29739632021-03-02 15:53:13 +080090#ifdef BMCWEB_NEW_POWERSUBSYSTEM_THERMALSUBSYSTEM
Albert Zhang4ca3ec32021-06-13 14:39:38 +080091 requestRoutesEnvironmentMetrics(app);
Chicago Duan77b36432021-02-05 15:48:26 +080092 requestRoutesPowerSubsystem(app);
Xiaochao Ma29739632021-03-02 15:53:13 +080093 requestRoutesThermalSubsystem(app);
94#endif
John Edward Broadbent7e860f12021-04-08 15:57:16 -070095 requestRoutesManagerCollection(app);
96 requestRoutesManager(app);
97 requestRoutesManagerResetAction(app);
98 requestRoutesManagerResetActionInfo(app);
99 requestRoutesManagerResetToDefaultsAction(app);
Sui Chena51fc2d2022-07-14 17:21:53 -0700100 requestRoutesManagerDiagnosticData(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700101 requestRoutesChassisCollection(app);
102 requestRoutesChassis(app);
103 requestRoutesChassisResetAction(app);
104 requestRoutesChassisResetActionInfo(app);
John Edward Broadbent92903bd2022-04-26 13:40:59 -0700105 requestRoutesChassisDrive(app);
John Edward Broadbente56ed6b2022-04-26 13:40:59 -0700106 requestRoutesChassisDriveName(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700107 requestRoutesUpdateService(app);
108 requestRoutesStorageCollection(app);
109 requestRoutesStorage(app);
110 requestRoutesDrive(app);
Shantappa Teekappanavar9c929be2021-12-16 19:02:52 -0600111 requestRoutesCable(app);
112 requestRoutesCableCollection(app);
Andrew Geissler0554c982019-04-23 14:40:12 -0500113#ifdef BMCWEB_INSECURE_ENABLE_REDFISH_FW_TFTP_UPDATE
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700114 requestRoutesUpdateServiceActionsSimpleUpdate(app);
Andrew Geissler0554c982019-04-23 14:40:12 -0500115#endif
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700116 requestRoutesSoftwareInventoryCollection(app);
117 requestRoutesSoftwareInventory(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800118
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700119 requestRoutesSystemLogServiceCollection(app);
120 requestRoutesEventLogService(app);
George Liu647b3cd2021-07-05 12:43:56 +0800121 requestRoutesPostCodesEntryAdditionalData(app);
ZhikuiRena3316fc2020-01-29 14:58:08 -0800122
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700123 requestRoutesPostCodesLogService(app);
124 requestRoutesPostCodesClear(app);
125 requestRoutesPostCodesEntry(app);
126 requestRoutesPostCodesEntryCollection(app);
ZhikuiRena3316fc2020-01-29 14:58:08 -0800127
Asmitha Karunanithi5cb1dd22020-05-07 04:35:02 -0500128#ifdef BMCWEB_ENABLE_REDFISH_DUMP_LOG
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700129 requestRoutesSystemDumpService(app);
130 requestRoutesSystemDumpEntryCollection(app);
131 requestRoutesSystemDumpEntry(app);
132 requestRoutesSystemDumpCreate(app);
133 requestRoutesSystemDumpClear(app);
Asmitha Karunanithi5cb1dd22020-05-07 04:35:02 -0500134
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700135 requestRoutesBMCDumpService(app);
136 requestRoutesBMCDumpEntryCollection(app);
137 requestRoutesBMCDumpEntry(app);
138 requestRoutesBMCDumpCreate(app);
139 requestRoutesBMCDumpClear(app);
Claire Weinanfdd26902022-03-01 14:18:25 -0800140
141 requestRoutesFaultLogDumpService(app);
142 requestRoutesFaultLogDumpEntryCollection(app);
143 requestRoutesFaultLogDumpEntry(app);
144 requestRoutesFaultLogDumpClear(app);
raviteja-bc9bb6862020-02-03 11:53:32 -0600145#endif
146
Anthony Wilson08a4e4b2019-04-12 08:23:05 -0500147#ifndef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700148 requestRoutesJournalEventLogEntryCollection(app);
149 requestRoutesJournalEventLogEntry(app);
150 requestRoutesJournalEventLogClear(app);
Anthony Wilson08a4e4b2019-04-12 08:23:05 -0500151#endif
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800152
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700153 requestRoutesBMCLogServiceCollection(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800154#ifdef BMCWEB_ENABLE_REDFISH_BMC_JOURNAL
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700155 requestRoutesBMCJournalLogService(app);
156 requestRoutesBMCJournalLogEntryCollection(app);
157 requestRoutesBMCJournalLogEntry(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800158#endif
Ed Tanous1da66f72018-07-27 16:13:37 -0700159
160#ifdef BMCWEB_ENABLE_REDFISH_CPU_LOG
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700161 requestRoutesCrashdumpService(app);
162 requestRoutesCrashdumpEntryCollection(app);
163 requestRoutesCrashdumpEntry(app);
164 requestRoutesCrashdumpFile(app);
165 requestRoutesCrashdumpClear(app);
166 requestRoutesCrashdumpCollect(app);
Ed Tanous1da66f72018-07-27 16:13:37 -0700167#endif // BMCWEB_ENABLE_REDFISH_CPU_LOG
168
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700169 requestRoutesProcessorCollection(app);
170 requestRoutesProcessor(app);
171 requestRoutesOperatingConfigCollection(app);
172 requestRoutesOperatingConfig(app);
173 requestRoutesMemoryCollection(app);
174 requestRoutesMemory(app);
Rapkiewicz, Pawel443c2932018-10-22 15:08:49 +0200175
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700176 requestRoutesSystemsCollection(app);
177 requestRoutesSystems(app);
178 requestRoutesSystemActionsReset(app);
179 requestRoutesSystemResetActionInfo(app);
180 requestRoutesBiosService(app);
181 requestRoutesBiosReset(app);
Ed Tanous22db1722021-06-09 10:53:51 -0700182
Przemyslaw Czarnowski107077d2019-07-11 10:16:43 +0200183#ifdef BMCWEB_ENABLE_VM_NBDPROXY
Ed Tanous22db1722021-06-09 10:53:51 -0700184 requestNBDVirtualMediaRoutes(app);
Przemyslaw Czarnowski107077d2019-07-11 10:16:43 +0200185#endif // BMCWEB_ENABLE_VM_NBDPROXY
Ed Tanous22db1722021-06-09 10:53:51 -0700186
Andrew Geisslercb92c032018-08-17 07:56:14 -0700187#ifdef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700188 requestRoutesDBusLogServiceActionsClear(app);
189 requestRoutesDBusEventLogEntryCollection(app);
190 requestRoutesDBusEventLogEntry(app);
191 requestRoutesDBusEventLogEntryDownload(app);
Andrew Geisslercb92c032018-08-17 07:56:14 -0700192#endif
Tanousf00032d2018-11-05 01:18:10 -0300193
Spencer Kub7028eb2021-10-26 15:27:35 +0800194#ifdef BMCWEB_ENABLE_REDFISH_HOST_LOGGER
195 requestRoutesSystemHostLogger(app);
196 requestRoutesSystemHostLoggerCollection(app);
197 requestRoutesSystemHostLoggerLogEntry(app);
198#endif
199
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700200 requestRoutesMessageRegistryFileCollection(app);
201 requestRoutesMessageRegistryFile(app);
202 requestRoutesMessageRegistry(app);
Anthony Wilson95a3eca2019-06-11 10:44:47 -0500203
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700204 requestRoutesCertificateService(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700205 requestRoutesHTTPSCertificate(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700206 requestRoutesLDAPCertificate(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700207 requestRoutesTrustStoreCertificate(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600208
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700209 requestRoutesSystemPCIeFunctionCollection(app);
210 requestRoutesSystemPCIeFunction(app);
211 requestRoutesSystemPCIeDeviceCollection(app);
212 requestRoutesSystemPCIeDevice(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600213
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700214 requestRoutesSensorCollection(app);
215 requestRoutesSensor(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600216
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700217 requestRoutesTaskMonitor(app);
218 requestRoutesTaskService(app);
219 requestRoutesTaskCollection(app);
220 requestRoutesTask(app);
221 requestRoutesEventService(app);
222 requestRoutesEventDestinationCollection(app);
223 requestRoutesEventDestination(app);
Sunny Srivastava31791052021-03-12 10:39:16 -0600224 requestRoutesFabricAdapters(app);
225 requestRoutesFabricAdapterCollection(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700226 requestRoutesSubmitTestEvent(app);
227
Ed Tanous88a8a172023-02-28 10:12:56 -0800228 requestRoutesHypervisorSystems(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700229
230 requestRoutesTelemetryService(app);
231 requestRoutesMetricReportDefinitionCollection(app);
232 requestRoutesMetricReportDefinition(app);
233 requestRoutesMetricReportCollection(app);
234 requestRoutesMetricReport(app);
Lukasz Kazmierczak07148cf2021-08-02 11:08:53 +0200235 requestRoutesTriggerCollection(app);
Lukasz Kazmierczak1b7e6962021-08-02 13:40:27 +0200236 requestRoutesTrigger(app);
Ed Tanousf65fca62022-05-24 12:49:41 -0700237
Ed Tanous8c623a92022-05-24 11:54:51 -0700238 // Note, this must be the last route registered
Ed Tanousf65fca62022-05-24 12:49:41 -0700239 requestRoutesRedfish(app);
Borawski.Lukaszc1a46bd2018-02-08 13:31:59 +0100240 }
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +0100241};
242
Ed Tanous1abe55e2018-09-05 08:30:59 -0700243} // namespace redfish