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