blob: e56996dad445b5782f5dad223066b055c473dc61 [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"
Marri Devender Rao5968cae2019-01-21 10:27:12 -060020#include "../lib/certificate_service.hpp"
Jennifer Lee729dae72018-04-24 15:59:34 -070021#include "../lib/chassis.hpp"
22#include "../lib/ethernet.hpp"
AppaRao Pulie5aaf042020-03-20 01:05:52 +053023#include "../lib/event_service.hpp"
Ed Tanous22db1722021-06-09 10:53:51 -070024#include "../lib/hypervisor_system.hpp"
Ed Tanous1da66f72018-07-27 16:13:37 -070025#include "../lib/log_services.hpp"
Borawski.Lukasz9c3106852018-02-09 15:24:22 +010026#include "../lib/managers.hpp"
Gunnar Millsac6a4442020-10-14 14:55:29 -050027#include "../lib/memory.hpp"
Jason M. Bills70304cb2019-03-27 12:03:59 -070028#include "../lib/message_registries.hpp"
Wludzik, Jozef081ebf02020-04-27 17:24:15 +020029#include "../lib/metric_report.hpp"
30#include "../lib/metric_report_definition.hpp"
Borawski.Lukasz70141562018-01-24 12:45:29 +010031#include "../lib/network_protocol.hpp"
Jason M. Billsf5c9f8b2018-12-18 16:51:18 -080032#include "../lib/pcie.hpp"
Ed Tanous2474adf2018-09-05 16:31:16 -070033#include "../lib/power.hpp"
Gunnar Millsac6a4442020-10-14 14:55:29 -050034#include "../lib/processor.hpp"
Kowalski, Kamil2b7981f2018-01-31 13:24:59 +010035#include "../lib/redfish_sessions.hpp"
Lewanczyk, Dawid4e49bd42018-01-25 11:30:19 +010036#include "../lib/roles.hpp"
Anthony Wilson95a3eca2019-06-11 10:44:47 -050037#include "../lib/sensors.hpp"
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +010038#include "../lib/service_root.hpp"
Nikhil Potadea25aecc2019-08-23 16:35:26 -070039#include "../lib/storage.hpp"
Lewanczyk, Dawidc5b2abe2018-05-30 16:59:42 +020040#include "../lib/systems.hpp"
James Feist46229572020-02-19 15:11:58 -080041#include "../lib/task.hpp"
Wludzik, Jozef081ebf02020-04-27 17:24:15 +020042#include "../lib/telemetry_service.hpp"
Lewanczyk, Dawid08777fb2018-03-22 23:33:49 +010043#include "../lib/thermal.hpp"
Lukasz Kazmierczak07148cf2021-08-02 11:08:53 +020044#include "../lib/trigger.hpp"
Jennifer Lee729dae72018-04-24 15:59:34 -070045#include "../lib/update_service.hpp"
Przemyslaw Czarnowski107077d2019-07-11 10:16:43 +020046#include "../lib/virtual_media.hpp"
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +010047
Ed Tanous1abe55e2018-09-05 08:30:59 -070048namespace redfish
49{
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +010050/*
51 * @brief Top level class installing and providing Redfish services
52 */
Ed Tanous1abe55e2018-09-05 08:30:59 -070053class RedfishService
54{
55 public:
56 /*
57 * @brief Redfish service constructor
58 *
59 * Loads Redfish configuration and installs schema resources
60 *
61 * @param[in] app Crow app on which Redfish will initialize
62 */
Ed Tanous52cc1122020-07-18 13:51:21 -070063 RedfishService(App& app)
Ed Tanous1abe55e2018-09-05 08:30:59 -070064 {
Ed Tanous6c51eab2021-06-03 12:30:29 -070065 requestAccountServiceRoutes(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -070066 requestRoutesRoles(app);
67 requestRoutesRoleCollection(app);
68 requestRoutesServiceRoot(app);
69 requestRoutesNetworkProtocol(app);
Ed Tanousfaa34cc2021-06-03 13:27:02 -070070 requestRoutesSession(app);
Ed Tanousbf648f72021-06-03 15:00:14 -070071 requestEthernetInterfacesRoutes(app);
zhanghch050256b692021-06-12 10:26:52 +080072#ifdef BMCWEB_ALLOW_DEPRECATED_POWER_THERMAL
John Edward Broadbent7e860f12021-04-08 15:57:16 -070073 requestRoutesThermal(app);
zhanghch050256b692021-06-12 10:26:52 +080074 requestRoutesPower(app);
75#endif
John Edward Broadbent7e860f12021-04-08 15:57:16 -070076 requestRoutesManagerCollection(app);
77 requestRoutesManager(app);
78 requestRoutesManagerResetAction(app);
79 requestRoutesManagerResetActionInfo(app);
80 requestRoutesManagerResetToDefaultsAction(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -070081 requestRoutesChassisCollection(app);
82 requestRoutesChassis(app);
83 requestRoutesChassisResetAction(app);
84 requestRoutesChassisResetActionInfo(app);
85 requestRoutesUpdateService(app);
86 requestRoutesStorageCollection(app);
87 requestRoutesStorage(app);
88 requestRoutesDrive(app);
Andrew Geissler0554c982019-04-23 14:40:12 -050089#ifdef BMCWEB_INSECURE_ENABLE_REDFISH_FW_TFTP_UPDATE
John Edward Broadbent7e860f12021-04-08 15:57:16 -070090 requestRoutesUpdateServiceActionsSimpleUpdate(app);
Andrew Geissler0554c982019-04-23 14:40:12 -050091#endif
John Edward Broadbent7e860f12021-04-08 15:57:16 -070092 requestRoutesSoftwareInventoryCollection(app);
93 requestRoutesSoftwareInventory(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -080094
John Edward Broadbent7e860f12021-04-08 15:57:16 -070095 requestRoutesSystemLogServiceCollection(app);
96 requestRoutesEventLogService(app);
George Liu647b3cd2021-07-05 12:43:56 +080097 requestRoutesPostCodesEntryAdditionalData(app);
ZhikuiRena3316fc2020-01-29 14:58:08 -080098
John Edward Broadbent7e860f12021-04-08 15:57:16 -070099 requestRoutesPostCodesLogService(app);
100 requestRoutesPostCodesClear(app);
101 requestRoutesPostCodesEntry(app);
102 requestRoutesPostCodesEntryCollection(app);
ZhikuiRena3316fc2020-01-29 14:58:08 -0800103
Asmitha Karunanithi5cb1dd22020-05-07 04:35:02 -0500104#ifdef BMCWEB_ENABLE_REDFISH_DUMP_LOG
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700105 requestRoutesSystemDumpService(app);
106 requestRoutesSystemDumpEntryCollection(app);
107 requestRoutesSystemDumpEntry(app);
108 requestRoutesSystemDumpCreate(app);
109 requestRoutesSystemDumpClear(app);
Asmitha Karunanithi5cb1dd22020-05-07 04:35:02 -0500110
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700111 requestRoutesBMCDumpService(app);
112 requestRoutesBMCDumpEntryCollection(app);
113 requestRoutesBMCDumpEntry(app);
114 requestRoutesBMCDumpCreate(app);
115 requestRoutesBMCDumpClear(app);
raviteja-bc9bb6862020-02-03 11:53:32 -0600116#endif
117
Anthony Wilson08a4e4b2019-04-12 08:23:05 -0500118#ifndef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700119 requestRoutesJournalEventLogEntryCollection(app);
120 requestRoutesJournalEventLogEntry(app);
121 requestRoutesJournalEventLogClear(app);
Anthony Wilson08a4e4b2019-04-12 08:23:05 -0500122#endif
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800123
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700124 requestRoutesBMCLogServiceCollection(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800125#ifdef BMCWEB_ENABLE_REDFISH_BMC_JOURNAL
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700126 requestRoutesBMCJournalLogService(app);
127 requestRoutesBMCJournalLogEntryCollection(app);
128 requestRoutesBMCJournalLogEntry(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800129#endif
Ed Tanous1da66f72018-07-27 16:13:37 -0700130
131#ifdef BMCWEB_ENABLE_REDFISH_CPU_LOG
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700132 requestRoutesCrashdumpService(app);
133 requestRoutesCrashdumpEntryCollection(app);
134 requestRoutesCrashdumpEntry(app);
135 requestRoutesCrashdumpFile(app);
136 requestRoutesCrashdumpClear(app);
137 requestRoutesCrashdumpCollect(app);
Ed Tanous1da66f72018-07-27 16:13:37 -0700138#endif // BMCWEB_ENABLE_REDFISH_CPU_LOG
139
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700140 requestRoutesProcessorCollection(app);
141 requestRoutesProcessor(app);
142 requestRoutesOperatingConfigCollection(app);
143 requestRoutesOperatingConfig(app);
144 requestRoutesMemoryCollection(app);
145 requestRoutesMemory(app);
Rapkiewicz, Pawel443c2932018-10-22 15:08:49 +0200146
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700147 requestRoutesSystemsCollection(app);
148 requestRoutesSystems(app);
149 requestRoutesSystemActionsReset(app);
150 requestRoutesSystemResetActionInfo(app);
151 requestRoutesBiosService(app);
152 requestRoutesBiosReset(app);
Ed Tanous22db1722021-06-09 10:53:51 -0700153
Przemyslaw Czarnowski107077d2019-07-11 10:16:43 +0200154#ifdef BMCWEB_ENABLE_VM_NBDPROXY
Ed Tanous22db1722021-06-09 10:53:51 -0700155 requestNBDVirtualMediaRoutes(app);
Przemyslaw Czarnowski107077d2019-07-11 10:16:43 +0200156#endif // BMCWEB_ENABLE_VM_NBDPROXY
Ed Tanous22db1722021-06-09 10:53:51 -0700157
Andrew Geisslercb92c032018-08-17 07:56:14 -0700158#ifdef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700159 requestRoutesDBusLogServiceActionsClear(app);
160 requestRoutesDBusEventLogEntryCollection(app);
161 requestRoutesDBusEventLogEntry(app);
162 requestRoutesDBusEventLogEntryDownload(app);
Andrew Geisslercb92c032018-08-17 07:56:14 -0700163#endif
Tanousf00032d2018-11-05 01:18:10 -0300164
Spencer Kub7028eb2021-10-26 15:27:35 +0800165#ifdef BMCWEB_ENABLE_REDFISH_HOST_LOGGER
166 requestRoutesSystemHostLogger(app);
167 requestRoutesSystemHostLoggerCollection(app);
168 requestRoutesSystemHostLoggerLogEntry(app);
169#endif
170
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700171 requestRoutesMessageRegistryFileCollection(app);
172 requestRoutesMessageRegistryFile(app);
173 requestRoutesMessageRegistry(app);
Anthony Wilson95a3eca2019-06-11 10:44:47 -0500174
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700175 requestRoutesCertificateService(app);
176 requestRoutesCertificateActionGenerateCSR(app);
177 requestRoutesCertificateActionsReplaceCertificate(app);
178 requestRoutesHTTPSCertificate(app);
179 requestRoutesHTTPSCertificateCollection(app);
180 requestRoutesCertificateLocations(app);
181 requestRoutesLDAPCertificateCollection(app);
182 requestRoutesLDAPCertificate(app);
183 requestRoutesTrustStoreCertificateCollection(app);
184 requestRoutesTrustStoreCertificate(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600185
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700186 requestRoutesSystemPCIeFunctionCollection(app);
187 requestRoutesSystemPCIeFunction(app);
188 requestRoutesSystemPCIeDeviceCollection(app);
189 requestRoutesSystemPCIeDevice(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600190
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700191 requestRoutesSensorCollection(app);
192 requestRoutesSensor(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600193
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700194 requestRoutesTaskMonitor(app);
195 requestRoutesTaskService(app);
196 requestRoutesTaskCollection(app);
197 requestRoutesTask(app);
198 requestRoutesEventService(app);
199 requestRoutesEventDestinationCollection(app);
200 requestRoutesEventDestination(app);
201 requestRoutesSubmitTestEvent(app);
202
Ed Tanousb8983952021-06-03 14:55:44 -0700203 hypervisor::requestRoutesHypervisorSystems(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700204
205 requestRoutesTelemetryService(app);
206 requestRoutesMetricReportDefinitionCollection(app);
207 requestRoutesMetricReportDefinition(app);
208 requestRoutesMetricReportCollection(app);
209 requestRoutesMetricReport(app);
Lukasz Kazmierczak07148cf2021-08-02 11:08:53 +0200210 requestRoutesTriggerCollection(app);
Borawski.Lukaszc1a46bd2018-02-08 13:31:59 +0100211 }
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +0100212};
213
Ed Tanous1abe55e2018-09-05 08:30:59 -0700214} // namespace redfish