blob: eae83e87de2dd97431ec5aa31603e2634d6a0db9 [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 Broadbente56ed6b2022-04-26 13:40:59 -070088 requestRoutesChassisDriveName(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -070089 requestRoutesUpdateService(app);
90 requestRoutesStorageCollection(app);
91 requestRoutesStorage(app);
92 requestRoutesDrive(app);
Shantappa Teekappanavar9c929be2021-12-16 19:02:52 -060093 requestRoutesCable(app);
94 requestRoutesCableCollection(app);
Andrew Geissler0554c982019-04-23 14:40:12 -050095#ifdef BMCWEB_INSECURE_ENABLE_REDFISH_FW_TFTP_UPDATE
John Edward Broadbent7e860f12021-04-08 15:57:16 -070096 requestRoutesUpdateServiceActionsSimpleUpdate(app);
Andrew Geissler0554c982019-04-23 14:40:12 -050097#endif
John Edward Broadbent7e860f12021-04-08 15:57:16 -070098 requestRoutesSoftwareInventoryCollection(app);
99 requestRoutesSoftwareInventory(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800100
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700101 requestRoutesSystemLogServiceCollection(app);
102 requestRoutesEventLogService(app);
George Liu647b3cd2021-07-05 12:43:56 +0800103 requestRoutesPostCodesEntryAdditionalData(app);
ZhikuiRena3316fc2020-01-29 14:58:08 -0800104
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700105 requestRoutesPostCodesLogService(app);
106 requestRoutesPostCodesClear(app);
107 requestRoutesPostCodesEntry(app);
108 requestRoutesPostCodesEntryCollection(app);
ZhikuiRena3316fc2020-01-29 14:58:08 -0800109
Asmitha Karunanithi5cb1dd22020-05-07 04:35:02 -0500110#ifdef BMCWEB_ENABLE_REDFISH_DUMP_LOG
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700111 requestRoutesSystemDumpService(app);
112 requestRoutesSystemDumpEntryCollection(app);
113 requestRoutesSystemDumpEntry(app);
114 requestRoutesSystemDumpCreate(app);
115 requestRoutesSystemDumpClear(app);
Asmitha Karunanithi5cb1dd22020-05-07 04:35:02 -0500116
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700117 requestRoutesBMCDumpService(app);
118 requestRoutesBMCDumpEntryCollection(app);
119 requestRoutesBMCDumpEntry(app);
120 requestRoutesBMCDumpCreate(app);
121 requestRoutesBMCDumpClear(app);
raviteja-bc9bb6862020-02-03 11:53:32 -0600122#endif
123
Anthony Wilson08a4e4b2019-04-12 08:23:05 -0500124#ifndef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700125 requestRoutesJournalEventLogEntryCollection(app);
126 requestRoutesJournalEventLogEntry(app);
127 requestRoutesJournalEventLogClear(app);
Anthony Wilson08a4e4b2019-04-12 08:23:05 -0500128#endif
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800129
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700130 requestRoutesBMCLogServiceCollection(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800131#ifdef BMCWEB_ENABLE_REDFISH_BMC_JOURNAL
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700132 requestRoutesBMCJournalLogService(app);
133 requestRoutesBMCJournalLogEntryCollection(app);
134 requestRoutesBMCJournalLogEntry(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800135#endif
Ed Tanous1da66f72018-07-27 16:13:37 -0700136
137#ifdef BMCWEB_ENABLE_REDFISH_CPU_LOG
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700138 requestRoutesCrashdumpService(app);
139 requestRoutesCrashdumpEntryCollection(app);
140 requestRoutesCrashdumpEntry(app);
141 requestRoutesCrashdumpFile(app);
142 requestRoutesCrashdumpClear(app);
143 requestRoutesCrashdumpCollect(app);
Ed Tanous1da66f72018-07-27 16:13:37 -0700144#endif // BMCWEB_ENABLE_REDFISH_CPU_LOG
145
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700146 requestRoutesProcessorCollection(app);
147 requestRoutesProcessor(app);
148 requestRoutesOperatingConfigCollection(app);
149 requestRoutesOperatingConfig(app);
150 requestRoutesMemoryCollection(app);
151 requestRoutesMemory(app);
Rapkiewicz, Pawel443c2932018-10-22 15:08:49 +0200152
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700153 requestRoutesSystemsCollection(app);
154 requestRoutesSystems(app);
155 requestRoutesSystemActionsReset(app);
156 requestRoutesSystemResetActionInfo(app);
157 requestRoutesBiosService(app);
158 requestRoutesBiosReset(app);
Ed Tanous22db1722021-06-09 10:53:51 -0700159
Przemyslaw Czarnowski107077d2019-07-11 10:16:43 +0200160#ifdef BMCWEB_ENABLE_VM_NBDPROXY
Ed Tanous22db1722021-06-09 10:53:51 -0700161 requestNBDVirtualMediaRoutes(app);
Przemyslaw Czarnowski107077d2019-07-11 10:16:43 +0200162#endif // BMCWEB_ENABLE_VM_NBDPROXY
Ed Tanous22db1722021-06-09 10:53:51 -0700163
Andrew Geisslercb92c032018-08-17 07:56:14 -0700164#ifdef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700165 requestRoutesDBusLogServiceActionsClear(app);
166 requestRoutesDBusEventLogEntryCollection(app);
167 requestRoutesDBusEventLogEntry(app);
168 requestRoutesDBusEventLogEntryDownload(app);
Andrew Geisslercb92c032018-08-17 07:56:14 -0700169#endif
Tanousf00032d2018-11-05 01:18:10 -0300170
Spencer Kub7028eb2021-10-26 15:27:35 +0800171#ifdef BMCWEB_ENABLE_REDFISH_HOST_LOGGER
172 requestRoutesSystemHostLogger(app);
173 requestRoutesSystemHostLoggerCollection(app);
174 requestRoutesSystemHostLoggerLogEntry(app);
175#endif
176
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700177 requestRoutesMessageRegistryFileCollection(app);
178 requestRoutesMessageRegistryFile(app);
179 requestRoutesMessageRegistry(app);
Anthony Wilson95a3eca2019-06-11 10:44:47 -0500180
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700181 requestRoutesCertificateService(app);
182 requestRoutesCertificateActionGenerateCSR(app);
183 requestRoutesCertificateActionsReplaceCertificate(app);
184 requestRoutesHTTPSCertificate(app);
185 requestRoutesHTTPSCertificateCollection(app);
186 requestRoutesCertificateLocations(app);
187 requestRoutesLDAPCertificateCollection(app);
188 requestRoutesLDAPCertificate(app);
189 requestRoutesTrustStoreCertificateCollection(app);
190 requestRoutesTrustStoreCertificate(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600191
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700192 requestRoutesSystemPCIeFunctionCollection(app);
193 requestRoutesSystemPCIeFunction(app);
194 requestRoutesSystemPCIeDeviceCollection(app);
195 requestRoutesSystemPCIeDevice(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600196
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700197 requestRoutesSensorCollection(app);
198 requestRoutesSensor(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600199
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700200 requestRoutesTaskMonitor(app);
201 requestRoutesTaskService(app);
202 requestRoutesTaskCollection(app);
203 requestRoutesTask(app);
204 requestRoutesEventService(app);
205 requestRoutesEventDestinationCollection(app);
206 requestRoutesEventDestination(app);
207 requestRoutesSubmitTestEvent(app);
208
Ed Tanousb8983952021-06-03 14:55:44 -0700209 hypervisor::requestRoutesHypervisorSystems(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700210
211 requestRoutesTelemetryService(app);
212 requestRoutesMetricReportDefinitionCollection(app);
213 requestRoutesMetricReportDefinition(app);
214 requestRoutesMetricReportCollection(app);
215 requestRoutesMetricReport(app);
Lukasz Kazmierczak07148cf2021-08-02 11:08:53 +0200216 requestRoutesTriggerCollection(app);
Lukasz Kazmierczak1b7e6962021-08-02 13:40:27 +0200217 requestRoutesTrigger(app);
Ed Tanousf65fca62022-05-24 12:49:41 -0700218
219 requestRoutesRedfish(app);
Borawski.Lukaszc1a46bd2018-02-08 13:31:59 +0100220 }
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +0100221};
222
Ed Tanous1abe55e2018-09-05 08:30:59 -0700223} // namespace redfish