blob: 0f976d6854ab76790f985440645970c90010ada7 [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"
Borawski.Lukasz9c3106852018-02-09 15:24:22 +010027#include "../lib/managers.hpp"
Gunnar Millsac6a4442020-10-14 14:55:29 -050028#include "../lib/memory.hpp"
Jason M. Bills70304cb2019-03-27 12:03:59 -070029#include "../lib/message_registries.hpp"
Wludzik, Jozef081ebf02020-04-27 17:24:15 +020030#include "../lib/metric_report.hpp"
31#include "../lib/metric_report_definition.hpp"
Borawski.Lukasz70141562018-01-24 12:45:29 +010032#include "../lib/network_protocol.hpp"
Jason M. Billsf5c9f8b2018-12-18 16:51:18 -080033#include "../lib/pcie.hpp"
Ed Tanous2474adf2018-09-05 16:31:16 -070034#include "../lib/power.hpp"
Gunnar Millsac6a4442020-10-14 14:55:29 -050035#include "../lib/processor.hpp"
Kowalski, Kamil2b7981f2018-01-31 13:24:59 +010036#include "../lib/redfish_sessions.hpp"
Ed Tanousf65fca62022-05-24 12:49:41 -070037#include "../lib/redfish_v1.hpp"
Lewanczyk, Dawid4e49bd42018-01-25 11:30:19 +010038#include "../lib/roles.hpp"
Anthony Wilson95a3eca2019-06-11 10:44:47 -050039#include "../lib/sensors.hpp"
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +010040#include "../lib/service_root.hpp"
Nikhil Potadea25aecc2019-08-23 16:35:26 -070041#include "../lib/storage.hpp"
Lewanczyk, Dawidc5b2abe2018-05-30 16:59:42 +020042#include "../lib/systems.hpp"
James Feist46229572020-02-19 15:11:58 -080043#include "../lib/task.hpp"
Wludzik, Jozef081ebf02020-04-27 17:24:15 +020044#include "../lib/telemetry_service.hpp"
Lewanczyk, Dawid08777fb2018-03-22 23:33:49 +010045#include "../lib/thermal.hpp"
Lukasz Kazmierczak07148cf2021-08-02 11:08:53 +020046#include "../lib/trigger.hpp"
Jennifer Lee729dae72018-04-24 15:59:34 -070047#include "../lib/update_service.hpp"
Przemyslaw Czarnowski107077d2019-07-11 10:16:43 +020048#include "../lib/virtual_media.hpp"
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +010049
Ed Tanous1abe55e2018-09-05 08:30:59 -070050namespace redfish
51{
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +010052/*
53 * @brief Top level class installing and providing Redfish services
54 */
Ed Tanous1abe55e2018-09-05 08:30:59 -070055class RedfishService
56{
57 public:
58 /*
59 * @brief Redfish service constructor
60 *
61 * Loads Redfish configuration and installs schema resources
62 *
63 * @param[in] app Crow app on which Redfish will initialize
64 */
Ed Tanous52cc1122020-07-18 13:51:21 -070065 RedfishService(App& app)
Ed Tanous1abe55e2018-09-05 08:30:59 -070066 {
Ed Tanous6c51eab2021-06-03 12:30:29 -070067 requestAccountServiceRoutes(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -070068 requestRoutesRoles(app);
69 requestRoutesRoleCollection(app);
70 requestRoutesServiceRoot(app);
71 requestRoutesNetworkProtocol(app);
Ed Tanousfaa34cc2021-06-03 13:27:02 -070072 requestRoutesSession(app);
Ed Tanousbf648f72021-06-03 15:00:14 -070073 requestEthernetInterfacesRoutes(app);
zhanghch050256b692021-06-12 10:26:52 +080074#ifdef BMCWEB_ALLOW_DEPRECATED_POWER_THERMAL
John Edward Broadbent7e860f12021-04-08 15:57:16 -070075 requestRoutesThermal(app);
zhanghch050256b692021-06-12 10:26:52 +080076 requestRoutesPower(app);
77#endif
John Edward Broadbent7e860f12021-04-08 15:57:16 -070078 requestRoutesManagerCollection(app);
79 requestRoutesManager(app);
80 requestRoutesManagerResetAction(app);
81 requestRoutesManagerResetActionInfo(app);
82 requestRoutesManagerResetToDefaultsAction(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -070083 requestRoutesChassisCollection(app);
84 requestRoutesChassis(app);
85 requestRoutesChassisResetAction(app);
86 requestRoutesChassisResetActionInfo(app);
John Edward Broadbent92903bd2022-04-26 13:40:59 -070087 requestRoutesChassisDrive(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -070088 requestRoutesUpdateService(app);
89 requestRoutesStorageCollection(app);
90 requestRoutesStorage(app);
91 requestRoutesDrive(app);
Shantappa Teekappanavar9c929be2021-12-16 19:02:52 -060092 requestRoutesCable(app);
93 requestRoutesCableCollection(app);
Andrew Geissler0554c982019-04-23 14:40:12 -050094#ifdef BMCWEB_INSECURE_ENABLE_REDFISH_FW_TFTP_UPDATE
John Edward Broadbent7e860f12021-04-08 15:57:16 -070095 requestRoutesUpdateServiceActionsSimpleUpdate(app);
Andrew Geissler0554c982019-04-23 14:40:12 -050096#endif
John Edward Broadbent7e860f12021-04-08 15:57:16 -070097 requestRoutesSoftwareInventoryCollection(app);
98 requestRoutesSoftwareInventory(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -080099
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700100 requestRoutesSystemLogServiceCollection(app);
101 requestRoutesEventLogService(app);
George Liu647b3cd2021-07-05 12:43:56 +0800102 requestRoutesPostCodesEntryAdditionalData(app);
ZhikuiRena3316fc2020-01-29 14:58:08 -0800103
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700104 requestRoutesPostCodesLogService(app);
105 requestRoutesPostCodesClear(app);
106 requestRoutesPostCodesEntry(app);
107 requestRoutesPostCodesEntryCollection(app);
ZhikuiRena3316fc2020-01-29 14:58:08 -0800108
Asmitha Karunanithi5cb1dd22020-05-07 04:35:02 -0500109#ifdef BMCWEB_ENABLE_REDFISH_DUMP_LOG
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700110 requestRoutesSystemDumpService(app);
111 requestRoutesSystemDumpEntryCollection(app);
112 requestRoutesSystemDumpEntry(app);
113 requestRoutesSystemDumpCreate(app);
114 requestRoutesSystemDumpClear(app);
Asmitha Karunanithi5cb1dd22020-05-07 04:35:02 -0500115
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700116 requestRoutesBMCDumpService(app);
117 requestRoutesBMCDumpEntryCollection(app);
118 requestRoutesBMCDumpEntry(app);
119 requestRoutesBMCDumpCreate(app);
120 requestRoutesBMCDumpClear(app);
raviteja-bc9bb6862020-02-03 11:53:32 -0600121#endif
122
Anthony Wilson08a4e4b2019-04-12 08:23:05 -0500123#ifndef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700124 requestRoutesJournalEventLogEntryCollection(app);
125 requestRoutesJournalEventLogEntry(app);
126 requestRoutesJournalEventLogClear(app);
Anthony Wilson08a4e4b2019-04-12 08:23:05 -0500127#endif
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800128
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700129 requestRoutesBMCLogServiceCollection(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800130#ifdef BMCWEB_ENABLE_REDFISH_BMC_JOURNAL
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700131 requestRoutesBMCJournalLogService(app);
132 requestRoutesBMCJournalLogEntryCollection(app);
133 requestRoutesBMCJournalLogEntry(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800134#endif
Ed Tanous1da66f72018-07-27 16:13:37 -0700135
136#ifdef BMCWEB_ENABLE_REDFISH_CPU_LOG
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700137 requestRoutesCrashdumpService(app);
138 requestRoutesCrashdumpEntryCollection(app);
139 requestRoutesCrashdumpEntry(app);
140 requestRoutesCrashdumpFile(app);
141 requestRoutesCrashdumpClear(app);
142 requestRoutesCrashdumpCollect(app);
Ed Tanous1da66f72018-07-27 16:13:37 -0700143#endif // BMCWEB_ENABLE_REDFISH_CPU_LOG
144
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700145 requestRoutesProcessorCollection(app);
146 requestRoutesProcessor(app);
147 requestRoutesOperatingConfigCollection(app);
148 requestRoutesOperatingConfig(app);
149 requestRoutesMemoryCollection(app);
150 requestRoutesMemory(app);
Rapkiewicz, Pawel443c2932018-10-22 15:08:49 +0200151
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700152 requestRoutesSystemsCollection(app);
153 requestRoutesSystems(app);
154 requestRoutesSystemActionsReset(app);
155 requestRoutesSystemResetActionInfo(app);
156 requestRoutesBiosService(app);
157 requestRoutesBiosReset(app);
Ed Tanous22db1722021-06-09 10:53:51 -0700158
Przemyslaw Czarnowski107077d2019-07-11 10:16:43 +0200159#ifdef BMCWEB_ENABLE_VM_NBDPROXY
Ed Tanous22db1722021-06-09 10:53:51 -0700160 requestNBDVirtualMediaRoutes(app);
Przemyslaw Czarnowski107077d2019-07-11 10:16:43 +0200161#endif // BMCWEB_ENABLE_VM_NBDPROXY
Ed Tanous22db1722021-06-09 10:53:51 -0700162
Andrew Geisslercb92c032018-08-17 07:56:14 -0700163#ifdef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700164 requestRoutesDBusLogServiceActionsClear(app);
165 requestRoutesDBusEventLogEntryCollection(app);
166 requestRoutesDBusEventLogEntry(app);
167 requestRoutesDBusEventLogEntryDownload(app);
Andrew Geisslercb92c032018-08-17 07:56:14 -0700168#endif
Tanousf00032d2018-11-05 01:18:10 -0300169
Spencer Kub7028eb2021-10-26 15:27:35 +0800170#ifdef BMCWEB_ENABLE_REDFISH_HOST_LOGGER
171 requestRoutesSystemHostLogger(app);
172 requestRoutesSystemHostLoggerCollection(app);
173 requestRoutesSystemHostLoggerLogEntry(app);
174#endif
175
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700176 requestRoutesMessageRegistryFileCollection(app);
177 requestRoutesMessageRegistryFile(app);
178 requestRoutesMessageRegistry(app);
Anthony Wilson95a3eca2019-06-11 10:44:47 -0500179
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700180 requestRoutesCertificateService(app);
181 requestRoutesCertificateActionGenerateCSR(app);
182 requestRoutesCertificateActionsReplaceCertificate(app);
183 requestRoutesHTTPSCertificate(app);
184 requestRoutesHTTPSCertificateCollection(app);
185 requestRoutesCertificateLocations(app);
186 requestRoutesLDAPCertificateCollection(app);
187 requestRoutesLDAPCertificate(app);
188 requestRoutesTrustStoreCertificateCollection(app);
189 requestRoutesTrustStoreCertificate(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600190
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700191 requestRoutesSystemPCIeFunctionCollection(app);
192 requestRoutesSystemPCIeFunction(app);
193 requestRoutesSystemPCIeDeviceCollection(app);
194 requestRoutesSystemPCIeDevice(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600195
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700196 requestRoutesSensorCollection(app);
197 requestRoutesSensor(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600198
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700199 requestRoutesTaskMonitor(app);
200 requestRoutesTaskService(app);
201 requestRoutesTaskCollection(app);
202 requestRoutesTask(app);
203 requestRoutesEventService(app);
204 requestRoutesEventDestinationCollection(app);
205 requestRoutesEventDestination(app);
206 requestRoutesSubmitTestEvent(app);
207
Ed Tanousb8983952021-06-03 14:55:44 -0700208 hypervisor::requestRoutesHypervisorSystems(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700209
210 requestRoutesTelemetryService(app);
211 requestRoutesMetricReportDefinitionCollection(app);
212 requestRoutesMetricReportDefinition(app);
213 requestRoutesMetricReportCollection(app);
214 requestRoutesMetricReport(app);
Lukasz Kazmierczak07148cf2021-08-02 11:08:53 +0200215 requestRoutesTriggerCollection(app);
Lukasz Kazmierczak1b7e6962021-08-02 13:40:27 +0200216 requestRoutesTrigger(app);
Ed Tanousf65fca62022-05-24 12:49:41 -0700217
218 requestRoutesRedfish(app);
Borawski.Lukaszc1a46bd2018-02-08 13:31:59 +0100219 }
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +0100220};
221
Ed Tanous1abe55e2018-09-05 08:30:59 -0700222} // namespace redfish