blob: 8e7b4116b1cff709cee4645c9161888d47343169 [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"
Nan Zhou4e7efda2022-10-25 21:12:32 +000029#include "hypervisor_system.hpp"
30#include "log_services.hpp"
31#include "manager_diagnostic_data.hpp"
32#include "managers.hpp"
33#include "memory.hpp"
34#include "message_registries.hpp"
35#include "metric_report.hpp"
36#include "metric_report_definition.hpp"
37#include "network_protocol.hpp"
38#include "pcie.hpp"
Ed Tanous4ce2c1b2023-02-10 11:57:54 -080039#include "pcie_slots.hpp"
Nan Zhou4e7efda2022-10-25 21:12:32 +000040#include "power.hpp"
41#include "power_subsystem.hpp"
George Liua7210022022-10-05 15:44:11 +080042#include "power_supply.hpp"
Nan Zhou4e7efda2022-10-25 21:12:32 +000043#include "processor.hpp"
44#include "redfish_sessions.hpp"
45#include "redfish_v1.hpp"
46#include "roles.hpp"
47#include "sensors.hpp"
48#include "service_root.hpp"
49#include "storage.hpp"
50#include "systems.hpp"
51#include "task.hpp"
52#include "telemetry_service.hpp"
53#include "thermal.hpp"
54#include "thermal_subsystem.hpp"
55#include "trigger.hpp"
56#include "update_service.hpp"
57#include "virtual_media.hpp"
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +010058
Ed Tanous1abe55e2018-09-05 08:30:59 -070059namespace redfish
60{
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +010061/*
62 * @brief Top level class installing and providing Redfish services
63 */
Ed Tanous1abe55e2018-09-05 08:30:59 -070064class RedfishService
65{
66 public:
67 /*
68 * @brief Redfish service constructor
69 *
70 * Loads Redfish configuration and installs schema resources
71 *
72 * @param[in] app Crow app on which Redfish will initialize
73 */
Ed Tanous4e23a442022-06-06 09:57:26 -070074 explicit RedfishService(App& app)
Ed Tanous1abe55e2018-09-05 08:30:59 -070075 {
Ed Tanous6c51eab2021-06-03 12:30:29 -070076 requestAccountServiceRoutes(app);
Ed Tanous6c068982023-02-07 15:44:38 -080077#ifdef BMCWEB_ENABLE_REDFISH_AGGREGATION
Carson Labrado8b2521a2023-02-18 02:33:14 +000078 requestRoutesAggregationService(app);
79 requestRoutesAggregationSourceCollection(app);
80 requestRoutesAggregationSource(app);
Ed Tanous6c068982023-02-07 15:44:38 -080081#endif
John Edward Broadbent7e860f12021-04-08 15:57:16 -070082 requestRoutesRoles(app);
83 requestRoutesRoleCollection(app);
84 requestRoutesServiceRoot(app);
85 requestRoutesNetworkProtocol(app);
Ed Tanousfaa34cc2021-06-03 13:27:02 -070086 requestRoutesSession(app);
Ed Tanousbf648f72021-06-03 15:00:14 -070087 requestEthernetInterfacesRoutes(app);
zhanghch050256b692021-06-12 10:26:52 +080088#ifdef BMCWEB_ALLOW_DEPRECATED_POWER_THERMAL
John Edward Broadbent7e860f12021-04-08 15:57:16 -070089 requestRoutesThermal(app);
zhanghch050256b692021-06-12 10:26:52 +080090 requestRoutesPower(app);
91#endif
Xiaochao Ma29739632021-03-02 15:53:13 +080092#ifdef BMCWEB_NEW_POWERSUBSYSTEM_THERMALSUBSYSTEM
Albert Zhang4ca3ec32021-06-13 14:39:38 +080093 requestRoutesEnvironmentMetrics(app);
Chicago Duan77b36432021-02-05 15:48:26 +080094 requestRoutesPowerSubsystem(app);
George Liu00ef5dc2022-10-05 16:27:52 +080095 requestRoutesPowerSupply(app);
George Liua7210022022-10-05 15:44:11 +080096 requestRoutesPowerSupplyCollection(app);
Xiaochao Ma29739632021-03-02 15:53:13 +080097 requestRoutesThermalSubsystem(app);
98#endif
John Edward Broadbent7e860f12021-04-08 15:57:16 -070099 requestRoutesManagerCollection(app);
100 requestRoutesManager(app);
101 requestRoutesManagerResetAction(app);
102 requestRoutesManagerResetActionInfo(app);
103 requestRoutesManagerResetToDefaultsAction(app);
Sui Chena51fc2d2022-07-14 17:21:53 -0700104 requestRoutesManagerDiagnosticData(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700105 requestRoutesChassisCollection(app);
106 requestRoutesChassis(app);
107 requestRoutesChassisResetAction(app);
108 requestRoutesChassisResetActionInfo(app);
John Edward Broadbent92903bd2022-04-26 13:40:59 -0700109 requestRoutesChassisDrive(app);
John Edward Broadbente56ed6b2022-04-26 13:40:59 -0700110 requestRoutesChassisDriveName(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700111 requestRoutesUpdateService(app);
112 requestRoutesStorageCollection(app);
113 requestRoutesStorage(app);
114 requestRoutesDrive(app);
Shantappa Teekappanavar9c929be2021-12-16 19:02:52 -0600115 requestRoutesCable(app);
116 requestRoutesCableCollection(app);
Andrew Geissler0554c982019-04-23 14:40:12 -0500117#ifdef BMCWEB_INSECURE_ENABLE_REDFISH_FW_TFTP_UPDATE
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700118 requestRoutesUpdateServiceActionsSimpleUpdate(app);
Andrew Geissler0554c982019-04-23 14:40:12 -0500119#endif
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700120 requestRoutesSoftwareInventoryCollection(app);
121 requestRoutesSoftwareInventory(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800122
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700123 requestRoutesSystemLogServiceCollection(app);
124 requestRoutesEventLogService(app);
George Liu647b3cd2021-07-05 12:43:56 +0800125 requestRoutesPostCodesEntryAdditionalData(app);
ZhikuiRena3316fc2020-01-29 14:58:08 -0800126
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700127 requestRoutesPostCodesLogService(app);
128 requestRoutesPostCodesClear(app);
129 requestRoutesPostCodesEntry(app);
130 requestRoutesPostCodesEntryCollection(app);
ZhikuiRena3316fc2020-01-29 14:58:08 -0800131
Asmitha Karunanithi5cb1dd22020-05-07 04:35:02 -0500132#ifdef BMCWEB_ENABLE_REDFISH_DUMP_LOG
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700133 requestRoutesSystemDumpService(app);
134 requestRoutesSystemDumpEntryCollection(app);
135 requestRoutesSystemDumpEntry(app);
136 requestRoutesSystemDumpCreate(app);
137 requestRoutesSystemDumpClear(app);
Asmitha Karunanithi5cb1dd22020-05-07 04:35:02 -0500138
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700139 requestRoutesBMCDumpService(app);
140 requestRoutesBMCDumpEntryCollection(app);
141 requestRoutesBMCDumpEntry(app);
142 requestRoutesBMCDumpCreate(app);
143 requestRoutesBMCDumpClear(app);
Claire Weinanfdd26902022-03-01 14:18:25 -0800144
145 requestRoutesFaultLogDumpService(app);
146 requestRoutesFaultLogDumpEntryCollection(app);
147 requestRoutesFaultLogDumpEntry(app);
148 requestRoutesFaultLogDumpClear(app);
raviteja-bc9bb6862020-02-03 11:53:32 -0600149#endif
150
Anthony Wilson08a4e4b2019-04-12 08:23:05 -0500151#ifndef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700152 requestRoutesJournalEventLogEntryCollection(app);
153 requestRoutesJournalEventLogEntry(app);
154 requestRoutesJournalEventLogClear(app);
Anthony Wilson08a4e4b2019-04-12 08:23:05 -0500155#endif
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800156
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700157 requestRoutesBMCLogServiceCollection(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800158#ifdef BMCWEB_ENABLE_REDFISH_BMC_JOURNAL
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700159 requestRoutesBMCJournalLogService(app);
160 requestRoutesBMCJournalLogEntryCollection(app);
161 requestRoutesBMCJournalLogEntry(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800162#endif
Ed Tanous1da66f72018-07-27 16:13:37 -0700163
164#ifdef BMCWEB_ENABLE_REDFISH_CPU_LOG
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700165 requestRoutesCrashdumpService(app);
166 requestRoutesCrashdumpEntryCollection(app);
167 requestRoutesCrashdumpEntry(app);
168 requestRoutesCrashdumpFile(app);
169 requestRoutesCrashdumpClear(app);
170 requestRoutesCrashdumpCollect(app);
Ed Tanous1da66f72018-07-27 16:13:37 -0700171#endif // BMCWEB_ENABLE_REDFISH_CPU_LOG
172
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700173 requestRoutesProcessorCollection(app);
174 requestRoutesProcessor(app);
175 requestRoutesOperatingConfigCollection(app);
176 requestRoutesOperatingConfig(app);
177 requestRoutesMemoryCollection(app);
178 requestRoutesMemory(app);
Rapkiewicz, Pawel443c2932018-10-22 15:08:49 +0200179
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700180 requestRoutesSystemsCollection(app);
181 requestRoutesSystems(app);
182 requestRoutesSystemActionsReset(app);
183 requestRoutesSystemResetActionInfo(app);
184 requestRoutesBiosService(app);
185 requestRoutesBiosReset(app);
Ed Tanous22db1722021-06-09 10:53:51 -0700186
Przemyslaw Czarnowski107077d2019-07-11 10:16:43 +0200187#ifdef BMCWEB_ENABLE_VM_NBDPROXY
Ed Tanous22db1722021-06-09 10:53:51 -0700188 requestNBDVirtualMediaRoutes(app);
Przemyslaw Czarnowski107077d2019-07-11 10:16:43 +0200189#endif // BMCWEB_ENABLE_VM_NBDPROXY
Ed Tanous22db1722021-06-09 10:53:51 -0700190
Andrew Geisslercb92c032018-08-17 07:56:14 -0700191#ifdef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700192 requestRoutesDBusLogServiceActionsClear(app);
193 requestRoutesDBusEventLogEntryCollection(app);
194 requestRoutesDBusEventLogEntry(app);
195 requestRoutesDBusEventLogEntryDownload(app);
Andrew Geisslercb92c032018-08-17 07:56:14 -0700196#endif
Tanousf00032d2018-11-05 01:18:10 -0300197
Spencer Kub7028eb2021-10-26 15:27:35 +0800198#ifdef BMCWEB_ENABLE_REDFISH_HOST_LOGGER
199 requestRoutesSystemHostLogger(app);
200 requestRoutesSystemHostLoggerCollection(app);
201 requestRoutesSystemHostLoggerLogEntry(app);
202#endif
203
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700204 requestRoutesMessageRegistryFileCollection(app);
205 requestRoutesMessageRegistryFile(app);
206 requestRoutesMessageRegistry(app);
Anthony Wilson95a3eca2019-06-11 10:44:47 -0500207
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700208 requestRoutesCertificateService(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700209 requestRoutesHTTPSCertificate(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700210 requestRoutesLDAPCertificate(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700211 requestRoutesTrustStoreCertificate(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600212
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700213 requestRoutesSystemPCIeFunctionCollection(app);
214 requestRoutesSystemPCIeFunction(app);
215 requestRoutesSystemPCIeDeviceCollection(app);
216 requestRoutesSystemPCIeDevice(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600217
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700218 requestRoutesSensorCollection(app);
219 requestRoutesSensor(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600220
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700221 requestRoutesTaskMonitor(app);
222 requestRoutesTaskService(app);
223 requestRoutesTaskCollection(app);
224 requestRoutesTask(app);
225 requestRoutesEventService(app);
AppaRao Puli5e44e3d2021-03-16 15:37:24 +0000226 requestRoutesEventServiceSse(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700227 requestRoutesEventDestinationCollection(app);
228 requestRoutesEventDestination(app);
Sunny Srivastava31791052021-03-12 10:39:16 -0600229 requestRoutesFabricAdapters(app);
230 requestRoutesFabricAdapterCollection(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700231 requestRoutesSubmitTestEvent(app);
232
Ed Tanous88a8a172023-02-28 10:12:56 -0800233 requestRoutesHypervisorSystems(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700234
235 requestRoutesTelemetryService(app);
236 requestRoutesMetricReportDefinitionCollection(app);
237 requestRoutesMetricReportDefinition(app);
238 requestRoutesMetricReportCollection(app);
239 requestRoutesMetricReport(app);
Lukasz Kazmierczak07148cf2021-08-02 11:08:53 +0200240 requestRoutesTriggerCollection(app);
Lukasz Kazmierczak1b7e6962021-08-02 13:40:27 +0200241 requestRoutesTrigger(app);
Ed Tanousf65fca62022-05-24 12:49:41 -0700242
Ed Tanous8c623a92022-05-24 11:54:51 -0700243 // Note, this must be the last route registered
Ed Tanousf65fca62022-05-24 12:49:41 -0700244 requestRoutesRedfish(app);
Borawski.Lukaszc1a46bd2018-02-08 13:31:59 +0100245 }
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +0100246};
247
Ed Tanous1abe55e2018-09-05 08:30:59 -0700248} // namespace redfish