blob: be75f8943b33f8161aba7d47104f2eaf308b1e9a [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"
19#include "bios.hpp"
20#include "cable.hpp"
21#include "certificate_service.hpp"
22#include "chassis.hpp"
23#include "ethernet.hpp"
24#include "event_service.hpp"
25#include "hypervisor_system.hpp"
26#include "log_services.hpp"
27#include "manager_diagnostic_data.hpp"
28#include "managers.hpp"
29#include "memory.hpp"
30#include "message_registries.hpp"
31#include "metric_report.hpp"
32#include "metric_report_definition.hpp"
33#include "network_protocol.hpp"
34#include "pcie.hpp"
35#include "power.hpp"
36#include "power_subsystem.hpp"
37#include "processor.hpp"
38#include "redfish_sessions.hpp"
39#include "redfish_v1.hpp"
40#include "roles.hpp"
41#include "sensors.hpp"
42#include "service_root.hpp"
43#include "storage.hpp"
44#include "systems.hpp"
45#include "task.hpp"
46#include "telemetry_service.hpp"
47#include "thermal.hpp"
48#include "thermal_subsystem.hpp"
49#include "trigger.hpp"
50#include "update_service.hpp"
51#include "virtual_media.hpp"
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +010052
Ed Tanous1abe55e2018-09-05 08:30:59 -070053namespace redfish
54{
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +010055/*
56 * @brief Top level class installing and providing Redfish services
57 */
Ed Tanous1abe55e2018-09-05 08:30:59 -070058class RedfishService
59{
60 public:
61 /*
62 * @brief Redfish service constructor
63 *
64 * Loads Redfish configuration and installs schema resources
65 *
66 * @param[in] app Crow app on which Redfish will initialize
67 */
Ed Tanous4e23a442022-06-06 09:57:26 -070068 explicit RedfishService(App& app)
Ed Tanous1abe55e2018-09-05 08:30:59 -070069 {
Ed Tanous6c51eab2021-06-03 12:30:29 -070070 requestAccountServiceRoutes(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -070071 requestRoutesRoles(app);
72 requestRoutesRoleCollection(app);
73 requestRoutesServiceRoot(app);
74 requestRoutesNetworkProtocol(app);
Ed Tanousfaa34cc2021-06-03 13:27:02 -070075 requestRoutesSession(app);
Ed Tanousbf648f72021-06-03 15:00:14 -070076 requestEthernetInterfacesRoutes(app);
zhanghch050256b692021-06-12 10:26:52 +080077#ifdef BMCWEB_ALLOW_DEPRECATED_POWER_THERMAL
John Edward Broadbent7e860f12021-04-08 15:57:16 -070078 requestRoutesThermal(app);
zhanghch050256b692021-06-12 10:26:52 +080079 requestRoutesPower(app);
80#endif
Xiaochao Ma29739632021-03-02 15:53:13 +080081#ifdef BMCWEB_NEW_POWERSUBSYSTEM_THERMALSUBSYSTEM
Chicago Duan77b36432021-02-05 15:48:26 +080082 requestRoutesPowerSubsystem(app);
Xiaochao Ma29739632021-03-02 15:53:13 +080083 requestRoutesThermalSubsystem(app);
84#endif
John Edward Broadbent7e860f12021-04-08 15:57:16 -070085 requestRoutesManagerCollection(app);
86 requestRoutesManager(app);
87 requestRoutesManagerResetAction(app);
88 requestRoutesManagerResetActionInfo(app);
89 requestRoutesManagerResetToDefaultsAction(app);
Sui Chena51fc2d2022-07-14 17:21:53 -070090 requestRoutesManagerDiagnosticData(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -070091 requestRoutesChassisCollection(app);
92 requestRoutesChassis(app);
93 requestRoutesChassisResetAction(app);
94 requestRoutesChassisResetActionInfo(app);
John Edward Broadbent92903bd2022-04-26 13:40:59 -070095 requestRoutesChassisDrive(app);
John Edward Broadbente56ed6b2022-04-26 13:40:59 -070096 requestRoutesChassisDriveName(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -070097 requestRoutesUpdateService(app);
98 requestRoutesStorageCollection(app);
99 requestRoutesStorage(app);
100 requestRoutesDrive(app);
Shantappa Teekappanavar9c929be2021-12-16 19:02:52 -0600101 requestRoutesCable(app);
102 requestRoutesCableCollection(app);
Andrew Geissler0554c982019-04-23 14:40:12 -0500103#ifdef BMCWEB_INSECURE_ENABLE_REDFISH_FW_TFTP_UPDATE
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700104 requestRoutesUpdateServiceActionsSimpleUpdate(app);
Andrew Geissler0554c982019-04-23 14:40:12 -0500105#endif
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700106 requestRoutesSoftwareInventoryCollection(app);
107 requestRoutesSoftwareInventory(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800108
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700109 requestRoutesSystemLogServiceCollection(app);
110 requestRoutesEventLogService(app);
George Liu647b3cd2021-07-05 12:43:56 +0800111 requestRoutesPostCodesEntryAdditionalData(app);
ZhikuiRena3316fc2020-01-29 14:58:08 -0800112
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700113 requestRoutesPostCodesLogService(app);
114 requestRoutesPostCodesClear(app);
115 requestRoutesPostCodesEntry(app);
116 requestRoutesPostCodesEntryCollection(app);
ZhikuiRena3316fc2020-01-29 14:58:08 -0800117
Asmitha Karunanithi5cb1dd22020-05-07 04:35:02 -0500118#ifdef BMCWEB_ENABLE_REDFISH_DUMP_LOG
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700119 requestRoutesSystemDumpService(app);
120 requestRoutesSystemDumpEntryCollection(app);
121 requestRoutesSystemDumpEntry(app);
122 requestRoutesSystemDumpCreate(app);
123 requestRoutesSystemDumpClear(app);
Asmitha Karunanithi5cb1dd22020-05-07 04:35:02 -0500124
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700125 requestRoutesBMCDumpService(app);
126 requestRoutesBMCDumpEntryCollection(app);
127 requestRoutesBMCDumpEntry(app);
128 requestRoutesBMCDumpCreate(app);
129 requestRoutesBMCDumpClear(app);
Claire Weinanfdd26902022-03-01 14:18:25 -0800130
131 requestRoutesFaultLogDumpService(app);
132 requestRoutesFaultLogDumpEntryCollection(app);
133 requestRoutesFaultLogDumpEntry(app);
134 requestRoutesFaultLogDumpClear(app);
raviteja-bc9bb6862020-02-03 11:53:32 -0600135#endif
136
Anthony Wilson08a4e4b2019-04-12 08:23:05 -0500137#ifndef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700138 requestRoutesJournalEventLogEntryCollection(app);
139 requestRoutesJournalEventLogEntry(app);
140 requestRoutesJournalEventLogClear(app);
Anthony Wilson08a4e4b2019-04-12 08:23:05 -0500141#endif
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800142
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700143 requestRoutesBMCLogServiceCollection(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800144#ifdef BMCWEB_ENABLE_REDFISH_BMC_JOURNAL
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700145 requestRoutesBMCJournalLogService(app);
146 requestRoutesBMCJournalLogEntryCollection(app);
147 requestRoutesBMCJournalLogEntry(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800148#endif
Ed Tanous1da66f72018-07-27 16:13:37 -0700149
150#ifdef BMCWEB_ENABLE_REDFISH_CPU_LOG
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700151 requestRoutesCrashdumpService(app);
152 requestRoutesCrashdumpEntryCollection(app);
153 requestRoutesCrashdumpEntry(app);
154 requestRoutesCrashdumpFile(app);
155 requestRoutesCrashdumpClear(app);
156 requestRoutesCrashdumpCollect(app);
Ed Tanous1da66f72018-07-27 16:13:37 -0700157#endif // BMCWEB_ENABLE_REDFISH_CPU_LOG
158
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700159 requestRoutesProcessorCollection(app);
160 requestRoutesProcessor(app);
161 requestRoutesOperatingConfigCollection(app);
162 requestRoutesOperatingConfig(app);
163 requestRoutesMemoryCollection(app);
164 requestRoutesMemory(app);
Rapkiewicz, Pawel443c2932018-10-22 15:08:49 +0200165
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700166 requestRoutesSystemsCollection(app);
167 requestRoutesSystems(app);
168 requestRoutesSystemActionsReset(app);
169 requestRoutesSystemResetActionInfo(app);
170 requestRoutesBiosService(app);
171 requestRoutesBiosReset(app);
Ed Tanous22db1722021-06-09 10:53:51 -0700172
Przemyslaw Czarnowski107077d2019-07-11 10:16:43 +0200173#ifdef BMCWEB_ENABLE_VM_NBDPROXY
Ed Tanous22db1722021-06-09 10:53:51 -0700174 requestNBDVirtualMediaRoutes(app);
Przemyslaw Czarnowski107077d2019-07-11 10:16:43 +0200175#endif // BMCWEB_ENABLE_VM_NBDPROXY
Ed Tanous22db1722021-06-09 10:53:51 -0700176
Andrew Geisslercb92c032018-08-17 07:56:14 -0700177#ifdef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700178 requestRoutesDBusLogServiceActionsClear(app);
179 requestRoutesDBusEventLogEntryCollection(app);
180 requestRoutesDBusEventLogEntry(app);
181 requestRoutesDBusEventLogEntryDownload(app);
Andrew Geisslercb92c032018-08-17 07:56:14 -0700182#endif
Tanousf00032d2018-11-05 01:18:10 -0300183
Spencer Kub7028eb2021-10-26 15:27:35 +0800184#ifdef BMCWEB_ENABLE_REDFISH_HOST_LOGGER
185 requestRoutesSystemHostLogger(app);
186 requestRoutesSystemHostLoggerCollection(app);
187 requestRoutesSystemHostLoggerLogEntry(app);
188#endif
189
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700190 requestRoutesMessageRegistryFileCollection(app);
191 requestRoutesMessageRegistryFile(app);
192 requestRoutesMessageRegistry(app);
Anthony Wilson95a3eca2019-06-11 10:44:47 -0500193
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700194 requestRoutesCertificateService(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700195 requestRoutesHTTPSCertificate(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700196 requestRoutesLDAPCertificate(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700197 requestRoutesTrustStoreCertificate(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600198
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700199 requestRoutesSystemPCIeFunctionCollection(app);
200 requestRoutesSystemPCIeFunction(app);
201 requestRoutesSystemPCIeDeviceCollection(app);
202 requestRoutesSystemPCIeDevice(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600203
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700204 requestRoutesSensorCollection(app);
205 requestRoutesSensor(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600206
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700207 requestRoutesTaskMonitor(app);
208 requestRoutesTaskService(app);
209 requestRoutesTaskCollection(app);
210 requestRoutesTask(app);
211 requestRoutesEventService(app);
212 requestRoutesEventDestinationCollection(app);
213 requestRoutesEventDestination(app);
214 requestRoutesSubmitTestEvent(app);
215
Ed Tanousb8983952021-06-03 14:55:44 -0700216 hypervisor::requestRoutesHypervisorSystems(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700217
218 requestRoutesTelemetryService(app);
219 requestRoutesMetricReportDefinitionCollection(app);
220 requestRoutesMetricReportDefinition(app);
221 requestRoutesMetricReportCollection(app);
222 requestRoutesMetricReport(app);
Lukasz Kazmierczak07148cf2021-08-02 11:08:53 +0200223 requestRoutesTriggerCollection(app);
Lukasz Kazmierczak1b7e6962021-08-02 13:40:27 +0200224 requestRoutesTrigger(app);
Ed Tanousf65fca62022-05-24 12:49:41 -0700225
Ed Tanous8c623a92022-05-24 11:54:51 -0700226 // Note, this must be the last route registered
Ed Tanousf65fca62022-05-24 12:49:41 -0700227 requestRoutesRedfish(app);
Borawski.Lukaszc1a46bd2018-02-08 13:31:59 +0100228 }
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +0100229};
230
Ed Tanous1abe55e2018-09-05 08:30:59 -0700231} // namespace redfish