blob: ab635f913f21f7dfba349f706cb4dfcac6784fc1 [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"
Lukasz Kazmierczak07148cf2021-08-02 11:08:53 +020047#include "../lib/trigger.hpp"
Jennifer Lee729dae72018-04-24 15:59:34 -070048#include "../lib/update_service.hpp"
Przemyslaw Czarnowski107077d2019-07-11 10:16:43 +020049#include "../lib/virtual_media.hpp"
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +010050
Ed Tanous1abe55e2018-09-05 08:30:59 -070051namespace redfish
52{
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +010053/*
54 * @brief Top level class installing and providing Redfish services
55 */
Ed Tanous1abe55e2018-09-05 08:30:59 -070056class RedfishService
57{
58 public:
59 /*
60 * @brief Redfish service constructor
61 *
62 * Loads Redfish configuration and installs schema resources
63 *
64 * @param[in] app Crow app on which Redfish will initialize
65 */
Ed Tanous4e23a442022-06-06 09:57:26 -070066 explicit RedfishService(App& app)
Ed Tanous1abe55e2018-09-05 08:30:59 -070067 {
Ed Tanous6c51eab2021-06-03 12:30:29 -070068 requestAccountServiceRoutes(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -070069 requestRoutesRoles(app);
70 requestRoutesRoleCollection(app);
71 requestRoutesServiceRoot(app);
72 requestRoutesNetworkProtocol(app);
Ed Tanousfaa34cc2021-06-03 13:27:02 -070073 requestRoutesSession(app);
Ed Tanousbf648f72021-06-03 15:00:14 -070074 requestEthernetInterfacesRoutes(app);
zhanghch050256b692021-06-12 10:26:52 +080075#ifdef BMCWEB_ALLOW_DEPRECATED_POWER_THERMAL
John Edward Broadbent7e860f12021-04-08 15:57:16 -070076 requestRoutesThermal(app);
zhanghch050256b692021-06-12 10:26:52 +080077 requestRoutesPower(app);
78#endif
John Edward Broadbent7e860f12021-04-08 15:57:16 -070079 requestRoutesManagerCollection(app);
80 requestRoutesManager(app);
81 requestRoutesManagerResetAction(app);
82 requestRoutesManagerResetActionInfo(app);
83 requestRoutesManagerResetToDefaultsAction(app);
Sui Chena51fc2d2022-07-14 17:21:53 -070084 requestRoutesManagerDiagnosticData(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -070085 requestRoutesChassisCollection(app);
86 requestRoutesChassis(app);
87 requestRoutesChassisResetAction(app);
88 requestRoutesChassisResetActionInfo(app);
John Edward Broadbent92903bd2022-04-26 13:40:59 -070089 requestRoutesChassisDrive(app);
John Edward Broadbente56ed6b2022-04-26 13:40:59 -070090 requestRoutesChassisDriveName(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -070091 requestRoutesUpdateService(app);
92 requestRoutesStorageCollection(app);
93 requestRoutesStorage(app);
94 requestRoutesDrive(app);
Shantappa Teekappanavar9c929be2021-12-16 19:02:52 -060095 requestRoutesCable(app);
96 requestRoutesCableCollection(app);
Andrew Geissler0554c982019-04-23 14:40:12 -050097#ifdef BMCWEB_INSECURE_ENABLE_REDFISH_FW_TFTP_UPDATE
John Edward Broadbent7e860f12021-04-08 15:57:16 -070098 requestRoutesUpdateServiceActionsSimpleUpdate(app);
Andrew Geissler0554c982019-04-23 14:40:12 -050099#endif
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700100 requestRoutesSoftwareInventoryCollection(app);
101 requestRoutesSoftwareInventory(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800102
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700103 requestRoutesSystemLogServiceCollection(app);
104 requestRoutesEventLogService(app);
George Liu647b3cd2021-07-05 12:43:56 +0800105 requestRoutesPostCodesEntryAdditionalData(app);
ZhikuiRena3316fc2020-01-29 14:58:08 -0800106
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700107 requestRoutesPostCodesLogService(app);
108 requestRoutesPostCodesClear(app);
109 requestRoutesPostCodesEntry(app);
110 requestRoutesPostCodesEntryCollection(app);
ZhikuiRena3316fc2020-01-29 14:58:08 -0800111
Asmitha Karunanithi5cb1dd22020-05-07 04:35:02 -0500112#ifdef BMCWEB_ENABLE_REDFISH_DUMP_LOG
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700113 requestRoutesSystemDumpService(app);
114 requestRoutesSystemDumpEntryCollection(app);
115 requestRoutesSystemDumpEntry(app);
116 requestRoutesSystemDumpCreate(app);
117 requestRoutesSystemDumpClear(app);
Asmitha Karunanithi5cb1dd22020-05-07 04:35:02 -0500118
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700119 requestRoutesBMCDumpService(app);
120 requestRoutesBMCDumpEntryCollection(app);
121 requestRoutesBMCDumpEntry(app);
122 requestRoutesBMCDumpCreate(app);
123 requestRoutesBMCDumpClear(app);
Claire Weinanfdd26902022-03-01 14:18:25 -0800124
125 requestRoutesFaultLogDumpService(app);
126 requestRoutesFaultLogDumpEntryCollection(app);
127 requestRoutesFaultLogDumpEntry(app);
128 requestRoutesFaultLogDumpClear(app);
raviteja-bc9bb6862020-02-03 11:53:32 -0600129#endif
130
Anthony Wilson08a4e4b2019-04-12 08:23:05 -0500131#ifndef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700132 requestRoutesJournalEventLogEntryCollection(app);
133 requestRoutesJournalEventLogEntry(app);
134 requestRoutesJournalEventLogClear(app);
Anthony Wilson08a4e4b2019-04-12 08:23:05 -0500135#endif
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800136
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700137 requestRoutesBMCLogServiceCollection(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800138#ifdef BMCWEB_ENABLE_REDFISH_BMC_JOURNAL
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700139 requestRoutesBMCJournalLogService(app);
140 requestRoutesBMCJournalLogEntryCollection(app);
141 requestRoutesBMCJournalLogEntry(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800142#endif
Ed Tanous1da66f72018-07-27 16:13:37 -0700143
144#ifdef BMCWEB_ENABLE_REDFISH_CPU_LOG
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700145 requestRoutesCrashdumpService(app);
146 requestRoutesCrashdumpEntryCollection(app);
147 requestRoutesCrashdumpEntry(app);
148 requestRoutesCrashdumpFile(app);
149 requestRoutesCrashdumpClear(app);
150 requestRoutesCrashdumpCollect(app);
Ed Tanous1da66f72018-07-27 16:13:37 -0700151#endif // BMCWEB_ENABLE_REDFISH_CPU_LOG
152
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700153 requestRoutesProcessorCollection(app);
154 requestRoutesProcessor(app);
155 requestRoutesOperatingConfigCollection(app);
156 requestRoutesOperatingConfig(app);
157 requestRoutesMemoryCollection(app);
158 requestRoutesMemory(app);
Rapkiewicz, Pawel443c2932018-10-22 15:08:49 +0200159
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700160 requestRoutesSystemsCollection(app);
161 requestRoutesSystems(app);
162 requestRoutesSystemActionsReset(app);
163 requestRoutesSystemResetActionInfo(app);
164 requestRoutesBiosService(app);
165 requestRoutesBiosReset(app);
Ed Tanous22db1722021-06-09 10:53:51 -0700166
Przemyslaw Czarnowski107077d2019-07-11 10:16:43 +0200167#ifdef BMCWEB_ENABLE_VM_NBDPROXY
Ed Tanous22db1722021-06-09 10:53:51 -0700168 requestNBDVirtualMediaRoutes(app);
Przemyslaw Czarnowski107077d2019-07-11 10:16:43 +0200169#endif // BMCWEB_ENABLE_VM_NBDPROXY
Ed Tanous22db1722021-06-09 10:53:51 -0700170
Andrew Geisslercb92c032018-08-17 07:56:14 -0700171#ifdef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700172 requestRoutesDBusLogServiceActionsClear(app);
173 requestRoutesDBusEventLogEntryCollection(app);
174 requestRoutesDBusEventLogEntry(app);
175 requestRoutesDBusEventLogEntryDownload(app);
Andrew Geisslercb92c032018-08-17 07:56:14 -0700176#endif
Tanousf00032d2018-11-05 01:18:10 -0300177
Spencer Kub7028eb2021-10-26 15:27:35 +0800178#ifdef BMCWEB_ENABLE_REDFISH_HOST_LOGGER
179 requestRoutesSystemHostLogger(app);
180 requestRoutesSystemHostLoggerCollection(app);
181 requestRoutesSystemHostLoggerLogEntry(app);
182#endif
183
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700184 requestRoutesMessageRegistryFileCollection(app);
185 requestRoutesMessageRegistryFile(app);
186 requestRoutesMessageRegistry(app);
Anthony Wilson95a3eca2019-06-11 10:44:47 -0500187
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700188 requestRoutesCertificateService(app);
189 requestRoutesCertificateActionGenerateCSR(app);
190 requestRoutesCertificateActionsReplaceCertificate(app);
191 requestRoutesHTTPSCertificate(app);
192 requestRoutesHTTPSCertificateCollection(app);
193 requestRoutesCertificateLocations(app);
194 requestRoutesLDAPCertificateCollection(app);
195 requestRoutesLDAPCertificate(app);
196 requestRoutesTrustStoreCertificateCollection(app);
197 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