blob: ed42b89a2f1a2d37a8fd9d4494ef79548a651179 [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
Lewanczyk, Dawid88d16c92018-02-02 14:51:09 +010018#include "../lib/account_service.hpp"
Carol Wangd82a3ac2019-11-21 13:56:38 +080019#include "../lib/bios.hpp"
Shantappa Teekappanavar9c929be2021-12-16 19:02:52 -060020#include "../lib/cable.hpp"
Marri Devender Rao5968cae2019-01-21 10:27:12 -060021#include "../lib/certificate_service.hpp"
Jennifer Lee729dae72018-04-24 15:59:34 -070022#include "../lib/chassis.hpp"
23#include "../lib/ethernet.hpp"
AppaRao Pulie5aaf042020-03-20 01:05:52 +053024#include "../lib/event_service.hpp"
Ed Tanous22db1722021-06-09 10:53:51 -070025#include "../lib/hypervisor_system.hpp"
Ed Tanous1da66f72018-07-27 16:13:37 -070026#include "../lib/log_services.hpp"
Sui Chena51fc2d2022-07-14 17:21:53 -070027#include "../lib/manager_diagnostic_data.hpp"
Borawski.Lukasz9c3106852018-02-09 15:24:22 +010028#include "../lib/managers.hpp"
Gunnar Millsac6a4442020-10-14 14:55:29 -050029#include "../lib/memory.hpp"
Jason M. Bills70304cb2019-03-27 12:03:59 -070030#include "../lib/message_registries.hpp"
Wludzik, Jozef081ebf02020-04-27 17:24:15 +020031#include "../lib/metric_report.hpp"
32#include "../lib/metric_report_definition.hpp"
Borawski.Lukasz70141562018-01-24 12:45:29 +010033#include "../lib/network_protocol.hpp"
Jason M. Billsf5c9f8b2018-12-18 16:51:18 -080034#include "../lib/pcie.hpp"
Ed Tanous2474adf2018-09-05 16:31:16 -070035#include "../lib/power.hpp"
Gunnar Millsac6a4442020-10-14 14:55:29 -050036#include "../lib/processor.hpp"
Kowalski, Kamil2b7981f2018-01-31 13:24:59 +010037#include "../lib/redfish_sessions.hpp"
Ed Tanousf65fca62022-05-24 12:49:41 -070038#include "../lib/redfish_v1.hpp"
Lewanczyk, Dawid4e49bd42018-01-25 11:30:19 +010039#include "../lib/roles.hpp"
Anthony Wilson95a3eca2019-06-11 10:44:47 -050040#include "../lib/sensors.hpp"
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +010041#include "../lib/service_root.hpp"
Nikhil Potadea25aecc2019-08-23 16:35:26 -070042#include "../lib/storage.hpp"
Lewanczyk, Dawidc5b2abe2018-05-30 16:59:42 +020043#include "../lib/systems.hpp"
James Feist46229572020-02-19 15:11:58 -080044#include "../lib/task.hpp"
Wludzik, Jozef081ebf02020-04-27 17:24:15 +020045#include "../lib/telemetry_service.hpp"
Lewanczyk, Dawid08777fb2018-03-22 23:33:49 +010046#include "../lib/thermal.hpp"
Xiaochao Ma29739632021-03-02 15:53:13 +080047#include "../lib/thermal_subsystem.hpp"
Lukasz Kazmierczak07148cf2021-08-02 11:08:53 +020048#include "../lib/trigger.hpp"
Jennifer Lee729dae72018-04-24 15:59:34 -070049#include "../lib/update_service.hpp"
Przemyslaw Czarnowski107077d2019-07-11 10:16:43 +020050#include "../lib/virtual_media.hpp"
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +010051
Ed Tanous1abe55e2018-09-05 08:30:59 -070052namespace redfish
53{
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +010054/*
55 * @brief Top level class installing and providing Redfish services
56 */
Ed Tanous1abe55e2018-09-05 08:30:59 -070057class RedfishService
58{
59 public:
60 /*
61 * @brief Redfish service constructor
62 *
63 * Loads Redfish configuration and installs schema resources
64 *
65 * @param[in] app Crow app on which Redfish will initialize
66 */
Ed Tanous4e23a442022-06-06 09:57:26 -070067 explicit RedfishService(App& app)
Ed Tanous1abe55e2018-09-05 08:30:59 -070068 {
Ed Tanous6c51eab2021-06-03 12:30:29 -070069 requestAccountServiceRoutes(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -070070 requestRoutesRoles(app);
71 requestRoutesRoleCollection(app);
72 requestRoutesServiceRoot(app);
73 requestRoutesNetworkProtocol(app);
Ed Tanousfaa34cc2021-06-03 13:27:02 -070074 requestRoutesSession(app);
Ed Tanousbf648f72021-06-03 15:00:14 -070075 requestEthernetInterfacesRoutes(app);
zhanghch050256b692021-06-12 10:26:52 +080076#ifdef BMCWEB_ALLOW_DEPRECATED_POWER_THERMAL
John Edward Broadbent7e860f12021-04-08 15:57:16 -070077 requestRoutesThermal(app);
zhanghch050256b692021-06-12 10:26:52 +080078 requestRoutesPower(app);
79#endif
Xiaochao Ma29739632021-03-02 15:53:13 +080080#ifdef BMCWEB_NEW_POWERSUBSYSTEM_THERMALSUBSYSTEM
81 requestRoutesThermalSubsystem(app);
82#endif
John Edward Broadbent7e860f12021-04-08 15:57:16 -070083 requestRoutesManagerCollection(app);
84 requestRoutesManager(app);
85 requestRoutesManagerResetAction(app);
86 requestRoutesManagerResetActionInfo(app);
87 requestRoutesManagerResetToDefaultsAction(app);
Sui Chena51fc2d2022-07-14 17:21:53 -070088 requestRoutesManagerDiagnosticData(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -070089 requestRoutesChassisCollection(app);
90 requestRoutesChassis(app);
91 requestRoutesChassisResetAction(app);
92 requestRoutesChassisResetActionInfo(app);
John Edward Broadbent92903bd2022-04-26 13:40:59 -070093 requestRoutesChassisDrive(app);
John Edward Broadbente56ed6b2022-04-26 13:40:59 -070094 requestRoutesChassisDriveName(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -070095 requestRoutesUpdateService(app);
96 requestRoutesStorageCollection(app);
97 requestRoutesStorage(app);
98 requestRoutesDrive(app);
Shantappa Teekappanavar9c929be2021-12-16 19:02:52 -060099 requestRoutesCable(app);
100 requestRoutesCableCollection(app);
Andrew Geissler0554c982019-04-23 14:40:12 -0500101#ifdef BMCWEB_INSECURE_ENABLE_REDFISH_FW_TFTP_UPDATE
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700102 requestRoutesUpdateServiceActionsSimpleUpdate(app);
Andrew Geissler0554c982019-04-23 14:40:12 -0500103#endif
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700104 requestRoutesSoftwareInventoryCollection(app);
105 requestRoutesSoftwareInventory(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800106
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700107 requestRoutesSystemLogServiceCollection(app);
108 requestRoutesEventLogService(app);
George Liu647b3cd2021-07-05 12:43:56 +0800109 requestRoutesPostCodesEntryAdditionalData(app);
ZhikuiRena3316fc2020-01-29 14:58:08 -0800110
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700111 requestRoutesPostCodesLogService(app);
112 requestRoutesPostCodesClear(app);
113 requestRoutesPostCodesEntry(app);
114 requestRoutesPostCodesEntryCollection(app);
ZhikuiRena3316fc2020-01-29 14:58:08 -0800115
Asmitha Karunanithi5cb1dd22020-05-07 04:35:02 -0500116#ifdef BMCWEB_ENABLE_REDFISH_DUMP_LOG
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700117 requestRoutesSystemDumpService(app);
118 requestRoutesSystemDumpEntryCollection(app);
119 requestRoutesSystemDumpEntry(app);
120 requestRoutesSystemDumpCreate(app);
121 requestRoutesSystemDumpClear(app);
Asmitha Karunanithi5cb1dd22020-05-07 04:35:02 -0500122
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700123 requestRoutesBMCDumpService(app);
124 requestRoutesBMCDumpEntryCollection(app);
125 requestRoutesBMCDumpEntry(app);
126 requestRoutesBMCDumpCreate(app);
127 requestRoutesBMCDumpClear(app);
Claire Weinanfdd26902022-03-01 14:18:25 -0800128
129 requestRoutesFaultLogDumpService(app);
130 requestRoutesFaultLogDumpEntryCollection(app);
131 requestRoutesFaultLogDumpEntry(app);
132 requestRoutesFaultLogDumpClear(app);
raviteja-bc9bb6862020-02-03 11:53:32 -0600133#endif
134
Anthony Wilson08a4e4b2019-04-12 08:23:05 -0500135#ifndef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700136 requestRoutesJournalEventLogEntryCollection(app);
137 requestRoutesJournalEventLogEntry(app);
138 requestRoutesJournalEventLogClear(app);
Anthony Wilson08a4e4b2019-04-12 08:23:05 -0500139#endif
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800140
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700141 requestRoutesBMCLogServiceCollection(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800142#ifdef BMCWEB_ENABLE_REDFISH_BMC_JOURNAL
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700143 requestRoutesBMCJournalLogService(app);
144 requestRoutesBMCJournalLogEntryCollection(app);
145 requestRoutesBMCJournalLogEntry(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800146#endif
Ed Tanous1da66f72018-07-27 16:13:37 -0700147
148#ifdef BMCWEB_ENABLE_REDFISH_CPU_LOG
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700149 requestRoutesCrashdumpService(app);
150 requestRoutesCrashdumpEntryCollection(app);
151 requestRoutesCrashdumpEntry(app);
152 requestRoutesCrashdumpFile(app);
153 requestRoutesCrashdumpClear(app);
154 requestRoutesCrashdumpCollect(app);
Ed Tanous1da66f72018-07-27 16:13:37 -0700155#endif // BMCWEB_ENABLE_REDFISH_CPU_LOG
156
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700157 requestRoutesProcessorCollection(app);
158 requestRoutesProcessor(app);
159 requestRoutesOperatingConfigCollection(app);
160 requestRoutesOperatingConfig(app);
161 requestRoutesMemoryCollection(app);
162 requestRoutesMemory(app);
Rapkiewicz, Pawel443c2932018-10-22 15:08:49 +0200163
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700164 requestRoutesSystemsCollection(app);
165 requestRoutesSystems(app);
166 requestRoutesSystemActionsReset(app);
167 requestRoutesSystemResetActionInfo(app);
168 requestRoutesBiosService(app);
169 requestRoutesBiosReset(app);
Ed Tanous22db1722021-06-09 10:53:51 -0700170
Przemyslaw Czarnowski107077d2019-07-11 10:16:43 +0200171#ifdef BMCWEB_ENABLE_VM_NBDPROXY
Ed Tanous22db1722021-06-09 10:53:51 -0700172 requestNBDVirtualMediaRoutes(app);
Przemyslaw Czarnowski107077d2019-07-11 10:16:43 +0200173#endif // BMCWEB_ENABLE_VM_NBDPROXY
Ed Tanous22db1722021-06-09 10:53:51 -0700174
Andrew Geisslercb92c032018-08-17 07:56:14 -0700175#ifdef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700176 requestRoutesDBusLogServiceActionsClear(app);
177 requestRoutesDBusEventLogEntryCollection(app);
178 requestRoutesDBusEventLogEntry(app);
179 requestRoutesDBusEventLogEntryDownload(app);
Andrew Geisslercb92c032018-08-17 07:56:14 -0700180#endif
Tanousf00032d2018-11-05 01:18:10 -0300181
Spencer Kub7028eb2021-10-26 15:27:35 +0800182#ifdef BMCWEB_ENABLE_REDFISH_HOST_LOGGER
183 requestRoutesSystemHostLogger(app);
184 requestRoutesSystemHostLoggerCollection(app);
185 requestRoutesSystemHostLoggerLogEntry(app);
186#endif
187
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700188 requestRoutesMessageRegistryFileCollection(app);
189 requestRoutesMessageRegistryFile(app);
190 requestRoutesMessageRegistry(app);
Anthony Wilson95a3eca2019-06-11 10:44:47 -0500191
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700192 requestRoutesCertificateService(app);
193 requestRoutesCertificateActionGenerateCSR(app);
194 requestRoutesCertificateActionsReplaceCertificate(app);
195 requestRoutesHTTPSCertificate(app);
196 requestRoutesHTTPSCertificateCollection(app);
197 requestRoutesCertificateLocations(app);
198 requestRoutesLDAPCertificateCollection(app);
199 requestRoutesLDAPCertificate(app);
200 requestRoutesTrustStoreCertificateCollection(app);
201 requestRoutesTrustStoreCertificate(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600202
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700203 requestRoutesSystemPCIeFunctionCollection(app);
204 requestRoutesSystemPCIeFunction(app);
205 requestRoutesSystemPCIeDeviceCollection(app);
206 requestRoutesSystemPCIeDevice(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600207
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700208 requestRoutesSensorCollection(app);
209 requestRoutesSensor(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600210
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700211 requestRoutesTaskMonitor(app);
212 requestRoutesTaskService(app);
213 requestRoutesTaskCollection(app);
214 requestRoutesTask(app);
215 requestRoutesEventService(app);
216 requestRoutesEventDestinationCollection(app);
217 requestRoutesEventDestination(app);
218 requestRoutesSubmitTestEvent(app);
219
Ed Tanousb8983952021-06-03 14:55:44 -0700220 hypervisor::requestRoutesHypervisorSystems(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700221
222 requestRoutesTelemetryService(app);
223 requestRoutesMetricReportDefinitionCollection(app);
224 requestRoutesMetricReportDefinition(app);
225 requestRoutesMetricReportCollection(app);
226 requestRoutesMetricReport(app);
Lukasz Kazmierczak07148cf2021-08-02 11:08:53 +0200227 requestRoutesTriggerCollection(app);
Lukasz Kazmierczak1b7e6962021-08-02 13:40:27 +0200228 requestRoutesTrigger(app);
Ed Tanousf65fca62022-05-24 12:49:41 -0700229
Ed Tanous8c623a92022-05-24 11:54:51 -0700230 // Note, this must be the last route registered
Ed Tanousf65fca62022-05-24 12:49:41 -0700231 requestRoutesRedfish(app);
Borawski.Lukaszc1a46bd2018-02-08 13:31:59 +0100232 }
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +0100233};
234
Ed Tanous1abe55e2018-09-05 08:30:59 -0700235} // namespace redfish