blob: e98a04cd623e93598bcc009bbbf0b34d4ff552b5 [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"
Albert Zhang4ca3ec32021-06-13 14:39:38 +080023#include "environment_metrics.hpp"
Nan Zhou4e7efda2022-10-25 21:12:32 +000024#include "ethernet.hpp"
25#include "event_service.hpp"
26#include "hypervisor_system.hpp"
27#include "log_services.hpp"
28#include "manager_diagnostic_data.hpp"
29#include "managers.hpp"
30#include "memory.hpp"
31#include "message_registries.hpp"
32#include "metric_report.hpp"
33#include "metric_report_definition.hpp"
34#include "network_protocol.hpp"
35#include "pcie.hpp"
36#include "power.hpp"
37#include "power_subsystem.hpp"
38#include "processor.hpp"
39#include "redfish_sessions.hpp"
40#include "redfish_v1.hpp"
41#include "roles.hpp"
42#include "sensors.hpp"
43#include "service_root.hpp"
44#include "storage.hpp"
45#include "systems.hpp"
46#include "task.hpp"
47#include "telemetry_service.hpp"
48#include "thermal.hpp"
49#include "thermal_subsystem.hpp"
50#include "trigger.hpp"
51#include "update_service.hpp"
52#include "virtual_media.hpp"
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +010053
Ed Tanous1abe55e2018-09-05 08:30:59 -070054namespace redfish
55{
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +010056/*
57 * @brief Top level class installing and providing Redfish services
58 */
Ed Tanous1abe55e2018-09-05 08:30:59 -070059class RedfishService
60{
61 public:
62 /*
63 * @brief Redfish service constructor
64 *
65 * Loads Redfish configuration and installs schema resources
66 *
67 * @param[in] app Crow app on which Redfish will initialize
68 */
Ed Tanous4e23a442022-06-06 09:57:26 -070069 explicit RedfishService(App& app)
Ed Tanous1abe55e2018-09-05 08:30:59 -070070 {
Ed Tanous6c51eab2021-06-03 12:30:29 -070071 requestAccountServiceRoutes(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -070072 requestRoutesRoles(app);
73 requestRoutesRoleCollection(app);
74 requestRoutesServiceRoot(app);
75 requestRoutesNetworkProtocol(app);
Ed Tanousfaa34cc2021-06-03 13:27:02 -070076 requestRoutesSession(app);
Ed Tanousbf648f72021-06-03 15:00:14 -070077 requestEthernetInterfacesRoutes(app);
zhanghch050256b692021-06-12 10:26:52 +080078#ifdef BMCWEB_ALLOW_DEPRECATED_POWER_THERMAL
John Edward Broadbent7e860f12021-04-08 15:57:16 -070079 requestRoutesThermal(app);
zhanghch050256b692021-06-12 10:26:52 +080080 requestRoutesPower(app);
81#endif
Xiaochao Ma29739632021-03-02 15:53:13 +080082#ifdef BMCWEB_NEW_POWERSUBSYSTEM_THERMALSUBSYSTEM
Albert Zhang4ca3ec32021-06-13 14:39:38 +080083 requestRoutesEnvironmentMetrics(app);
Chicago Duan77b36432021-02-05 15:48:26 +080084 requestRoutesPowerSubsystem(app);
Xiaochao Ma29739632021-03-02 15:53:13 +080085 requestRoutesThermalSubsystem(app);
86#endif
John Edward Broadbent7e860f12021-04-08 15:57:16 -070087 requestRoutesManagerCollection(app);
88 requestRoutesManager(app);
89 requestRoutesManagerResetAction(app);
90 requestRoutesManagerResetActionInfo(app);
91 requestRoutesManagerResetToDefaultsAction(app);
Sui Chena51fc2d2022-07-14 17:21:53 -070092 requestRoutesManagerDiagnosticData(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -070093 requestRoutesChassisCollection(app);
94 requestRoutesChassis(app);
95 requestRoutesChassisResetAction(app);
96 requestRoutesChassisResetActionInfo(app);
John Edward Broadbent92903bd2022-04-26 13:40:59 -070097 requestRoutesChassisDrive(app);
John Edward Broadbente56ed6b2022-04-26 13:40:59 -070098 requestRoutesChassisDriveName(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -070099 requestRoutesUpdateService(app);
100 requestRoutesStorageCollection(app);
101 requestRoutesStorage(app);
102 requestRoutesDrive(app);
Shantappa Teekappanavar9c929be2021-12-16 19:02:52 -0600103 requestRoutesCable(app);
104 requestRoutesCableCollection(app);
Andrew Geissler0554c982019-04-23 14:40:12 -0500105#ifdef BMCWEB_INSECURE_ENABLE_REDFISH_FW_TFTP_UPDATE
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700106 requestRoutesUpdateServiceActionsSimpleUpdate(app);
Andrew Geissler0554c982019-04-23 14:40:12 -0500107#endif
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700108 requestRoutesSoftwareInventoryCollection(app);
109 requestRoutesSoftwareInventory(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800110
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700111 requestRoutesSystemLogServiceCollection(app);
112 requestRoutesEventLogService(app);
George Liu647b3cd2021-07-05 12:43:56 +0800113 requestRoutesPostCodesEntryAdditionalData(app);
ZhikuiRena3316fc2020-01-29 14:58:08 -0800114
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700115 requestRoutesPostCodesLogService(app);
116 requestRoutesPostCodesClear(app);
117 requestRoutesPostCodesEntry(app);
118 requestRoutesPostCodesEntryCollection(app);
ZhikuiRena3316fc2020-01-29 14:58:08 -0800119
Asmitha Karunanithi5cb1dd22020-05-07 04:35:02 -0500120#ifdef BMCWEB_ENABLE_REDFISH_DUMP_LOG
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700121 requestRoutesSystemDumpService(app);
122 requestRoutesSystemDumpEntryCollection(app);
123 requestRoutesSystemDumpEntry(app);
124 requestRoutesSystemDumpCreate(app);
125 requestRoutesSystemDumpClear(app);
Asmitha Karunanithi5cb1dd22020-05-07 04:35:02 -0500126
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700127 requestRoutesBMCDumpService(app);
128 requestRoutesBMCDumpEntryCollection(app);
129 requestRoutesBMCDumpEntry(app);
130 requestRoutesBMCDumpCreate(app);
131 requestRoutesBMCDumpClear(app);
Claire Weinanfdd26902022-03-01 14:18:25 -0800132
133 requestRoutesFaultLogDumpService(app);
134 requestRoutesFaultLogDumpEntryCollection(app);
135 requestRoutesFaultLogDumpEntry(app);
136 requestRoutesFaultLogDumpClear(app);
raviteja-bc9bb6862020-02-03 11:53:32 -0600137#endif
138
Anthony Wilson08a4e4b2019-04-12 08:23:05 -0500139#ifndef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700140 requestRoutesJournalEventLogEntryCollection(app);
141 requestRoutesJournalEventLogEntry(app);
142 requestRoutesJournalEventLogClear(app);
Anthony Wilson08a4e4b2019-04-12 08:23:05 -0500143#endif
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800144
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700145 requestRoutesBMCLogServiceCollection(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800146#ifdef BMCWEB_ENABLE_REDFISH_BMC_JOURNAL
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700147 requestRoutesBMCJournalLogService(app);
148 requestRoutesBMCJournalLogEntryCollection(app);
149 requestRoutesBMCJournalLogEntry(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800150#endif
Ed Tanous1da66f72018-07-27 16:13:37 -0700151
152#ifdef BMCWEB_ENABLE_REDFISH_CPU_LOG
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700153 requestRoutesCrashdumpService(app);
154 requestRoutesCrashdumpEntryCollection(app);
155 requestRoutesCrashdumpEntry(app);
156 requestRoutesCrashdumpFile(app);
157 requestRoutesCrashdumpClear(app);
158 requestRoutesCrashdumpCollect(app);
Ed Tanous1da66f72018-07-27 16:13:37 -0700159#endif // BMCWEB_ENABLE_REDFISH_CPU_LOG
160
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700161 requestRoutesProcessorCollection(app);
162 requestRoutesProcessor(app);
163 requestRoutesOperatingConfigCollection(app);
164 requestRoutesOperatingConfig(app);
165 requestRoutesMemoryCollection(app);
166 requestRoutesMemory(app);
Rapkiewicz, Pawel443c2932018-10-22 15:08:49 +0200167
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700168 requestRoutesSystemsCollection(app);
169 requestRoutesSystems(app);
170 requestRoutesSystemActionsReset(app);
171 requestRoutesSystemResetActionInfo(app);
172 requestRoutesBiosService(app);
173 requestRoutesBiosReset(app);
Ed Tanous22db1722021-06-09 10:53:51 -0700174
Przemyslaw Czarnowski107077d2019-07-11 10:16:43 +0200175#ifdef BMCWEB_ENABLE_VM_NBDPROXY
Ed Tanous22db1722021-06-09 10:53:51 -0700176 requestNBDVirtualMediaRoutes(app);
Przemyslaw Czarnowski107077d2019-07-11 10:16:43 +0200177#endif // BMCWEB_ENABLE_VM_NBDPROXY
Ed Tanous22db1722021-06-09 10:53:51 -0700178
Andrew Geisslercb92c032018-08-17 07:56:14 -0700179#ifdef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700180 requestRoutesDBusLogServiceActionsClear(app);
181 requestRoutesDBusEventLogEntryCollection(app);
182 requestRoutesDBusEventLogEntry(app);
183 requestRoutesDBusEventLogEntryDownload(app);
Andrew Geisslercb92c032018-08-17 07:56:14 -0700184#endif
Tanousf00032d2018-11-05 01:18:10 -0300185
Spencer Kub7028eb2021-10-26 15:27:35 +0800186#ifdef BMCWEB_ENABLE_REDFISH_HOST_LOGGER
187 requestRoutesSystemHostLogger(app);
188 requestRoutesSystemHostLoggerCollection(app);
189 requestRoutesSystemHostLoggerLogEntry(app);
190#endif
191
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700192 requestRoutesMessageRegistryFileCollection(app);
193 requestRoutesMessageRegistryFile(app);
194 requestRoutesMessageRegistry(app);
Anthony Wilson95a3eca2019-06-11 10:44:47 -0500195
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700196 requestRoutesCertificateService(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700197 requestRoutesHTTPSCertificate(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700198 requestRoutesLDAPCertificate(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700199 requestRoutesTrustStoreCertificate(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600200
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700201 requestRoutesSystemPCIeFunctionCollection(app);
202 requestRoutesSystemPCIeFunction(app);
203 requestRoutesSystemPCIeDeviceCollection(app);
204 requestRoutesSystemPCIeDevice(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600205
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700206 requestRoutesSensorCollection(app);
207 requestRoutesSensor(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600208
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700209 requestRoutesTaskMonitor(app);
210 requestRoutesTaskService(app);
211 requestRoutesTaskCollection(app);
212 requestRoutesTask(app);
213 requestRoutesEventService(app);
214 requestRoutesEventDestinationCollection(app);
215 requestRoutesEventDestination(app);
216 requestRoutesSubmitTestEvent(app);
217
Ed Tanousb8983952021-06-03 14:55:44 -0700218 hypervisor::requestRoutesHypervisorSystems(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700219
220 requestRoutesTelemetryService(app);
221 requestRoutesMetricReportDefinitionCollection(app);
222 requestRoutesMetricReportDefinition(app);
223 requestRoutesMetricReportCollection(app);
224 requestRoutesMetricReport(app);
Lukasz Kazmierczak07148cf2021-08-02 11:08:53 +0200225 requestRoutesTriggerCollection(app);
Lukasz Kazmierczak1b7e6962021-08-02 13:40:27 +0200226 requestRoutesTrigger(app);
Ed Tanousf65fca62022-05-24 12:49:41 -0700227
Ed Tanous8c623a92022-05-24 11:54:51 -0700228 // Note, this must be the last route registered
Ed Tanousf65fca62022-05-24 12:49:41 -0700229 requestRoutesRedfish(app);
Borawski.Lukaszc1a46bd2018-02-08 13:31:59 +0100230 }
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +0100231};
232
Ed Tanous1abe55e2018-09-05 08:30:59 -0700233} // namespace redfish