blob: 3d8dae97a9815d8c99da9262dd39d319dbdc30c9 [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"
AppaRao Puli5e44e3d2021-03-16 15:37:24 +000027#include "eventservice_sse.hpp"
Sunny Srivastava31791052021-03-12 10:39:16 -060028#include "fabric_adapters.hpp"
George Liu9516f412022-09-29 17:21:41 +080029#include "fan.hpp"
Nan Zhou4e7efda2022-10-25 21:12:32 +000030#include "hypervisor_system.hpp"
31#include "log_services.hpp"
32#include "manager_diagnostic_data.hpp"
33#include "managers.hpp"
34#include "memory.hpp"
35#include "message_registries.hpp"
36#include "metric_report.hpp"
37#include "metric_report_definition.hpp"
38#include "network_protocol.hpp"
39#include "pcie.hpp"
Ed Tanous4ce2c1b2023-02-10 11:57:54 -080040#include "pcie_slots.hpp"
Nan Zhou4e7efda2022-10-25 21:12:32 +000041#include "power.hpp"
42#include "power_subsystem.hpp"
George Liua7210022022-10-05 15:44:11 +080043#include "power_supply.hpp"
Nan Zhou4e7efda2022-10-25 21:12:32 +000044#include "processor.hpp"
45#include "redfish_sessions.hpp"
46#include "redfish_v1.hpp"
47#include "roles.hpp"
48#include "sensors.hpp"
49#include "service_root.hpp"
50#include "storage.hpp"
51#include "systems.hpp"
52#include "task.hpp"
53#include "telemetry_service.hpp"
54#include "thermal.hpp"
55#include "thermal_subsystem.hpp"
56#include "trigger.hpp"
57#include "update_service.hpp"
58#include "virtual_media.hpp"
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +010059
Ed Tanous1abe55e2018-09-05 08:30:59 -070060namespace redfish
61{
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +010062/*
63 * @brief Top level class installing and providing Redfish services
64 */
Ed Tanous1abe55e2018-09-05 08:30:59 -070065class RedfishService
66{
67 public:
68 /*
69 * @brief Redfish service constructor
70 *
71 * Loads Redfish configuration and installs schema resources
72 *
73 * @param[in] app Crow app on which Redfish will initialize
74 */
Ed Tanous4e23a442022-06-06 09:57:26 -070075 explicit RedfishService(App& app)
Ed Tanous1abe55e2018-09-05 08:30:59 -070076 {
Ed Tanous6c51eab2021-06-03 12:30:29 -070077 requestAccountServiceRoutes(app);
Ed Tanous6c068982023-02-07 15:44:38 -080078#ifdef BMCWEB_ENABLE_REDFISH_AGGREGATION
Carson Labrado8b2521a2023-02-18 02:33:14 +000079 requestRoutesAggregationService(app);
80 requestRoutesAggregationSourceCollection(app);
81 requestRoutesAggregationSource(app);
Ed Tanous6c068982023-02-07 15:44:38 -080082#endif
John Edward Broadbent7e860f12021-04-08 15:57:16 -070083 requestRoutesRoles(app);
84 requestRoutesRoleCollection(app);
85 requestRoutesServiceRoot(app);
86 requestRoutesNetworkProtocol(app);
Ed Tanousfaa34cc2021-06-03 13:27:02 -070087 requestRoutesSession(app);
Ed Tanousbf648f72021-06-03 15:00:14 -070088 requestEthernetInterfacesRoutes(app);
zhanghch050256b692021-06-12 10:26:52 +080089#ifdef BMCWEB_ALLOW_DEPRECATED_POWER_THERMAL
John Edward Broadbent7e860f12021-04-08 15:57:16 -070090 requestRoutesThermal(app);
zhanghch050256b692021-06-12 10:26:52 +080091 requestRoutesPower(app);
92#endif
Xiaochao Ma29739632021-03-02 15:53:13 +080093#ifdef BMCWEB_NEW_POWERSUBSYSTEM_THERMALSUBSYSTEM
Albert Zhang4ca3ec32021-06-13 14:39:38 +080094 requestRoutesEnvironmentMetrics(app);
Chicago Duan77b36432021-02-05 15:48:26 +080095 requestRoutesPowerSubsystem(app);
George Liu00ef5dc2022-10-05 16:27:52 +080096 requestRoutesPowerSupply(app);
George Liua7210022022-10-05 15:44:11 +080097 requestRoutesPowerSupplyCollection(app);
Xiaochao Ma29739632021-03-02 15:53:13 +080098 requestRoutesThermalSubsystem(app);
George Liue4e54232022-09-30 09:08:11 +080099 requestRoutesFan(app);
George Liu9516f412022-09-29 17:21:41 +0800100 requestRoutesFanCollection(app);
Xiaochao Ma29739632021-03-02 15:53:13 +0800101#endif
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700102 requestRoutesManagerCollection(app);
103 requestRoutesManager(app);
104 requestRoutesManagerResetAction(app);
105 requestRoutesManagerResetActionInfo(app);
106 requestRoutesManagerResetToDefaultsAction(app);
Sui Chena51fc2d2022-07-14 17:21:53 -0700107 requestRoutesManagerDiagnosticData(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700108 requestRoutesChassisCollection(app);
109 requestRoutesChassis(app);
110 requestRoutesChassisResetAction(app);
111 requestRoutesChassisResetActionInfo(app);
John Edward Broadbent92903bd2022-04-26 13:40:59 -0700112 requestRoutesChassisDrive(app);
John Edward Broadbente56ed6b2022-04-26 13:40:59 -0700113 requestRoutesChassisDriveName(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700114 requestRoutesUpdateService(app);
115 requestRoutesStorageCollection(app);
116 requestRoutesStorage(app);
Willy Tu61b1eb22023-03-14 11:29:50 -0700117 requestRoutesStorageControllerCollection(app);
118 requestRoutesStorageController(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700119 requestRoutesDrive(app);
Shantappa Teekappanavar9c929be2021-12-16 19:02:52 -0600120 requestRoutesCable(app);
121 requestRoutesCableCollection(app);
Andrew Geissler0554c982019-04-23 14:40:12 -0500122#ifdef BMCWEB_INSECURE_ENABLE_REDFISH_FW_TFTP_UPDATE
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700123 requestRoutesUpdateServiceActionsSimpleUpdate(app);
Andrew Geissler0554c982019-04-23 14:40:12 -0500124#endif
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700125 requestRoutesSoftwareInventoryCollection(app);
126 requestRoutesSoftwareInventory(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800127
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700128 requestRoutesSystemLogServiceCollection(app);
129 requestRoutesEventLogService(app);
George Liu647b3cd2021-07-05 12:43:56 +0800130 requestRoutesPostCodesEntryAdditionalData(app);
ZhikuiRena3316fc2020-01-29 14:58:08 -0800131
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700132 requestRoutesPostCodesLogService(app);
133 requestRoutesPostCodesClear(app);
134 requestRoutesPostCodesEntry(app);
135 requestRoutesPostCodesEntryCollection(app);
ZhikuiRena3316fc2020-01-29 14:58:08 -0800136
Asmitha Karunanithi5cb1dd22020-05-07 04:35:02 -0500137#ifdef BMCWEB_ENABLE_REDFISH_DUMP_LOG
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700138 requestRoutesSystemDumpService(app);
139 requestRoutesSystemDumpEntryCollection(app);
140 requestRoutesSystemDumpEntry(app);
141 requestRoutesSystemDumpCreate(app);
142 requestRoutesSystemDumpClear(app);
Asmitha Karunanithi5cb1dd22020-05-07 04:35:02 -0500143
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700144 requestRoutesBMCDumpService(app);
145 requestRoutesBMCDumpEntryCollection(app);
146 requestRoutesBMCDumpEntry(app);
147 requestRoutesBMCDumpCreate(app);
148 requestRoutesBMCDumpClear(app);
Claire Weinanfdd26902022-03-01 14:18:25 -0800149
150 requestRoutesFaultLogDumpService(app);
151 requestRoutesFaultLogDumpEntryCollection(app);
152 requestRoutesFaultLogDumpEntry(app);
153 requestRoutesFaultLogDumpClear(app);
raviteja-bc9bb6862020-02-03 11:53:32 -0600154#endif
155
Anthony Wilson08a4e4b2019-04-12 08:23:05 -0500156#ifndef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700157 requestRoutesJournalEventLogEntryCollection(app);
158 requestRoutesJournalEventLogEntry(app);
159 requestRoutesJournalEventLogClear(app);
Anthony Wilson08a4e4b2019-04-12 08:23:05 -0500160#endif
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800161
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700162 requestRoutesBMCLogServiceCollection(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800163#ifdef BMCWEB_ENABLE_REDFISH_BMC_JOURNAL
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700164 requestRoutesBMCJournalLogService(app);
165 requestRoutesBMCJournalLogEntryCollection(app);
166 requestRoutesBMCJournalLogEntry(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800167#endif
Ed Tanous1da66f72018-07-27 16:13:37 -0700168
169#ifdef BMCWEB_ENABLE_REDFISH_CPU_LOG
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700170 requestRoutesCrashdumpService(app);
171 requestRoutesCrashdumpEntryCollection(app);
172 requestRoutesCrashdumpEntry(app);
173 requestRoutesCrashdumpFile(app);
174 requestRoutesCrashdumpClear(app);
175 requestRoutesCrashdumpCollect(app);
Ed Tanous1da66f72018-07-27 16:13:37 -0700176#endif // BMCWEB_ENABLE_REDFISH_CPU_LOG
177
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700178 requestRoutesProcessorCollection(app);
179 requestRoutesProcessor(app);
180 requestRoutesOperatingConfigCollection(app);
181 requestRoutesOperatingConfig(app);
182 requestRoutesMemoryCollection(app);
183 requestRoutesMemory(app);
Rapkiewicz, Pawel443c2932018-10-22 15:08:49 +0200184
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700185 requestRoutesSystems(app);
Ed Tanous100afe52023-06-07 13:30:46 -0700186
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700187 requestRoutesBiosService(app);
188 requestRoutesBiosReset(app);
Ed Tanous22db1722021-06-09 10:53:51 -0700189
Przemyslaw Czarnowski107077d2019-07-11 10:16:43 +0200190#ifdef BMCWEB_ENABLE_VM_NBDPROXY
Ed Tanous22db1722021-06-09 10:53:51 -0700191 requestNBDVirtualMediaRoutes(app);
Przemyslaw Czarnowski107077d2019-07-11 10:16:43 +0200192#endif // BMCWEB_ENABLE_VM_NBDPROXY
Ed Tanous22db1722021-06-09 10:53:51 -0700193
Andrew Geisslercb92c032018-08-17 07:56:14 -0700194#ifdef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700195 requestRoutesDBusLogServiceActionsClear(app);
196 requestRoutesDBusEventLogEntryCollection(app);
197 requestRoutesDBusEventLogEntry(app);
198 requestRoutesDBusEventLogEntryDownload(app);
Andrew Geisslercb92c032018-08-17 07:56:14 -0700199#endif
Tanousf00032d2018-11-05 01:18:10 -0300200
Spencer Kub7028eb2021-10-26 15:27:35 +0800201#ifdef BMCWEB_ENABLE_REDFISH_HOST_LOGGER
202 requestRoutesSystemHostLogger(app);
203 requestRoutesSystemHostLoggerCollection(app);
204 requestRoutesSystemHostLoggerLogEntry(app);
205#endif
206
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700207 requestRoutesMessageRegistryFileCollection(app);
208 requestRoutesMessageRegistryFile(app);
209 requestRoutesMessageRegistry(app);
Anthony Wilson95a3eca2019-06-11 10:44:47 -0500210
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700211 requestRoutesCertificateService(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700212 requestRoutesHTTPSCertificate(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700213 requestRoutesLDAPCertificate(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700214 requestRoutesTrustStoreCertificate(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600215
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700216 requestRoutesSystemPCIeFunctionCollection(app);
217 requestRoutesSystemPCIeFunction(app);
218 requestRoutesSystemPCIeDeviceCollection(app);
219 requestRoutesSystemPCIeDevice(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600220
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700221 requestRoutesSensorCollection(app);
222 requestRoutesSensor(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600223
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700224 requestRoutesTaskMonitor(app);
225 requestRoutesTaskService(app);
226 requestRoutesTaskCollection(app);
227 requestRoutesTask(app);
228 requestRoutesEventService(app);
AppaRao Puli5e44e3d2021-03-16 15:37:24 +0000229 requestRoutesEventServiceSse(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700230 requestRoutesEventDestinationCollection(app);
231 requestRoutesEventDestination(app);
Sunny Srivastava31791052021-03-12 10:39:16 -0600232 requestRoutesFabricAdapters(app);
233 requestRoutesFabricAdapterCollection(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700234 requestRoutesSubmitTestEvent(app);
235
Ed Tanous88a8a172023-02-28 10:12:56 -0800236 requestRoutesHypervisorSystems(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700237
238 requestRoutesTelemetryService(app);
239 requestRoutesMetricReportDefinitionCollection(app);
240 requestRoutesMetricReportDefinition(app);
241 requestRoutesMetricReportCollection(app);
242 requestRoutesMetricReport(app);
Lukasz Kazmierczak07148cf2021-08-02 11:08:53 +0200243 requestRoutesTriggerCollection(app);
Lukasz Kazmierczak1b7e6962021-08-02 13:40:27 +0200244 requestRoutesTrigger(app);
Ed Tanousf65fca62022-05-24 12:49:41 -0700245
Ed Tanous8c623a92022-05-24 11:54:51 -0700246 // Note, this must be the last route registered
Ed Tanousf65fca62022-05-24 12:49:41 -0700247 requestRoutesRedfish(app);
Borawski.Lukaszc1a46bd2018-02-08 13:31:59 +0100248 }
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +0100249};
250
Ed Tanous1abe55e2018-09-05 08:30:59 -0700251} // namespace redfish