blob: 8c05dd7f8633ec14f8f839774b17d4440de8f052 [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 Tanous4e23a442022-06-06 09:57:26 -070065 explicit 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);
Claire Weinanfdd26902022-03-01 14:18:25 -0800122
123 requestRoutesFaultLogDumpService(app);
124 requestRoutesFaultLogDumpEntryCollection(app);
125 requestRoutesFaultLogDumpEntry(app);
126 requestRoutesFaultLogDumpClear(app);
raviteja-bc9bb6862020-02-03 11:53:32 -0600127#endif
128
Anthony Wilson08a4e4b2019-04-12 08:23:05 -0500129#ifndef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700130 requestRoutesJournalEventLogEntryCollection(app);
131 requestRoutesJournalEventLogEntry(app);
132 requestRoutesJournalEventLogClear(app);
Anthony Wilson08a4e4b2019-04-12 08:23:05 -0500133#endif
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800134
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700135 requestRoutesBMCLogServiceCollection(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800136#ifdef BMCWEB_ENABLE_REDFISH_BMC_JOURNAL
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700137 requestRoutesBMCJournalLogService(app);
138 requestRoutesBMCJournalLogEntryCollection(app);
139 requestRoutesBMCJournalLogEntry(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800140#endif
Ed Tanous1da66f72018-07-27 16:13:37 -0700141
142#ifdef BMCWEB_ENABLE_REDFISH_CPU_LOG
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700143 requestRoutesCrashdumpService(app);
144 requestRoutesCrashdumpEntryCollection(app);
145 requestRoutesCrashdumpEntry(app);
146 requestRoutesCrashdumpFile(app);
147 requestRoutesCrashdumpClear(app);
148 requestRoutesCrashdumpCollect(app);
Ed Tanous1da66f72018-07-27 16:13:37 -0700149#endif // BMCWEB_ENABLE_REDFISH_CPU_LOG
150
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700151 requestRoutesProcessorCollection(app);
152 requestRoutesProcessor(app);
153 requestRoutesOperatingConfigCollection(app);
154 requestRoutesOperatingConfig(app);
155 requestRoutesMemoryCollection(app);
156 requestRoutesMemory(app);
Rapkiewicz, Pawel443c2932018-10-22 15:08:49 +0200157
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700158 requestRoutesSystemsCollection(app);
159 requestRoutesSystems(app);
160 requestRoutesSystemActionsReset(app);
161 requestRoutesSystemResetActionInfo(app);
162 requestRoutesBiosService(app);
163 requestRoutesBiosReset(app);
Ed Tanous22db1722021-06-09 10:53:51 -0700164
Przemyslaw Czarnowski107077d2019-07-11 10:16:43 +0200165#ifdef BMCWEB_ENABLE_VM_NBDPROXY
Ed Tanous22db1722021-06-09 10:53:51 -0700166 requestNBDVirtualMediaRoutes(app);
Przemyslaw Czarnowski107077d2019-07-11 10:16:43 +0200167#endif // BMCWEB_ENABLE_VM_NBDPROXY
Ed Tanous22db1722021-06-09 10:53:51 -0700168
Andrew Geisslercb92c032018-08-17 07:56:14 -0700169#ifdef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700170 requestRoutesDBusLogServiceActionsClear(app);
171 requestRoutesDBusEventLogEntryCollection(app);
172 requestRoutesDBusEventLogEntry(app);
173 requestRoutesDBusEventLogEntryDownload(app);
Andrew Geisslercb92c032018-08-17 07:56:14 -0700174#endif
Tanousf00032d2018-11-05 01:18:10 -0300175
Spencer Kub7028eb2021-10-26 15:27:35 +0800176#ifdef BMCWEB_ENABLE_REDFISH_HOST_LOGGER
177 requestRoutesSystemHostLogger(app);
178 requestRoutesSystemHostLoggerCollection(app);
179 requestRoutesSystemHostLoggerLogEntry(app);
180#endif
181
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700182 requestRoutesMessageRegistryFileCollection(app);
183 requestRoutesMessageRegistryFile(app);
184 requestRoutesMessageRegistry(app);
Anthony Wilson95a3eca2019-06-11 10:44:47 -0500185
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700186 requestRoutesCertificateService(app);
187 requestRoutesCertificateActionGenerateCSR(app);
188 requestRoutesCertificateActionsReplaceCertificate(app);
189 requestRoutesHTTPSCertificate(app);
190 requestRoutesHTTPSCertificateCollection(app);
191 requestRoutesCertificateLocations(app);
192 requestRoutesLDAPCertificateCollection(app);
193 requestRoutesLDAPCertificate(app);
194 requestRoutesTrustStoreCertificateCollection(app);
195 requestRoutesTrustStoreCertificate(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600196
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700197 requestRoutesSystemPCIeFunctionCollection(app);
198 requestRoutesSystemPCIeFunction(app);
199 requestRoutesSystemPCIeDeviceCollection(app);
200 requestRoutesSystemPCIeDevice(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600201
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700202 requestRoutesSensorCollection(app);
203 requestRoutesSensor(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600204
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700205 requestRoutesTaskMonitor(app);
206 requestRoutesTaskService(app);
207 requestRoutesTaskCollection(app);
208 requestRoutesTask(app);
209 requestRoutesEventService(app);
210 requestRoutesEventDestinationCollection(app);
211 requestRoutesEventDestination(app);
212 requestRoutesSubmitTestEvent(app);
213
Ed Tanousb8983952021-06-03 14:55:44 -0700214 hypervisor::requestRoutesHypervisorSystems(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700215
216 requestRoutesTelemetryService(app);
217 requestRoutesMetricReportDefinitionCollection(app);
218 requestRoutesMetricReportDefinition(app);
219 requestRoutesMetricReportCollection(app);
220 requestRoutesMetricReport(app);
Lukasz Kazmierczak07148cf2021-08-02 11:08:53 +0200221 requestRoutesTriggerCollection(app);
Lukasz Kazmierczak1b7e6962021-08-02 13:40:27 +0200222 requestRoutesTrigger(app);
Ed Tanousf65fca62022-05-24 12:49:41 -0700223
Ed Tanous8c623a92022-05-24 11:54:51 -0700224 // Note, this must be the last route registered
Ed Tanousf65fca62022-05-24 12:49:41 -0700225 requestRoutesRedfish(app);
Borawski.Lukaszc1a46bd2018-02-08 13:31:59 +0100226 }
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +0100227};
228
Ed Tanous1abe55e2018-09-05 08:30:59 -0700229} // namespace redfish