Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 1 | #include "redfish.hpp" |
| 2 | |
Ed Tanous | 5b90429 | 2024-04-16 11:10:17 -0700 | [diff] [blame] | 3 | #include "bmcweb_config.h" |
| 4 | |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 5 | #include "account_service.hpp" |
| 6 | #include "aggregation_service.hpp" |
| 7 | #include "app.hpp" |
| 8 | #include "bios.hpp" |
| 9 | #include "cable.hpp" |
| 10 | #include "certificate_service.hpp" |
| 11 | #include "chassis.hpp" |
| 12 | #include "environment_metrics.hpp" |
| 13 | #include "ethernet.hpp" |
| 14 | #include "event_service.hpp" |
| 15 | #include "eventservice_sse.hpp" |
| 16 | #include "fabric_adapters.hpp" |
| 17 | #include "fan.hpp" |
| 18 | #include "hypervisor_system.hpp" |
| 19 | #include "log_services.hpp" |
| 20 | #include "manager_diagnostic_data.hpp" |
Ed Tanous | b0983db | 2024-07-17 11:37:25 -0700 | [diff] [blame] | 21 | #include "manager_logservices_journal.hpp" |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 22 | #include "managers.hpp" |
| 23 | #include "memory.hpp" |
| 24 | #include "message_registries.hpp" |
Ed Tanous | 090ab8e | 2024-05-18 16:07:23 -0700 | [diff] [blame] | 25 | #include "metadata.hpp" |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 26 | #include "metric_report.hpp" |
| 27 | #include "metric_report_definition.hpp" |
| 28 | #include "network_protocol.hpp" |
Ed Tanous | d5c0172 | 2024-06-16 12:10:33 -0700 | [diff] [blame] | 29 | #include "odata.hpp" |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 30 | #include "pcie.hpp" |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 31 | #include "power.hpp" |
| 32 | #include "power_subsystem.hpp" |
| 33 | #include "power_supply.hpp" |
| 34 | #include "processor.hpp" |
| 35 | #include "redfish_sessions.hpp" |
| 36 | #include "redfish_v1.hpp" |
| 37 | #include "roles.hpp" |
| 38 | #include "sensors.hpp" |
| 39 | #include "service_root.hpp" |
| 40 | #include "storage.hpp" |
| 41 | #include "systems.hpp" |
| 42 | #include "task.hpp" |
| 43 | #include "telemetry_service.hpp" |
| 44 | #include "thermal.hpp" |
| 45 | #include "thermal_metrics.hpp" |
| 46 | #include "thermal_subsystem.hpp" |
| 47 | #include "trigger.hpp" |
| 48 | #include "update_service.hpp" |
| 49 | #include "virtual_media.hpp" |
| 50 | |
| 51 | namespace redfish |
| 52 | { |
| 53 | |
| 54 | RedfishService::RedfishService(App& app) |
| 55 | { |
Ed Tanous | 090ab8e | 2024-05-18 16:07:23 -0700 | [diff] [blame] | 56 | requestRoutesMetadata(app); |
Ed Tanous | d5c0172 | 2024-06-16 12:10:33 -0700 | [diff] [blame] | 57 | requestRoutesOdata(app); |
Ed Tanous | 090ab8e | 2024-05-18 16:07:23 -0700 | [diff] [blame] | 58 | |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 59 | requestAccountServiceRoutes(app); |
Ed Tanous | 25b54db | 2024-04-17 15:40:31 -0700 | [diff] [blame] | 60 | if constexpr (BMCWEB_REDFISH_AGGREGATION) |
| 61 | { |
| 62 | requestRoutesAggregationService(app); |
| 63 | requestRoutesAggregationSourceCollection(app); |
| 64 | requestRoutesAggregationSource(app); |
| 65 | } |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 66 | requestRoutesRoles(app); |
| 67 | requestRoutesRoleCollection(app); |
| 68 | requestRoutesServiceRoot(app); |
| 69 | requestRoutesNetworkProtocol(app); |
| 70 | requestRoutesSession(app); |
| 71 | requestEthernetInterfacesRoutes(app); |
Ed Tanous | 25b54db | 2024-04-17 15:40:31 -0700 | [diff] [blame] | 72 | if constexpr (BMCWEB_REDFISH_ALLOW_DEPRECATED_POWER_THERMAL) |
| 73 | { |
| 74 | requestRoutesThermal(app); |
| 75 | requestRoutesPower(app); |
| 76 | } |
| 77 | if constexpr (BMCWEB_REDFISH_NEW_POWERSUBSYSTEM_THERMALSUBSYSTEM) |
| 78 | { |
| 79 | requestRoutesEnvironmentMetrics(app); |
| 80 | requestRoutesPowerSubsystem(app); |
| 81 | requestRoutesPowerSupply(app); |
| 82 | requestRoutesPowerSupplyCollection(app); |
| 83 | requestRoutesThermalMetrics(app); |
| 84 | requestRoutesThermalSubsystem(app); |
| 85 | requestRoutesFan(app); |
| 86 | requestRoutesFanCollection(app); |
| 87 | } |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 88 | requestRoutesManagerCollection(app); |
| 89 | requestRoutesManager(app); |
| 90 | requestRoutesManagerResetAction(app); |
| 91 | requestRoutesManagerResetActionInfo(app); |
| 92 | requestRoutesManagerResetToDefaultsAction(app); |
| 93 | requestRoutesManagerDiagnosticData(app); |
| 94 | requestRoutesChassisCollection(app); |
| 95 | requestRoutesChassis(app); |
| 96 | requestRoutesChassisResetAction(app); |
| 97 | requestRoutesChassisResetActionInfo(app); |
| 98 | requestRoutesChassisDrive(app); |
| 99 | requestRoutesChassisDriveName(app); |
| 100 | requestRoutesUpdateService(app); |
| 101 | requestRoutesStorageCollection(app); |
| 102 | requestRoutesStorage(app); |
| 103 | requestRoutesStorageControllerCollection(app); |
| 104 | requestRoutesStorageController(app); |
| 105 | requestRoutesDrive(app); |
| 106 | requestRoutesCable(app); |
| 107 | requestRoutesCableCollection(app); |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 108 | |
| 109 | requestRoutesSystemLogServiceCollection(app); |
| 110 | requestRoutesEventLogService(app); |
| 111 | requestRoutesPostCodesEntryAdditionalData(app); |
| 112 | |
| 113 | requestRoutesPostCodesLogService(app); |
| 114 | requestRoutesPostCodesClear(app); |
| 115 | requestRoutesPostCodesEntry(app); |
| 116 | requestRoutesPostCodesEntryCollection(app); |
| 117 | |
Ed Tanous | 25b54db | 2024-04-17 15:40:31 -0700 | [diff] [blame] | 118 | if constexpr (BMCWEB_REDFISH_DUMP_LOG) |
| 119 | { |
| 120 | requestRoutesSystemDumpService(app); |
| 121 | requestRoutesSystemDumpEntryCollection(app); |
| 122 | requestRoutesSystemDumpEntry(app); |
| 123 | requestRoutesSystemDumpCreate(app); |
| 124 | requestRoutesSystemDumpClear(app); |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 125 | |
Ed Tanous | 25b54db | 2024-04-17 15:40:31 -0700 | [diff] [blame] | 126 | requestRoutesBMCDumpService(app); |
| 127 | requestRoutesBMCDumpEntryCollection(app); |
| 128 | requestRoutesBMCDumpEntry(app); |
| 129 | requestRoutesBMCDumpEntryDownload(app); |
| 130 | requestRoutesBMCDumpCreate(app); |
| 131 | requestRoutesBMCDumpClear(app); |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 132 | |
Ed Tanous | 25b54db | 2024-04-17 15:40:31 -0700 | [diff] [blame] | 133 | requestRoutesFaultLogDumpService(app); |
| 134 | requestRoutesFaultLogDumpEntryCollection(app); |
| 135 | requestRoutesFaultLogDumpEntry(app); |
| 136 | requestRoutesFaultLogDumpClear(app); |
| 137 | } |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 138 | |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 139 | requestRoutesBMCLogServiceCollection(app); |
Ed Tanous | 84177a2 | 2024-07-17 11:48:55 -0700 | [diff] [blame] | 140 | |
Ed Tanous | 25b54db | 2024-04-17 15:40:31 -0700 | [diff] [blame] | 141 | if constexpr (BMCWEB_REDFISH_BMC_JOURNAL) |
| 142 | { |
| 143 | requestRoutesBMCJournalLogService(app); |
Ed Tanous | 25b54db | 2024-04-17 15:40:31 -0700 | [diff] [blame] | 144 | } |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 145 | |
Ed Tanous | 25b54db | 2024-04-17 15:40:31 -0700 | [diff] [blame] | 146 | if constexpr (BMCWEB_REDFISH_CPU_LOG) |
| 147 | { |
| 148 | requestRoutesCrashdumpService(app); |
| 149 | requestRoutesCrashdumpEntryCollection(app); |
| 150 | requestRoutesCrashdumpEntry(app); |
| 151 | requestRoutesCrashdumpFile(app); |
| 152 | requestRoutesCrashdumpClear(app); |
| 153 | requestRoutesCrashdumpCollect(app); |
| 154 | } |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 155 | |
| 156 | requestRoutesProcessorCollection(app); |
| 157 | requestRoutesProcessor(app); |
| 158 | requestRoutesOperatingConfigCollection(app); |
| 159 | requestRoutesOperatingConfig(app); |
| 160 | requestRoutesMemoryCollection(app); |
| 161 | requestRoutesMemory(app); |
| 162 | |
| 163 | requestRoutesSystems(app); |
| 164 | |
| 165 | requestRoutesBiosService(app); |
| 166 | requestRoutesBiosReset(app); |
| 167 | |
Ed Tanous | 25b54db | 2024-04-17 15:40:31 -0700 | [diff] [blame] | 168 | if constexpr (BMCWEB_VM_NBDPROXY) |
| 169 | { |
| 170 | requestNBDVirtualMediaRoutes(app); |
| 171 | } |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 172 | |
Ed Tanous | 25b54db | 2024-04-17 15:40:31 -0700 | [diff] [blame] | 173 | if constexpr (BMCWEB_REDFISH_DBUS_LOG) |
| 174 | { |
| 175 | requestRoutesDBusLogServiceActionsClear(app); |
| 176 | requestRoutesDBusEventLogEntryCollection(app); |
| 177 | requestRoutesDBusEventLogEntry(app); |
| 178 | requestRoutesDBusEventLogEntryDownload(app); |
| 179 | } |
Alexander Hansen | a782e26 | 2024-08-12 14:04:06 +0200 | [diff] [blame] | 180 | else |
| 181 | { |
| 182 | requestRoutesJournalEventLogEntryCollection(app); |
| 183 | requestRoutesJournalEventLogEntry(app); |
| 184 | requestRoutesJournalEventLogClear(app); |
| 185 | } |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 186 | |
Ed Tanous | 25b54db | 2024-04-17 15:40:31 -0700 | [diff] [blame] | 187 | if constexpr (BMCWEB_REDFISH_HOST_LOGGER) |
| 188 | { |
| 189 | requestRoutesSystemHostLogger(app); |
| 190 | requestRoutesSystemHostLoggerCollection(app); |
| 191 | requestRoutesSystemHostLoggerLogEntry(app); |
| 192 | } |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 193 | |
| 194 | requestRoutesMessageRegistryFileCollection(app); |
| 195 | requestRoutesMessageRegistryFile(app); |
| 196 | requestRoutesMessageRegistry(app); |
| 197 | |
| 198 | requestRoutesCertificateService(app); |
| 199 | requestRoutesHTTPSCertificate(app); |
| 200 | requestRoutesLDAPCertificate(app); |
| 201 | requestRoutesTrustStoreCertificate(app); |
| 202 | |
| 203 | requestRoutesSystemPCIeFunctionCollection(app); |
| 204 | requestRoutesSystemPCIeFunction(app); |
| 205 | requestRoutesSystemPCIeDeviceCollection(app); |
| 206 | requestRoutesSystemPCIeDevice(app); |
| 207 | |
| 208 | requestRoutesSensorCollection(app); |
| 209 | requestRoutesSensor(app); |
| 210 | |
| 211 | requestRoutesTaskMonitor(app); |
| 212 | requestRoutesTaskService(app); |
| 213 | requestRoutesTaskCollection(app); |
| 214 | requestRoutesTask(app); |
| 215 | requestRoutesEventService(app); |
| 216 | requestRoutesEventServiceSse(app); |
| 217 | requestRoutesEventDestinationCollection(app); |
| 218 | requestRoutesEventDestination(app); |
| 219 | requestRoutesFabricAdapters(app); |
| 220 | requestRoutesFabricAdapterCollection(app); |
| 221 | requestRoutesSubmitTestEvent(app); |
| 222 | |
Gunnar Mills | 6889620 | 2024-08-21 11:34:20 -0500 | [diff] [blame^] | 223 | if constexpr (BMCWEB_HYPERVISOR_COMPUTER_SYSTEM) |
| 224 | { |
| 225 | requestRoutesHypervisorSystems(app); |
| 226 | } |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 227 | |
| 228 | requestRoutesTelemetryService(app); |
| 229 | requestRoutesMetricReportDefinitionCollection(app); |
| 230 | requestRoutesMetricReportDefinition(app); |
| 231 | requestRoutesMetricReportCollection(app); |
| 232 | requestRoutesMetricReport(app); |
| 233 | requestRoutesTriggerCollection(app); |
| 234 | requestRoutesTrigger(app); |
| 235 | |
| 236 | // Note, this must be the last route registered |
| 237 | requestRoutesRedfish(app); |
| 238 | } |
| 239 | |
| 240 | } // namespace redfish |