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 | 36a59ea | 2024-05-01 16:23:54 -0700 | [diff] [blame] | 139 | if constexpr (!BMCWEB_REDFISH_DBUS_LOG) |
Ed Tanous | 25b54db | 2024-04-17 15:40:31 -0700 | [diff] [blame] | 140 | { |
| 141 | requestRoutesJournalEventLogEntryCollection(app); |
| 142 | requestRoutesJournalEventLogEntry(app); |
| 143 | requestRoutesJournalEventLogClear(app); |
| 144 | } |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 145 | |
| 146 | requestRoutesBMCLogServiceCollection(app); |
Ed Tanous | 84177a2 | 2024-07-17 11:48:55 -0700 | [diff] [blame] | 147 | |
Ed Tanous | 25b54db | 2024-04-17 15:40:31 -0700 | [diff] [blame] | 148 | if constexpr (BMCWEB_REDFISH_BMC_JOURNAL) |
| 149 | { |
| 150 | requestRoutesBMCJournalLogService(app); |
Ed Tanous | 25b54db | 2024-04-17 15:40:31 -0700 | [diff] [blame] | 151 | } |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 152 | |
Ed Tanous | 25b54db | 2024-04-17 15:40:31 -0700 | [diff] [blame] | 153 | if constexpr (BMCWEB_REDFISH_CPU_LOG) |
| 154 | { |
| 155 | requestRoutesCrashdumpService(app); |
| 156 | requestRoutesCrashdumpEntryCollection(app); |
| 157 | requestRoutesCrashdumpEntry(app); |
| 158 | requestRoutesCrashdumpFile(app); |
| 159 | requestRoutesCrashdumpClear(app); |
| 160 | requestRoutesCrashdumpCollect(app); |
| 161 | } |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 162 | |
| 163 | requestRoutesProcessorCollection(app); |
| 164 | requestRoutesProcessor(app); |
| 165 | requestRoutesOperatingConfigCollection(app); |
| 166 | requestRoutesOperatingConfig(app); |
| 167 | requestRoutesMemoryCollection(app); |
| 168 | requestRoutesMemory(app); |
| 169 | |
| 170 | requestRoutesSystems(app); |
| 171 | |
| 172 | requestRoutesBiosService(app); |
| 173 | requestRoutesBiosReset(app); |
| 174 | |
Ed Tanous | 25b54db | 2024-04-17 15:40:31 -0700 | [diff] [blame] | 175 | if constexpr (BMCWEB_VM_NBDPROXY) |
| 176 | { |
| 177 | requestNBDVirtualMediaRoutes(app); |
| 178 | } |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 179 | |
Ed Tanous | 25b54db | 2024-04-17 15:40:31 -0700 | [diff] [blame] | 180 | if constexpr (BMCWEB_REDFISH_DBUS_LOG) |
| 181 | { |
| 182 | requestRoutesDBusLogServiceActionsClear(app); |
| 183 | requestRoutesDBusEventLogEntryCollection(app); |
| 184 | requestRoutesDBusEventLogEntry(app); |
| 185 | requestRoutesDBusEventLogEntryDownload(app); |
| 186 | } |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 187 | |
Ed Tanous | 25b54db | 2024-04-17 15:40:31 -0700 | [diff] [blame] | 188 | if constexpr (BMCWEB_REDFISH_HOST_LOGGER) |
| 189 | { |
| 190 | requestRoutesSystemHostLogger(app); |
| 191 | requestRoutesSystemHostLoggerCollection(app); |
| 192 | requestRoutesSystemHostLoggerLogEntry(app); |
| 193 | } |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 194 | |
| 195 | requestRoutesMessageRegistryFileCollection(app); |
| 196 | requestRoutesMessageRegistryFile(app); |
| 197 | requestRoutesMessageRegistry(app); |
| 198 | |
| 199 | requestRoutesCertificateService(app); |
| 200 | requestRoutesHTTPSCertificate(app); |
| 201 | requestRoutesLDAPCertificate(app); |
| 202 | requestRoutesTrustStoreCertificate(app); |
| 203 | |
| 204 | requestRoutesSystemPCIeFunctionCollection(app); |
| 205 | requestRoutesSystemPCIeFunction(app); |
| 206 | requestRoutesSystemPCIeDeviceCollection(app); |
| 207 | requestRoutesSystemPCIeDevice(app); |
| 208 | |
| 209 | requestRoutesSensorCollection(app); |
| 210 | requestRoutesSensor(app); |
| 211 | |
| 212 | requestRoutesTaskMonitor(app); |
| 213 | requestRoutesTaskService(app); |
| 214 | requestRoutesTaskCollection(app); |
| 215 | requestRoutesTask(app); |
| 216 | requestRoutesEventService(app); |
| 217 | requestRoutesEventServiceSse(app); |
| 218 | requestRoutesEventDestinationCollection(app); |
| 219 | requestRoutesEventDestination(app); |
| 220 | requestRoutesFabricAdapters(app); |
| 221 | requestRoutesFabricAdapterCollection(app); |
| 222 | requestRoutesSubmitTestEvent(app); |
| 223 | |
| 224 | requestRoutesHypervisorSystems(app); |
| 225 | |
| 226 | requestRoutesTelemetryService(app); |
| 227 | requestRoutesMetricReportDefinitionCollection(app); |
| 228 | requestRoutesMetricReportDefinition(app); |
| 229 | requestRoutesMetricReportCollection(app); |
| 230 | requestRoutesMetricReport(app); |
| 231 | requestRoutesTriggerCollection(app); |
| 232 | requestRoutesTrigger(app); |
| 233 | |
| 234 | // Note, this must be the last route registered |
| 235 | requestRoutesRedfish(app); |
| 236 | } |
| 237 | |
| 238 | } // namespace redfish |