Borawski.Lukasz | b6df6dc | 2018-01-24 10:20:45 +0100 | [diff] [blame] | 1 | /* |
Jason M. Bills | 70304cb | 2019-03-27 12:03:59 -0700 | [diff] [blame] | 2 | // Copyright (c) 2018-2019 Intel Corporation |
Borawski.Lukasz | b6df6dc | 2018-01-24 10:20:45 +0100 | [diff] [blame] | 3 | // |
| 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, Dawid | 88d16c9 | 2018-02-02 14:51:09 +0100 | [diff] [blame] | 18 | #include "../lib/account_service.hpp" |
Carol Wang | d82a3ac | 2019-11-21 13:56:38 +0800 | [diff] [blame] | 19 | #include "../lib/bios.hpp" |
Shantappa Teekappanavar | 9c929be | 2021-12-16 19:02:52 -0600 | [diff] [blame] | 20 | #include "../lib/cable.hpp" |
Marri Devender Rao | 5968cae | 2019-01-21 10:27:12 -0600 | [diff] [blame] | 21 | #include "../lib/certificate_service.hpp" |
Jennifer Lee | 729dae7 | 2018-04-24 15:59:34 -0700 | [diff] [blame] | 22 | #include "../lib/chassis.hpp" |
| 23 | #include "../lib/ethernet.hpp" |
AppaRao Puli | e5aaf04 | 2020-03-20 01:05:52 +0530 | [diff] [blame] | 24 | #include "../lib/event_service.hpp" |
Ed Tanous | 22db172 | 2021-06-09 10:53:51 -0700 | [diff] [blame] | 25 | #include "../lib/hypervisor_system.hpp" |
Ed Tanous | 1da66f7 | 2018-07-27 16:13:37 -0700 | [diff] [blame] | 26 | #include "../lib/log_services.hpp" |
Borawski.Lukasz | 9c310685 | 2018-02-09 15:24:22 +0100 | [diff] [blame] | 27 | #include "../lib/managers.hpp" |
Gunnar Mills | ac6a444 | 2020-10-14 14:55:29 -0500 | [diff] [blame] | 28 | #include "../lib/memory.hpp" |
Jason M. Bills | 70304cb | 2019-03-27 12:03:59 -0700 | [diff] [blame] | 29 | #include "../lib/message_registries.hpp" |
Wludzik, Jozef | 081ebf0 | 2020-04-27 17:24:15 +0200 | [diff] [blame] | 30 | #include "../lib/metric_report.hpp" |
| 31 | #include "../lib/metric_report_definition.hpp" |
Borawski.Lukasz | 7014156 | 2018-01-24 12:45:29 +0100 | [diff] [blame] | 32 | #include "../lib/network_protocol.hpp" |
Jason M. Bills | f5c9f8b | 2018-12-18 16:51:18 -0800 | [diff] [blame] | 33 | #include "../lib/pcie.hpp" |
Ed Tanous | 2474adf | 2018-09-05 16:31:16 -0700 | [diff] [blame] | 34 | #include "../lib/power.hpp" |
Gunnar Mills | ac6a444 | 2020-10-14 14:55:29 -0500 | [diff] [blame] | 35 | #include "../lib/processor.hpp" |
Kowalski, Kamil | 2b7981f | 2018-01-31 13:24:59 +0100 | [diff] [blame] | 36 | #include "../lib/redfish_sessions.hpp" |
Ed Tanous | f65fca6 | 2022-05-24 12:49:41 -0700 | [diff] [blame] | 37 | #include "../lib/redfish_v1.hpp" |
Lewanczyk, Dawid | 4e49bd4 | 2018-01-25 11:30:19 +0100 | [diff] [blame] | 38 | #include "../lib/roles.hpp" |
Anthony Wilson | 95a3eca | 2019-06-11 10:44:47 -0500 | [diff] [blame] | 39 | #include "../lib/sensors.hpp" |
Borawski.Lukasz | b6df6dc | 2018-01-24 10:20:45 +0100 | [diff] [blame] | 40 | #include "../lib/service_root.hpp" |
Nikhil Potade | a25aecc | 2019-08-23 16:35:26 -0700 | [diff] [blame] | 41 | #include "../lib/storage.hpp" |
Lewanczyk, Dawid | c5b2abe | 2018-05-30 16:59:42 +0200 | [diff] [blame] | 42 | #include "../lib/systems.hpp" |
James Feist | 4622957 | 2020-02-19 15:11:58 -0800 | [diff] [blame] | 43 | #include "../lib/task.hpp" |
Wludzik, Jozef | 081ebf0 | 2020-04-27 17:24:15 +0200 | [diff] [blame] | 44 | #include "../lib/telemetry_service.hpp" |
Lewanczyk, Dawid | 08777fb | 2018-03-22 23:33:49 +0100 | [diff] [blame] | 45 | #include "../lib/thermal.hpp" |
Lukasz Kazmierczak | 07148cf | 2021-08-02 11:08:53 +0200 | [diff] [blame] | 46 | #include "../lib/trigger.hpp" |
Jennifer Lee | 729dae7 | 2018-04-24 15:59:34 -0700 | [diff] [blame] | 47 | #include "../lib/update_service.hpp" |
Przemyslaw Czarnowski | 107077d | 2019-07-11 10:16:43 +0200 | [diff] [blame] | 48 | #include "../lib/virtual_media.hpp" |
Borawski.Lukasz | b6df6dc | 2018-01-24 10:20:45 +0100 | [diff] [blame] | 49 | |
Ed Tanous | 1abe55e | 2018-09-05 08:30:59 -0700 | [diff] [blame] | 50 | namespace redfish |
| 51 | { |
Borawski.Lukasz | b6df6dc | 2018-01-24 10:20:45 +0100 | [diff] [blame] | 52 | /* |
| 53 | * @brief Top level class installing and providing Redfish services |
| 54 | */ |
Ed Tanous | 1abe55e | 2018-09-05 08:30:59 -0700 | [diff] [blame] | 55 | class 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 Tanous | 4e23a44 | 2022-06-06 09:57:26 -0700 | [diff] [blame] | 65 | explicit RedfishService(App& app) |
Ed Tanous | 1abe55e | 2018-09-05 08:30:59 -0700 | [diff] [blame] | 66 | { |
Ed Tanous | 6c51eab | 2021-06-03 12:30:29 -0700 | [diff] [blame] | 67 | requestAccountServiceRoutes(app); |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 68 | requestRoutesRoles(app); |
| 69 | requestRoutesRoleCollection(app); |
| 70 | requestRoutesServiceRoot(app); |
| 71 | requestRoutesNetworkProtocol(app); |
Ed Tanous | faa34cc | 2021-06-03 13:27:02 -0700 | [diff] [blame] | 72 | requestRoutesSession(app); |
Ed Tanous | bf648f7 | 2021-06-03 15:00:14 -0700 | [diff] [blame] | 73 | requestEthernetInterfacesRoutes(app); |
zhanghch05 | 0256b69 | 2021-06-12 10:26:52 +0800 | [diff] [blame] | 74 | #ifdef BMCWEB_ALLOW_DEPRECATED_POWER_THERMAL |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 75 | requestRoutesThermal(app); |
zhanghch05 | 0256b69 | 2021-06-12 10:26:52 +0800 | [diff] [blame] | 76 | requestRoutesPower(app); |
| 77 | #endif |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 78 | requestRoutesManagerCollection(app); |
| 79 | requestRoutesManager(app); |
| 80 | requestRoutesManagerResetAction(app); |
| 81 | requestRoutesManagerResetActionInfo(app); |
| 82 | requestRoutesManagerResetToDefaultsAction(app); |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 83 | requestRoutesChassisCollection(app); |
| 84 | requestRoutesChassis(app); |
| 85 | requestRoutesChassisResetAction(app); |
| 86 | requestRoutesChassisResetActionInfo(app); |
John Edward Broadbent | 92903bd | 2022-04-26 13:40:59 -0700 | [diff] [blame] | 87 | requestRoutesChassisDrive(app); |
John Edward Broadbent | e56ed6b | 2022-04-26 13:40:59 -0700 | [diff] [blame] | 88 | requestRoutesChassisDriveName(app); |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 89 | requestRoutesUpdateService(app); |
| 90 | requestRoutesStorageCollection(app); |
| 91 | requestRoutesStorage(app); |
| 92 | requestRoutesDrive(app); |
Shantappa Teekappanavar | 9c929be | 2021-12-16 19:02:52 -0600 | [diff] [blame] | 93 | requestRoutesCable(app); |
| 94 | requestRoutesCableCollection(app); |
Andrew Geissler | 0554c98 | 2019-04-23 14:40:12 -0500 | [diff] [blame] | 95 | #ifdef BMCWEB_INSECURE_ENABLE_REDFISH_FW_TFTP_UPDATE |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 96 | requestRoutesUpdateServiceActionsSimpleUpdate(app); |
Andrew Geissler | 0554c98 | 2019-04-23 14:40:12 -0500 | [diff] [blame] | 97 | #endif |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 98 | requestRoutesSoftwareInventoryCollection(app); |
| 99 | requestRoutesSoftwareInventory(app); |
Jason M. Bills | c4bf637 | 2018-11-05 13:48:27 -0800 | [diff] [blame] | 100 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 101 | requestRoutesSystemLogServiceCollection(app); |
| 102 | requestRoutesEventLogService(app); |
George Liu | 647b3cd | 2021-07-05 12:43:56 +0800 | [diff] [blame] | 103 | requestRoutesPostCodesEntryAdditionalData(app); |
ZhikuiRen | a3316fc | 2020-01-29 14:58:08 -0800 | [diff] [blame] | 104 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 105 | requestRoutesPostCodesLogService(app); |
| 106 | requestRoutesPostCodesClear(app); |
| 107 | requestRoutesPostCodesEntry(app); |
| 108 | requestRoutesPostCodesEntryCollection(app); |
ZhikuiRen | a3316fc | 2020-01-29 14:58:08 -0800 | [diff] [blame] | 109 | |
Asmitha Karunanithi | 5cb1dd2 | 2020-05-07 04:35:02 -0500 | [diff] [blame] | 110 | #ifdef BMCWEB_ENABLE_REDFISH_DUMP_LOG |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 111 | requestRoutesSystemDumpService(app); |
| 112 | requestRoutesSystemDumpEntryCollection(app); |
| 113 | requestRoutesSystemDumpEntry(app); |
| 114 | requestRoutesSystemDumpCreate(app); |
| 115 | requestRoutesSystemDumpClear(app); |
Asmitha Karunanithi | 5cb1dd2 | 2020-05-07 04:35:02 -0500 | [diff] [blame] | 116 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 117 | requestRoutesBMCDumpService(app); |
| 118 | requestRoutesBMCDumpEntryCollection(app); |
| 119 | requestRoutesBMCDumpEntry(app); |
| 120 | requestRoutesBMCDumpCreate(app); |
| 121 | requestRoutesBMCDumpClear(app); |
Claire Weinan | fdd2690 | 2022-03-01 14:18:25 -0800 | [diff] [blame] | 122 | |
| 123 | requestRoutesFaultLogDumpService(app); |
| 124 | requestRoutesFaultLogDumpEntryCollection(app); |
| 125 | requestRoutesFaultLogDumpEntry(app); |
| 126 | requestRoutesFaultLogDumpClear(app); |
raviteja-b | c9bb686 | 2020-02-03 11:53:32 -0600 | [diff] [blame] | 127 | #endif |
| 128 | |
Anthony Wilson | 08a4e4b | 2019-04-12 08:23:05 -0500 | [diff] [blame] | 129 | #ifndef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 130 | requestRoutesJournalEventLogEntryCollection(app); |
| 131 | requestRoutesJournalEventLogEntry(app); |
| 132 | requestRoutesJournalEventLogClear(app); |
Anthony Wilson | 08a4e4b | 2019-04-12 08:23:05 -0500 | [diff] [blame] | 133 | #endif |
Jason M. Bills | c4bf637 | 2018-11-05 13:48:27 -0800 | [diff] [blame] | 134 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 135 | requestRoutesBMCLogServiceCollection(app); |
Jason M. Bills | c4bf637 | 2018-11-05 13:48:27 -0800 | [diff] [blame] | 136 | #ifdef BMCWEB_ENABLE_REDFISH_BMC_JOURNAL |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 137 | requestRoutesBMCJournalLogService(app); |
| 138 | requestRoutesBMCJournalLogEntryCollection(app); |
| 139 | requestRoutesBMCJournalLogEntry(app); |
Jason M. Bills | c4bf637 | 2018-11-05 13:48:27 -0800 | [diff] [blame] | 140 | #endif |
Ed Tanous | 1da66f7 | 2018-07-27 16:13:37 -0700 | [diff] [blame] | 141 | |
| 142 | #ifdef BMCWEB_ENABLE_REDFISH_CPU_LOG |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 143 | requestRoutesCrashdumpService(app); |
| 144 | requestRoutesCrashdumpEntryCollection(app); |
| 145 | requestRoutesCrashdumpEntry(app); |
| 146 | requestRoutesCrashdumpFile(app); |
| 147 | requestRoutesCrashdumpClear(app); |
| 148 | requestRoutesCrashdumpCollect(app); |
Ed Tanous | 1da66f7 | 2018-07-27 16:13:37 -0700 | [diff] [blame] | 149 | #endif // BMCWEB_ENABLE_REDFISH_CPU_LOG |
| 150 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 151 | requestRoutesProcessorCollection(app); |
| 152 | requestRoutesProcessor(app); |
| 153 | requestRoutesOperatingConfigCollection(app); |
| 154 | requestRoutesOperatingConfig(app); |
| 155 | requestRoutesMemoryCollection(app); |
| 156 | requestRoutesMemory(app); |
Rapkiewicz, Pawel | 443c293 | 2018-10-22 15:08:49 +0200 | [diff] [blame] | 157 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 158 | requestRoutesSystemsCollection(app); |
| 159 | requestRoutesSystems(app); |
| 160 | requestRoutesSystemActionsReset(app); |
| 161 | requestRoutesSystemResetActionInfo(app); |
| 162 | requestRoutesBiosService(app); |
| 163 | requestRoutesBiosReset(app); |
Ed Tanous | 22db172 | 2021-06-09 10:53:51 -0700 | [diff] [blame] | 164 | |
Przemyslaw Czarnowski | 107077d | 2019-07-11 10:16:43 +0200 | [diff] [blame] | 165 | #ifdef BMCWEB_ENABLE_VM_NBDPROXY |
Ed Tanous | 22db172 | 2021-06-09 10:53:51 -0700 | [diff] [blame] | 166 | requestNBDVirtualMediaRoutes(app); |
Przemyslaw Czarnowski | 107077d | 2019-07-11 10:16:43 +0200 | [diff] [blame] | 167 | #endif // BMCWEB_ENABLE_VM_NBDPROXY |
Ed Tanous | 22db172 | 2021-06-09 10:53:51 -0700 | [diff] [blame] | 168 | |
Andrew Geissler | cb92c03 | 2018-08-17 07:56:14 -0700 | [diff] [blame] | 169 | #ifdef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 170 | requestRoutesDBusLogServiceActionsClear(app); |
| 171 | requestRoutesDBusEventLogEntryCollection(app); |
| 172 | requestRoutesDBusEventLogEntry(app); |
| 173 | requestRoutesDBusEventLogEntryDownload(app); |
Andrew Geissler | cb92c03 | 2018-08-17 07:56:14 -0700 | [diff] [blame] | 174 | #endif |
Tanous | f00032d | 2018-11-05 01:18:10 -0300 | [diff] [blame] | 175 | |
Spencer Ku | b7028eb | 2021-10-26 15:27:35 +0800 | [diff] [blame] | 176 | #ifdef BMCWEB_ENABLE_REDFISH_HOST_LOGGER |
| 177 | requestRoutesSystemHostLogger(app); |
| 178 | requestRoutesSystemHostLoggerCollection(app); |
| 179 | requestRoutesSystemHostLoggerLogEntry(app); |
| 180 | #endif |
| 181 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 182 | requestRoutesMessageRegistryFileCollection(app); |
| 183 | requestRoutesMessageRegistryFile(app); |
| 184 | requestRoutesMessageRegistry(app); |
Anthony Wilson | 95a3eca | 2019-06-11 10:44:47 -0500 | [diff] [blame] | 185 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 186 | 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 Harish | 462023a | 2020-02-19 08:34:59 -0600 | [diff] [blame] | 196 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 197 | requestRoutesSystemPCIeFunctionCollection(app); |
| 198 | requestRoutesSystemPCIeFunction(app); |
| 199 | requestRoutesSystemPCIeDeviceCollection(app); |
| 200 | requestRoutesSystemPCIeDevice(app); |
Sunitha Harish | 462023a | 2020-02-19 08:34:59 -0600 | [diff] [blame] | 201 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 202 | requestRoutesSensorCollection(app); |
| 203 | requestRoutesSensor(app); |
Sunitha Harish | 462023a | 2020-02-19 08:34:59 -0600 | [diff] [blame] | 204 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 205 | 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 Tanous | b898395 | 2021-06-03 14:55:44 -0700 | [diff] [blame] | 214 | hypervisor::requestRoutesHypervisorSystems(app); |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 215 | |
| 216 | requestRoutesTelemetryService(app); |
| 217 | requestRoutesMetricReportDefinitionCollection(app); |
| 218 | requestRoutesMetricReportDefinition(app); |
| 219 | requestRoutesMetricReportCollection(app); |
| 220 | requestRoutesMetricReport(app); |
Lukasz Kazmierczak | 07148cf | 2021-08-02 11:08:53 +0200 | [diff] [blame] | 221 | requestRoutesTriggerCollection(app); |
Lukasz Kazmierczak | 1b7e696 | 2021-08-02 13:40:27 +0200 | [diff] [blame] | 222 | requestRoutesTrigger(app); |
Ed Tanous | f65fca6 | 2022-05-24 12:49:41 -0700 | [diff] [blame] | 223 | |
Ed Tanous | 8c623a9 | 2022-05-24 11:54:51 -0700 | [diff] [blame] | 224 | // Note, this must be the last route registered |
Ed Tanous | f65fca6 | 2022-05-24 12:49:41 -0700 | [diff] [blame] | 225 | requestRoutesRedfish(app); |
Borawski.Lukasz | c1a46bd | 2018-02-08 13:31:59 +0100 | [diff] [blame] | 226 | } |
Borawski.Lukasz | b6df6dc | 2018-01-24 10:20:45 +0100 | [diff] [blame] | 227 | }; |
| 228 | |
Ed Tanous | 1abe55e | 2018-09-05 08:30:59 -0700 | [diff] [blame] | 229 | } // namespace redfish |