blob: a9704d6aaca359d5b5b8546126e7b02667dbf378 [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"
Lewanczyk, Dawid4e49bd42018-01-25 11:30:19 +010037#include "../lib/roles.hpp"
Anthony Wilson95a3eca2019-06-11 10:44:47 -050038#include "../lib/sensors.hpp"
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +010039#include "../lib/service_root.hpp"
Nikhil Potadea25aecc2019-08-23 16:35:26 -070040#include "../lib/storage.hpp"
Lewanczyk, Dawidc5b2abe2018-05-30 16:59:42 +020041#include "../lib/systems.hpp"
James Feist46229572020-02-19 15:11:58 -080042#include "../lib/task.hpp"
Wludzik, Jozef081ebf02020-04-27 17:24:15 +020043#include "../lib/telemetry_service.hpp"
Lewanczyk, Dawid08777fb2018-03-22 23:33:49 +010044#include "../lib/thermal.hpp"
Lukasz Kazmierczak07148cf2021-08-02 11:08:53 +020045#include "../lib/trigger.hpp"
Jennifer Lee729dae72018-04-24 15:59:34 -070046#include "../lib/update_service.hpp"
Przemyslaw Czarnowski107077d2019-07-11 10:16:43 +020047#include "../lib/virtual_media.hpp"
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +010048
Ed Tanous1abe55e2018-09-05 08:30:59 -070049namespace redfish
50{
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +010051/*
52 * @brief Top level class installing and providing Redfish services
53 */
Ed Tanous1abe55e2018-09-05 08:30:59 -070054class RedfishService
55{
56 public:
57 /*
58 * @brief Redfish service constructor
59 *
60 * Loads Redfish configuration and installs schema resources
61 *
62 * @param[in] app Crow app on which Redfish will initialize
63 */
Ed Tanous52cc1122020-07-18 13:51:21 -070064 RedfishService(App& app)
Ed Tanous1abe55e2018-09-05 08:30:59 -070065 {
Ed Tanous6c51eab2021-06-03 12:30:29 -070066 requestAccountServiceRoutes(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -070067 requestRoutesRoles(app);
68 requestRoutesRoleCollection(app);
69 requestRoutesServiceRoot(app);
70 requestRoutesNetworkProtocol(app);
Ed Tanousfaa34cc2021-06-03 13:27:02 -070071 requestRoutesSession(app);
Ed Tanousbf648f72021-06-03 15:00:14 -070072 requestEthernetInterfacesRoutes(app);
zhanghch050256b692021-06-12 10:26:52 +080073#ifdef BMCWEB_ALLOW_DEPRECATED_POWER_THERMAL
John Edward Broadbent7e860f12021-04-08 15:57:16 -070074 requestRoutesThermal(app);
zhanghch050256b692021-06-12 10:26:52 +080075 requestRoutesPower(app);
76#endif
John Edward Broadbent7e860f12021-04-08 15:57:16 -070077 requestRoutesManagerCollection(app);
78 requestRoutesManager(app);
79 requestRoutesManagerResetAction(app);
80 requestRoutesManagerResetActionInfo(app);
81 requestRoutesManagerResetToDefaultsAction(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -070082 requestRoutesChassisCollection(app);
83 requestRoutesChassis(app);
84 requestRoutesChassisResetAction(app);
85 requestRoutesChassisResetActionInfo(app);
86 requestRoutesUpdateService(app);
87 requestRoutesStorageCollection(app);
88 requestRoutesStorage(app);
89 requestRoutesDrive(app);
Shantappa Teekappanavar9c929be2021-12-16 19:02:52 -060090 requestRoutesCable(app);
91 requestRoutesCableCollection(app);
Andrew Geissler0554c982019-04-23 14:40:12 -050092#ifdef BMCWEB_INSECURE_ENABLE_REDFISH_FW_TFTP_UPDATE
John Edward Broadbent7e860f12021-04-08 15:57:16 -070093 requestRoutesUpdateServiceActionsSimpleUpdate(app);
Andrew Geissler0554c982019-04-23 14:40:12 -050094#endif
John Edward Broadbent7e860f12021-04-08 15:57:16 -070095 requestRoutesSoftwareInventoryCollection(app);
96 requestRoutesSoftwareInventory(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -080097
John Edward Broadbent7e860f12021-04-08 15:57:16 -070098 requestRoutesSystemLogServiceCollection(app);
99 requestRoutesEventLogService(app);
George Liu647b3cd2021-07-05 12:43:56 +0800100 requestRoutesPostCodesEntryAdditionalData(app);
ZhikuiRena3316fc2020-01-29 14:58:08 -0800101
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700102 requestRoutesPostCodesLogService(app);
103 requestRoutesPostCodesClear(app);
104 requestRoutesPostCodesEntry(app);
105 requestRoutesPostCodesEntryCollection(app);
ZhikuiRena3316fc2020-01-29 14:58:08 -0800106
Asmitha Karunanithi5cb1dd22020-05-07 04:35:02 -0500107#ifdef BMCWEB_ENABLE_REDFISH_DUMP_LOG
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700108 requestRoutesSystemDumpService(app);
109 requestRoutesSystemDumpEntryCollection(app);
110 requestRoutesSystemDumpEntry(app);
111 requestRoutesSystemDumpCreate(app);
112 requestRoutesSystemDumpClear(app);
Asmitha Karunanithi5cb1dd22020-05-07 04:35:02 -0500113
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700114 requestRoutesBMCDumpService(app);
115 requestRoutesBMCDumpEntryCollection(app);
116 requestRoutesBMCDumpEntry(app);
117 requestRoutesBMCDumpCreate(app);
118 requestRoutesBMCDumpClear(app);
raviteja-bc9bb6862020-02-03 11:53:32 -0600119#endif
120
Anthony Wilson08a4e4b2019-04-12 08:23:05 -0500121#ifndef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700122 requestRoutesJournalEventLogEntryCollection(app);
123 requestRoutesJournalEventLogEntry(app);
124 requestRoutesJournalEventLogClear(app);
Anthony Wilson08a4e4b2019-04-12 08:23:05 -0500125#endif
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800126
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700127 requestRoutesBMCLogServiceCollection(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800128#ifdef BMCWEB_ENABLE_REDFISH_BMC_JOURNAL
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700129 requestRoutesBMCJournalLogService(app);
130 requestRoutesBMCJournalLogEntryCollection(app);
131 requestRoutesBMCJournalLogEntry(app);
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800132#endif
Ed Tanous1da66f72018-07-27 16:13:37 -0700133
134#ifdef BMCWEB_ENABLE_REDFISH_CPU_LOG
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700135 requestRoutesCrashdumpService(app);
136 requestRoutesCrashdumpEntryCollection(app);
137 requestRoutesCrashdumpEntry(app);
138 requestRoutesCrashdumpFile(app);
139 requestRoutesCrashdumpClear(app);
140 requestRoutesCrashdumpCollect(app);
Ed Tanous1da66f72018-07-27 16:13:37 -0700141#endif // BMCWEB_ENABLE_REDFISH_CPU_LOG
142
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700143 requestRoutesProcessorCollection(app);
144 requestRoutesProcessor(app);
145 requestRoutesOperatingConfigCollection(app);
146 requestRoutesOperatingConfig(app);
147 requestRoutesMemoryCollection(app);
148 requestRoutesMemory(app);
Rapkiewicz, Pawel443c2932018-10-22 15:08:49 +0200149
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700150 requestRoutesSystemsCollection(app);
151 requestRoutesSystems(app);
152 requestRoutesSystemActionsReset(app);
153 requestRoutesSystemResetActionInfo(app);
154 requestRoutesBiosService(app);
155 requestRoutesBiosReset(app);
Ed Tanous22db1722021-06-09 10:53:51 -0700156
Przemyslaw Czarnowski107077d2019-07-11 10:16:43 +0200157#ifdef BMCWEB_ENABLE_VM_NBDPROXY
Ed Tanous22db1722021-06-09 10:53:51 -0700158 requestNBDVirtualMediaRoutes(app);
Przemyslaw Czarnowski107077d2019-07-11 10:16:43 +0200159#endif // BMCWEB_ENABLE_VM_NBDPROXY
Ed Tanous22db1722021-06-09 10:53:51 -0700160
Andrew Geisslercb92c032018-08-17 07:56:14 -0700161#ifdef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700162 requestRoutesDBusLogServiceActionsClear(app);
163 requestRoutesDBusEventLogEntryCollection(app);
164 requestRoutesDBusEventLogEntry(app);
165 requestRoutesDBusEventLogEntryDownload(app);
Andrew Geisslercb92c032018-08-17 07:56:14 -0700166#endif
Tanousf00032d2018-11-05 01:18:10 -0300167
Spencer Kub7028eb2021-10-26 15:27:35 +0800168#ifdef BMCWEB_ENABLE_REDFISH_HOST_LOGGER
169 requestRoutesSystemHostLogger(app);
170 requestRoutesSystemHostLoggerCollection(app);
171 requestRoutesSystemHostLoggerLogEntry(app);
172#endif
173
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700174 requestRoutesMessageRegistryFileCollection(app);
175 requestRoutesMessageRegistryFile(app);
176 requestRoutesMessageRegistry(app);
Anthony Wilson95a3eca2019-06-11 10:44:47 -0500177
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700178 requestRoutesCertificateService(app);
179 requestRoutesCertificateActionGenerateCSR(app);
180 requestRoutesCertificateActionsReplaceCertificate(app);
181 requestRoutesHTTPSCertificate(app);
182 requestRoutesHTTPSCertificateCollection(app);
183 requestRoutesCertificateLocations(app);
184 requestRoutesLDAPCertificateCollection(app);
185 requestRoutesLDAPCertificate(app);
186 requestRoutesTrustStoreCertificateCollection(app);
187 requestRoutesTrustStoreCertificate(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600188
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700189 requestRoutesSystemPCIeFunctionCollection(app);
190 requestRoutesSystemPCIeFunction(app);
191 requestRoutesSystemPCIeDeviceCollection(app);
192 requestRoutesSystemPCIeDevice(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600193
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700194 requestRoutesSensorCollection(app);
195 requestRoutesSensor(app);
Sunitha Harish462023a2020-02-19 08:34:59 -0600196
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700197 requestRoutesTaskMonitor(app);
198 requestRoutesTaskService(app);
199 requestRoutesTaskCollection(app);
200 requestRoutesTask(app);
201 requestRoutesEventService(app);
202 requestRoutesEventDestinationCollection(app);
203 requestRoutesEventDestination(app);
204 requestRoutesSubmitTestEvent(app);
205
Ed Tanousb8983952021-06-03 14:55:44 -0700206 hypervisor::requestRoutesHypervisorSystems(app);
John Edward Broadbent7e860f12021-04-08 15:57:16 -0700207
208 requestRoutesTelemetryService(app);
209 requestRoutesMetricReportDefinitionCollection(app);
210 requestRoutesMetricReportDefinition(app);
211 requestRoutesMetricReportCollection(app);
212 requestRoutesMetricReport(app);
Lukasz Kazmierczak07148cf2021-08-02 11:08:53 +0200213 requestRoutesTriggerCollection(app);
Lukasz Kazmierczak1b7e6962021-08-02 13:40:27 +0200214 requestRoutesTrigger(app);
Borawski.Lukaszc1a46bd2018-02-08 13:31:59 +0100215 }
Borawski.Lukaszb6df6dc2018-01-24 10:20:45 +0100216};
217
Ed Tanous1abe55e2018-09-05 08:30:59 -0700218} // namespace redfish