blob: 89d5679d1f088d7130b0c37cc35422533ecb7bf3 [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"
zhanghch055ae1f7f2021-03-08 19:04:35 +080055#include "thermal_metrics.hpp"
Nan Zhou4e7efda2022-10-25 21:12:32 +000056#include "thermal_subsystem.hpp"
57#include "trigger.hpp"
58#include "update_service.hpp"
59#include "virtual_media.hpp"
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +010060
Ed Tanous1abe55e2018-09-05 08:30:59 -070061namespace redfish
62{
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +010063/*
64 * @brief Top level class installing and providing Redfish services
65 */
Ed Tanous1abe55e2018-09-05 08:30:59 -070066class RedfishService
67{
68 public:
69 /*
70 * @brief Redfish service constructor
71 *
72 * Loads Redfish configuration and installs schema resources
73 *
74 * @param[in] app Crow app on which Redfish will initialize
75 */
Ed Tanous4e23a442022-06-06 09:57:26 -070076 explicit RedfishService(App& app)
Ed Tanous1abe55e2018-09-05 08:30:59 -070077 {
Ed Tanous6c51eab2021-06-03 12:30:29 -070078 requestAccountServiceRoutes(app);
Ed Tanous6c068982023-02-07 15:44:38 -080079#ifdef BMCWEB_ENABLE_REDFISH_AGGREGATION
Carson Labrado8b2521a2023-02-18 02:33:14 +000080 requestRoutesAggregationService(app);
81 requestRoutesAggregationSourceCollection(app);
82 requestRoutesAggregationSource(app);
Ed Tanous6c068982023-02-07 15:44:38 -080083#endif
John Edward Broadbent7e860f12021-04-08 15:57:16 -070084 requestRoutesRoles(app);
85 requestRoutesRoleCollection(app);
86 requestRoutesServiceRoot(app);
87 requestRoutesNetworkProtocol(app);
Ed Tanousfaa34cc2021-06-03 13:27:02 -070088 requestRoutesSession(app);
Ed Tanousbf648f72021-06-03 15:00:14 -070089 requestEthernetInterfacesRoutes(app);
zhanghch050256b692021-06-12 10:26:52 +080090#ifdef BMCWEB_ALLOW_DEPRECATED_POWER_THERMAL
John Edward Broadbent7e860f12021-04-08 15:57:16 -070091 requestRoutesThermal(app);
zhanghch050256b692021-06-12 10:26:52 +080092 requestRoutesPower(app);
93#endif
Xiaochao Ma29739632021-03-02 15:53:13 +080094#ifdef BMCWEB_NEW_POWERSUBSYSTEM_THERMALSUBSYSTEM
Albert Zhang4ca3ec32021-06-13 14:39:38 +080095 requestRoutesEnvironmentMetrics(app);
Chicago Duan77b36432021-02-05 15:48:26 +080096 requestRoutesPowerSubsystem(app);
George Liu00ef5dc2022-10-05 16:27:52 +080097 requestRoutesPowerSupply(app);
George Liua7210022022-10-05 15:44:11 +080098 requestRoutesPowerSupplyCollection(app);
zhanghch055ae1f7f2021-03-08 19:04:35 +080099 requestRoutesThermalMetrics(app);
Xiaochao Ma29739632021-03-02 15:53:13 +0800100 requestRoutesThermalSubsystem(app);
George Liue4e54232022-09-30 09:08:11 +0800101 requestRoutesFan(app);
George Liu9516f412022-09-29 17:21:41 +0800102 requestRoutesFanCollection(app);
Xiaochao Ma29739632021-03-02 15:53:13 +0800103#endif
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700104 requestRoutesManagerCollection(app);
105 requestRoutesManager(app);
106 requestRoutesManagerResetAction(app);
107 requestRoutesManagerResetActionInfo(app);
108 requestRoutesManagerResetToDefaultsAction(app);
Sui Chena51fc2d2022-07-14 17:21:53 -0700109 requestRoutesManagerDiagnosticData(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700110 requestRoutesChassisCollection(app);
111 requestRoutesChassis(app);
112 requestRoutesChassisResetAction(app);
113 requestRoutesChassisResetActionInfo(app);
John Edward Broadbent92903bd2022-04-26 13:40:59 -0700114 requestRoutesChassisDrive(app);
John Edward Broadbente56ed6b2022-04-26 13:40:59 -0700115 requestRoutesChassisDriveName(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700116 requestRoutesUpdateService(app);
117 requestRoutesStorageCollection(app);
118 requestRoutesStorage(app);
Willy Tu61b1eb22023-03-14 11:29:50 -0700119 requestRoutesStorageControllerCollection(app);
120 requestRoutesStorageController(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700121 requestRoutesDrive(app);
Shantappa Teekappanavar9c929be2021-12-16 19:02:52 -0600122 requestRoutesCable(app);
123 requestRoutesCableCollection(app);
Andrew Geissler0554c982019-04-23 14:40:12 -0500124#ifdef BMCWEB_INSECURE_ENABLE_REDFISH_FW_TFTP_UPDATE
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700125 requestRoutesUpdateServiceActionsSimpleUpdate(app);
Andrew Geissler0554c982019-04-23 14:40:12 -0500126#endif
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700127 requestRoutesSoftwareInventoryCollection(app);
128 requestRoutesSoftwareInventory(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800129
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700130 requestRoutesSystemLogServiceCollection(app);
131 requestRoutesEventLogService(app);
George Liu647b3cd2021-07-05 12:43:56 +0800132 requestRoutesPostCodesEntryAdditionalData(app);
ZhikuiRena3316fc2020-01-29 14:58:08 -0800133
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700134 requestRoutesPostCodesLogService(app);
135 requestRoutesPostCodesClear(app);
136 requestRoutesPostCodesEntry(app);
137 requestRoutesPostCodesEntryCollection(app);
ZhikuiRena3316fc2020-01-29 14:58:08 -0800138
Asmitha Karunanithi5cb1dd22020-05-07 04:35:02 -0500139#ifdef BMCWEB_ENABLE_REDFISH_DUMP_LOG
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700140 requestRoutesSystemDumpService(app);
141 requestRoutesSystemDumpEntryCollection(app);
142 requestRoutesSystemDumpEntry(app);
143 requestRoutesSystemDumpCreate(app);
144 requestRoutesSystemDumpClear(app);
Asmitha Karunanithi5cb1dd22020-05-07 04:35:02 -0500145
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700146 requestRoutesBMCDumpService(app);
147 requestRoutesBMCDumpEntryCollection(app);
148 requestRoutesBMCDumpEntry(app);
Carson Labrado168d1b12023-03-27 17:04:46 +0000149 requestRoutesBMCDumpEntryDownload(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700150 requestRoutesBMCDumpCreate(app);
151 requestRoutesBMCDumpClear(app);
Claire Weinanfdd26902022-03-01 14:18:25 -0800152
153 requestRoutesFaultLogDumpService(app);
154 requestRoutesFaultLogDumpEntryCollection(app);
155 requestRoutesFaultLogDumpEntry(app);
156 requestRoutesFaultLogDumpClear(app);
raviteja-bc9bb6862020-02-03 11:53:32 -0600157#endif
158
Anthony Wilson08a4e4b2019-04-12 08:23:05 -0500159#ifndef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700160 requestRoutesJournalEventLogEntryCollection(app);
161 requestRoutesJournalEventLogEntry(app);
162 requestRoutesJournalEventLogClear(app);
Anthony Wilson08a4e4b2019-04-12 08:23:05 -0500163#endif
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800164
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700165 requestRoutesBMCLogServiceCollection(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800166#ifdef BMCWEB_ENABLE_REDFISH_BMC_JOURNAL
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700167 requestRoutesBMCJournalLogService(app);
168 requestRoutesBMCJournalLogEntryCollection(app);
169 requestRoutesBMCJournalLogEntry(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800170#endif
Ed Tanous1da66f72018-07-27 16:13:37 -0700171
172#ifdef BMCWEB_ENABLE_REDFISH_CPU_LOG
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700173 requestRoutesCrashdumpService(app);
174 requestRoutesCrashdumpEntryCollection(app);
175 requestRoutesCrashdumpEntry(app);
176 requestRoutesCrashdumpFile(app);
177 requestRoutesCrashdumpClear(app);
178 requestRoutesCrashdumpCollect(app);
Ed Tanous1da66f72018-07-27 16:13:37 -0700179#endif // BMCWEB_ENABLE_REDFISH_CPU_LOG
180
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700181 requestRoutesProcessorCollection(app);
182 requestRoutesProcessor(app);
183 requestRoutesOperatingConfigCollection(app);
184 requestRoutesOperatingConfig(app);
185 requestRoutesMemoryCollection(app);
186 requestRoutesMemory(app);
Rapkiewicz, Pawel443c2932018-10-22 15:08:49 +0200187
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700188 requestRoutesSystems(app);
Ed Tanous100afe52023-06-07 13:30:46 -0700189
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700190 requestRoutesBiosService(app);
191 requestRoutesBiosReset(app);
Ed Tanous22db1722021-06-09 10:53:51 -0700192
Przemyslaw Czarnowski107077d2019-07-11 10:16:43 +0200193#ifdef BMCWEB_ENABLE_VM_NBDPROXY
Ed Tanous22db1722021-06-09 10:53:51 -0700194 requestNBDVirtualMediaRoutes(app);
Przemyslaw Czarnowski107077d2019-07-11 10:16:43 +0200195#endif // BMCWEB_ENABLE_VM_NBDPROXY
Ed Tanous22db1722021-06-09 10:53:51 -0700196
Andrew Geisslercb92c032018-08-17 07:56:14 -0700197#ifdef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700198 requestRoutesDBusLogServiceActionsClear(app);
199 requestRoutesDBusEventLogEntryCollection(app);
200 requestRoutesDBusEventLogEntry(app);
201 requestRoutesDBusEventLogEntryDownload(app);
Andrew Geisslercb92c032018-08-17 07:56:14 -0700202#endif
Tanousf00032d2018-11-05 01:18:10 -0300203
Spencer Kub7028eb2021-10-26 15:27:35 +0800204#ifdef BMCWEB_ENABLE_REDFISH_HOST_LOGGER
205 requestRoutesSystemHostLogger(app);
206 requestRoutesSystemHostLoggerCollection(app);
207 requestRoutesSystemHostLoggerLogEntry(app);
208#endif
209
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700210 requestRoutesMessageRegistryFileCollection(app);
211 requestRoutesMessageRegistryFile(app);
212 requestRoutesMessageRegistry(app);
Anthony Wilson95a3eca2019-06-11 10:44:47 -0500213
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700214 requestRoutesCertificateService(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700215 requestRoutesHTTPSCertificate(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700216 requestRoutesLDAPCertificate(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700217 requestRoutesTrustStoreCertificate(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600218
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700219 requestRoutesSystemPCIeFunctionCollection(app);
220 requestRoutesSystemPCIeFunction(app);
221 requestRoutesSystemPCIeDeviceCollection(app);
222 requestRoutesSystemPCIeDevice(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600223
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700224 requestRoutesSensorCollection(app);
225 requestRoutesSensor(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600226
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700227 requestRoutesTaskMonitor(app);
228 requestRoutesTaskService(app);
229 requestRoutesTaskCollection(app);
230 requestRoutesTask(app);
231 requestRoutesEventService(app);
AppaRao Puli5e44e3d2021-03-16 15:37:24 +0000232 requestRoutesEventServiceSse(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700233 requestRoutesEventDestinationCollection(app);
234 requestRoutesEventDestination(app);
Sunny Srivastava31791052021-03-12 10:39:16 -0600235 requestRoutesFabricAdapters(app);
236 requestRoutesFabricAdapterCollection(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700237 requestRoutesSubmitTestEvent(app);
238
Ed Tanous88a8a172023-02-28 10:12:56 -0800239 requestRoutesHypervisorSystems(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700240
241 requestRoutesTelemetryService(app);
242 requestRoutesMetricReportDefinitionCollection(app);
243 requestRoutesMetricReportDefinition(app);
244 requestRoutesMetricReportCollection(app);
245 requestRoutesMetricReport(app);
Lukasz Kazmierczak07148cf2021-08-02 11:08:53 +0200246 requestRoutesTriggerCollection(app);
Lukasz Kazmierczak1b7e6962021-08-02 13:40:27 +0200247 requestRoutesTrigger(app);
Ed Tanousf65fca62022-05-24 12:49:41 -0700248
Ed Tanous8c623a92022-05-24 11:54:51 -0700249 // Note, this must be the last route registered
Ed Tanousf65fca62022-05-24 12:49:41 -0700250 requestRoutesRedfish(app);
Borawski.Lukaszc1a46bd2018-02-08 13:31:59 +0100251 }
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +0100252};
253
Ed Tanous1abe55e2018-09-05 08:30:59 -0700254} // namespace redfish