blob: 2bf0f4578ee9ea697469b348641d6baca705089a [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"
George Liua7210022022-10-05 15:44:11 +080041#include "power_supply.hpp"
Nan Zhou4e7efda2022-10-25 21:12:32 +000042#include "processor.hpp"
43#include "redfish_sessions.hpp"
44#include "redfish_v1.hpp"
45#include "roles.hpp"
46#include "sensors.hpp"
47#include "service_root.hpp"
48#include "storage.hpp"
49#include "systems.hpp"
50#include "task.hpp"
51#include "telemetry_service.hpp"
52#include "thermal.hpp"
53#include "thermal_subsystem.hpp"
54#include "trigger.hpp"
55#include "update_service.hpp"
56#include "virtual_media.hpp"
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +010057
Ed Tanous1abe55e2018-09-05 08:30:59 -070058namespace redfish
59{
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +010060/*
61 * @brief Top level class installing and providing Redfish services
62 */
Ed Tanous1abe55e2018-09-05 08:30:59 -070063class RedfishService
64{
65 public:
66 /*
67 * @brief Redfish service constructor
68 *
69 * Loads Redfish configuration and installs schema resources
70 *
71 * @param[in] app Crow app on which Redfish will initialize
72 */
Ed Tanous4e23a442022-06-06 09:57:26 -070073 explicit RedfishService(App& app)
Ed Tanous1abe55e2018-09-05 08:30:59 -070074 {
Ed Tanous6c51eab2021-06-03 12:30:29 -070075 requestAccountServiceRoutes(app);
Ed Tanous6c068982023-02-07 15:44:38 -080076#ifdef BMCWEB_ENABLE_REDFISH_AGGREGATION
Carson Labrado8b2521a2023-02-18 02:33:14 +000077 requestRoutesAggregationService(app);
78 requestRoutesAggregationSourceCollection(app);
79 requestRoutesAggregationSource(app);
Ed Tanous6c068982023-02-07 15:44:38 -080080#endif
John Edward Broadbent7e860f12021-04-08 15:57:16 -070081 requestRoutesRoles(app);
82 requestRoutesRoleCollection(app);
83 requestRoutesServiceRoot(app);
84 requestRoutesNetworkProtocol(app);
Ed Tanousfaa34cc2021-06-03 13:27:02 -070085 requestRoutesSession(app);
Ed Tanousbf648f72021-06-03 15:00:14 -070086 requestEthernetInterfacesRoutes(app);
zhanghch050256b692021-06-12 10:26:52 +080087#ifdef BMCWEB_ALLOW_DEPRECATED_POWER_THERMAL
John Edward Broadbent7e860f12021-04-08 15:57:16 -070088 requestRoutesThermal(app);
zhanghch050256b692021-06-12 10:26:52 +080089 requestRoutesPower(app);
90#endif
Xiaochao Ma29739632021-03-02 15:53:13 +080091#ifdef BMCWEB_NEW_POWERSUBSYSTEM_THERMALSUBSYSTEM
Albert Zhang4ca3ec32021-06-13 14:39:38 +080092 requestRoutesEnvironmentMetrics(app);
Chicago Duan77b36432021-02-05 15:48:26 +080093 requestRoutesPowerSubsystem(app);
George Liu00ef5dc2022-10-05 16:27:52 +080094 requestRoutesPowerSupply(app);
George Liua7210022022-10-05 15:44:11 +080095 requestRoutesPowerSupplyCollection(app);
Xiaochao Ma29739632021-03-02 15:53:13 +080096 requestRoutesThermalSubsystem(app);
97#endif
John Edward Broadbent7e860f12021-04-08 15:57:16 -070098 requestRoutesManagerCollection(app);
99 requestRoutesManager(app);
100 requestRoutesManagerResetAction(app);
101 requestRoutesManagerResetActionInfo(app);
102 requestRoutesManagerResetToDefaultsAction(app);
Sui Chena51fc2d2022-07-14 17:21:53 -0700103 requestRoutesManagerDiagnosticData(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700104 requestRoutesChassisCollection(app);
105 requestRoutesChassis(app);
106 requestRoutesChassisResetAction(app);
107 requestRoutesChassisResetActionInfo(app);
John Edward Broadbent92903bd2022-04-26 13:40:59 -0700108 requestRoutesChassisDrive(app);
John Edward Broadbente56ed6b2022-04-26 13:40:59 -0700109 requestRoutesChassisDriveName(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700110 requestRoutesUpdateService(app);
111 requestRoutesStorageCollection(app);
112 requestRoutesStorage(app);
113 requestRoutesDrive(app);
Shantappa Teekappanavar9c929be2021-12-16 19:02:52 -0600114 requestRoutesCable(app);
115 requestRoutesCableCollection(app);
Andrew Geissler0554c982019-04-23 14:40:12 -0500116#ifdef BMCWEB_INSECURE_ENABLE_REDFISH_FW_TFTP_UPDATE
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700117 requestRoutesUpdateServiceActionsSimpleUpdate(app);
Andrew Geissler0554c982019-04-23 14:40:12 -0500118#endif
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700119 requestRoutesSoftwareInventoryCollection(app);
120 requestRoutesSoftwareInventory(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800121
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700122 requestRoutesSystemLogServiceCollection(app);
123 requestRoutesEventLogService(app);
George Liu647b3cd2021-07-05 12:43:56 +0800124 requestRoutesPostCodesEntryAdditionalData(app);
ZhikuiRena3316fc2020-01-29 14:58:08 -0800125
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700126 requestRoutesPostCodesLogService(app);
127 requestRoutesPostCodesClear(app);
128 requestRoutesPostCodesEntry(app);
129 requestRoutesPostCodesEntryCollection(app);
ZhikuiRena3316fc2020-01-29 14:58:08 -0800130
Asmitha Karunanithi5cb1dd22020-05-07 04:35:02 -0500131#ifdef BMCWEB_ENABLE_REDFISH_DUMP_LOG
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700132 requestRoutesSystemDumpService(app);
133 requestRoutesSystemDumpEntryCollection(app);
134 requestRoutesSystemDumpEntry(app);
135 requestRoutesSystemDumpCreate(app);
136 requestRoutesSystemDumpClear(app);
Asmitha Karunanithi5cb1dd22020-05-07 04:35:02 -0500137
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700138 requestRoutesBMCDumpService(app);
139 requestRoutesBMCDumpEntryCollection(app);
140 requestRoutesBMCDumpEntry(app);
141 requestRoutesBMCDumpCreate(app);
142 requestRoutesBMCDumpClear(app);
Claire Weinanfdd26902022-03-01 14:18:25 -0800143
144 requestRoutesFaultLogDumpService(app);
145 requestRoutesFaultLogDumpEntryCollection(app);
146 requestRoutesFaultLogDumpEntry(app);
147 requestRoutesFaultLogDumpClear(app);
raviteja-bc9bb6862020-02-03 11:53:32 -0600148#endif
149
Anthony Wilson08a4e4b2019-04-12 08:23:05 -0500150#ifndef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700151 requestRoutesJournalEventLogEntryCollection(app);
152 requestRoutesJournalEventLogEntry(app);
153 requestRoutesJournalEventLogClear(app);
Anthony Wilson08a4e4b2019-04-12 08:23:05 -0500154#endif
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800155
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700156 requestRoutesBMCLogServiceCollection(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800157#ifdef BMCWEB_ENABLE_REDFISH_BMC_JOURNAL
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700158 requestRoutesBMCJournalLogService(app);
159 requestRoutesBMCJournalLogEntryCollection(app);
160 requestRoutesBMCJournalLogEntry(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800161#endif
Ed Tanous1da66f72018-07-27 16:13:37 -0700162
163#ifdef BMCWEB_ENABLE_REDFISH_CPU_LOG
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700164 requestRoutesCrashdumpService(app);
165 requestRoutesCrashdumpEntryCollection(app);
166 requestRoutesCrashdumpEntry(app);
167 requestRoutesCrashdumpFile(app);
168 requestRoutesCrashdumpClear(app);
169 requestRoutesCrashdumpCollect(app);
Ed Tanous1da66f72018-07-27 16:13:37 -0700170#endif // BMCWEB_ENABLE_REDFISH_CPU_LOG
171
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700172 requestRoutesProcessorCollection(app);
173 requestRoutesProcessor(app);
174 requestRoutesOperatingConfigCollection(app);
175 requestRoutesOperatingConfig(app);
176 requestRoutesMemoryCollection(app);
177 requestRoutesMemory(app);
Rapkiewicz, Pawel443c2932018-10-22 15:08:49 +0200178
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700179 requestRoutesSystemsCollection(app);
180 requestRoutesSystems(app);
181 requestRoutesSystemActionsReset(app);
182 requestRoutesSystemResetActionInfo(app);
183 requestRoutesBiosService(app);
184 requestRoutesBiosReset(app);
Ed Tanous22db1722021-06-09 10:53:51 -0700185
Przemyslaw Czarnowski107077d2019-07-11 10:16:43 +0200186#ifdef BMCWEB_ENABLE_VM_NBDPROXY
Ed Tanous22db1722021-06-09 10:53:51 -0700187 requestNBDVirtualMediaRoutes(app);
Przemyslaw Czarnowski107077d2019-07-11 10:16:43 +0200188#endif // BMCWEB_ENABLE_VM_NBDPROXY
Ed Tanous22db1722021-06-09 10:53:51 -0700189
Andrew Geisslercb92c032018-08-17 07:56:14 -0700190#ifdef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700191 requestRoutesDBusLogServiceActionsClear(app);
192 requestRoutesDBusEventLogEntryCollection(app);
193 requestRoutesDBusEventLogEntry(app);
194 requestRoutesDBusEventLogEntryDownload(app);
Andrew Geisslercb92c032018-08-17 07:56:14 -0700195#endif
Tanousf00032d2018-11-05 01:18:10 -0300196
Spencer Kub7028eb2021-10-26 15:27:35 +0800197#ifdef BMCWEB_ENABLE_REDFISH_HOST_LOGGER
198 requestRoutesSystemHostLogger(app);
199 requestRoutesSystemHostLoggerCollection(app);
200 requestRoutesSystemHostLoggerLogEntry(app);
201#endif
202
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700203 requestRoutesMessageRegistryFileCollection(app);
204 requestRoutesMessageRegistryFile(app);
205 requestRoutesMessageRegistry(app);
Anthony Wilson95a3eca2019-06-11 10:44:47 -0500206
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700207 requestRoutesCertificateService(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700208 requestRoutesHTTPSCertificate(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700209 requestRoutesLDAPCertificate(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700210 requestRoutesTrustStoreCertificate(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600211
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700212 requestRoutesSystemPCIeFunctionCollection(app);
213 requestRoutesSystemPCIeFunction(app);
214 requestRoutesSystemPCIeDeviceCollection(app);
215 requestRoutesSystemPCIeDevice(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600216
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700217 requestRoutesSensorCollection(app);
218 requestRoutesSensor(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600219
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700220 requestRoutesTaskMonitor(app);
221 requestRoutesTaskService(app);
222 requestRoutesTaskCollection(app);
223 requestRoutesTask(app);
224 requestRoutesEventService(app);
225 requestRoutesEventDestinationCollection(app);
226 requestRoutesEventDestination(app);
Sunny Srivastava31791052021-03-12 10:39:16 -0600227 requestRoutesFabricAdapters(app);
228 requestRoutesFabricAdapterCollection(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700229 requestRoutesSubmitTestEvent(app);
230
Ed Tanous88a8a172023-02-28 10:12:56 -0800231 requestRoutesHypervisorSystems(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700232
233 requestRoutesTelemetryService(app);
234 requestRoutesMetricReportDefinitionCollection(app);
235 requestRoutesMetricReportDefinition(app);
236 requestRoutesMetricReportCollection(app);
237 requestRoutesMetricReport(app);
Lukasz Kazmierczak07148cf2021-08-02 11:08:53 +0200238 requestRoutesTriggerCollection(app);
Lukasz Kazmierczak1b7e6962021-08-02 13:40:27 +0200239 requestRoutesTrigger(app);
Ed Tanousf65fca62022-05-24 12:49:41 -0700240
Ed Tanous8c623a92022-05-24 11:54:51 -0700241 // Note, this must be the last route registered
Ed Tanousf65fca62022-05-24 12:49:41 -0700242 requestRoutesRedfish(app);
Borawski.Lukaszc1a46bd2018-02-08 13:31:59 +0100243 }
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +0100244};
245
Ed Tanous1abe55e2018-09-05 08:30:59 -0700246} // namespace redfish