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" |
| 29 | #include "pcie.hpp" |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 30 | #include "power.hpp" |
| 31 | #include "power_subsystem.hpp" |
| 32 | #include "power_supply.hpp" |
| 33 | #include "processor.hpp" |
| 34 | #include "redfish_sessions.hpp" |
| 35 | #include "redfish_v1.hpp" |
| 36 | #include "roles.hpp" |
| 37 | #include "sensors.hpp" |
| 38 | #include "service_root.hpp" |
| 39 | #include "storage.hpp" |
| 40 | #include "systems.hpp" |
| 41 | #include "task.hpp" |
| 42 | #include "telemetry_service.hpp" |
| 43 | #include "thermal.hpp" |
| 44 | #include "thermal_metrics.hpp" |
| 45 | #include "thermal_subsystem.hpp" |
| 46 | #include "trigger.hpp" |
| 47 | #include "update_service.hpp" |
| 48 | #include "virtual_media.hpp" |
| 49 | |
| 50 | namespace redfish |
| 51 | { |
| 52 | |
| 53 | RedfishService::RedfishService(App& app) |
| 54 | { |
Ed Tanous | 090ab8e | 2024-05-18 16:07:23 -0700 | [diff] [blame] | 55 | requestRoutesMetadata(app); |
| 56 | |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 57 | requestAccountServiceRoutes(app); |
Ed Tanous | 25b54db | 2024-04-17 15:40:31 -0700 | [diff] [blame] | 58 | if constexpr (BMCWEB_REDFISH_AGGREGATION) |
| 59 | { |
| 60 | requestRoutesAggregationService(app); |
| 61 | requestRoutesAggregationSourceCollection(app); |
| 62 | requestRoutesAggregationSource(app); |
| 63 | } |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 64 | requestRoutesRoles(app); |
| 65 | requestRoutesRoleCollection(app); |
| 66 | requestRoutesServiceRoot(app); |
| 67 | requestRoutesNetworkProtocol(app); |
| 68 | requestRoutesSession(app); |
| 69 | requestEthernetInterfacesRoutes(app); |
Ed Tanous | 25b54db | 2024-04-17 15:40:31 -0700 | [diff] [blame] | 70 | if constexpr (BMCWEB_REDFISH_ALLOW_DEPRECATED_POWER_THERMAL) |
| 71 | { |
| 72 | requestRoutesThermal(app); |
| 73 | requestRoutesPower(app); |
| 74 | } |
| 75 | if constexpr (BMCWEB_REDFISH_NEW_POWERSUBSYSTEM_THERMALSUBSYSTEM) |
| 76 | { |
| 77 | requestRoutesEnvironmentMetrics(app); |
| 78 | requestRoutesPowerSubsystem(app); |
| 79 | requestRoutesPowerSupply(app); |
| 80 | requestRoutesPowerSupplyCollection(app); |
| 81 | requestRoutesThermalMetrics(app); |
| 82 | requestRoutesThermalSubsystem(app); |
| 83 | requestRoutesFan(app); |
| 84 | requestRoutesFanCollection(app); |
| 85 | } |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 86 | requestRoutesManagerCollection(app); |
| 87 | requestRoutesManager(app); |
| 88 | requestRoutesManagerResetAction(app); |
| 89 | requestRoutesManagerResetActionInfo(app); |
| 90 | requestRoutesManagerResetToDefaultsAction(app); |
| 91 | requestRoutesManagerDiagnosticData(app); |
| 92 | requestRoutesChassisCollection(app); |
| 93 | requestRoutesChassis(app); |
| 94 | requestRoutesChassisResetAction(app); |
| 95 | requestRoutesChassisResetActionInfo(app); |
| 96 | requestRoutesChassisDrive(app); |
| 97 | requestRoutesChassisDriveName(app); |
| 98 | requestRoutesUpdateService(app); |
| 99 | requestRoutesStorageCollection(app); |
| 100 | requestRoutesStorage(app); |
| 101 | requestRoutesStorageControllerCollection(app); |
| 102 | requestRoutesStorageController(app); |
| 103 | requestRoutesDrive(app); |
| 104 | requestRoutesCable(app); |
| 105 | requestRoutesCableCollection(app); |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 106 | |
| 107 | requestRoutesSystemLogServiceCollection(app); |
| 108 | requestRoutesEventLogService(app); |
| 109 | requestRoutesPostCodesEntryAdditionalData(app); |
| 110 | |
| 111 | requestRoutesPostCodesLogService(app); |
| 112 | requestRoutesPostCodesClear(app); |
| 113 | requestRoutesPostCodesEntry(app); |
| 114 | requestRoutesPostCodesEntryCollection(app); |
| 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 | 36a59ea | 2024-05-01 16:23:54 -0700 | [diff] [blame] | 137 | if constexpr (!BMCWEB_REDFISH_DBUS_LOG) |
Ed Tanous | 25b54db | 2024-04-17 15:40:31 -0700 | [diff] [blame] | 138 | { |
| 139 | requestRoutesJournalEventLogEntryCollection(app); |
| 140 | requestRoutesJournalEventLogEntry(app); |
| 141 | requestRoutesJournalEventLogClear(app); |
| 142 | } |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 143 | |
| 144 | requestRoutesBMCLogServiceCollection(app); |
Ed Tanous | 84177a2 | 2024-07-17 11:48:55 -0700 | [diff] [blame] | 145 | |
Ed Tanous | 25b54db | 2024-04-17 15:40:31 -0700 | [diff] [blame] | 146 | if constexpr (BMCWEB_REDFISH_BMC_JOURNAL) |
| 147 | { |
| 148 | requestRoutesBMCJournalLogService(app); |
Ed Tanous | 25b54db | 2024-04-17 15:40:31 -0700 | [diff] [blame] | 149 | } |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 150 | |
Ed Tanous | 25b54db | 2024-04-17 15:40:31 -0700 | [diff] [blame] | 151 | if constexpr (BMCWEB_REDFISH_CPU_LOG) |
| 152 | { |
| 153 | requestRoutesCrashdumpService(app); |
| 154 | requestRoutesCrashdumpEntryCollection(app); |
| 155 | requestRoutesCrashdumpEntry(app); |
| 156 | requestRoutesCrashdumpFile(app); |
| 157 | requestRoutesCrashdumpClear(app); |
| 158 | requestRoutesCrashdumpCollect(app); |
| 159 | } |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 160 | |
| 161 | requestRoutesProcessorCollection(app); |
| 162 | requestRoutesProcessor(app); |
| 163 | requestRoutesOperatingConfigCollection(app); |
| 164 | requestRoutesOperatingConfig(app); |
| 165 | requestRoutesMemoryCollection(app); |
| 166 | requestRoutesMemory(app); |
| 167 | |
| 168 | requestRoutesSystems(app); |
| 169 | |
| 170 | requestRoutesBiosService(app); |
| 171 | requestRoutesBiosReset(app); |
| 172 | |
Ed Tanous | 25b54db | 2024-04-17 15:40:31 -0700 | [diff] [blame] | 173 | if constexpr (BMCWEB_VM_NBDPROXY) |
| 174 | { |
| 175 | requestNBDVirtualMediaRoutes(app); |
| 176 | } |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 177 | |
Ed Tanous | 25b54db | 2024-04-17 15:40:31 -0700 | [diff] [blame] | 178 | if constexpr (BMCWEB_REDFISH_DBUS_LOG) |
| 179 | { |
| 180 | requestRoutesDBusLogServiceActionsClear(app); |
| 181 | requestRoutesDBusEventLogEntryCollection(app); |
| 182 | requestRoutesDBusEventLogEntry(app); |
| 183 | requestRoutesDBusEventLogEntryDownload(app); |
| 184 | } |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 185 | |
Ed Tanous | 25b54db | 2024-04-17 15:40:31 -0700 | [diff] [blame] | 186 | if constexpr (BMCWEB_REDFISH_HOST_LOGGER) |
| 187 | { |
| 188 | requestRoutesSystemHostLogger(app); |
| 189 | requestRoutesSystemHostLoggerCollection(app); |
| 190 | requestRoutesSystemHostLoggerLogEntry(app); |
| 191 | } |
Ed Tanous | 3cd7072 | 2024-04-06 09:24:01 -0700 | [diff] [blame] | 192 | |
| 193 | requestRoutesMessageRegistryFileCollection(app); |
| 194 | requestRoutesMessageRegistryFile(app); |
| 195 | requestRoutesMessageRegistry(app); |
| 196 | |
| 197 | requestRoutesCertificateService(app); |
| 198 | requestRoutesHTTPSCertificate(app); |
| 199 | requestRoutesLDAPCertificate(app); |
| 200 | requestRoutesTrustStoreCertificate(app); |
| 201 | |
| 202 | requestRoutesSystemPCIeFunctionCollection(app); |
| 203 | requestRoutesSystemPCIeFunction(app); |
| 204 | requestRoutesSystemPCIeDeviceCollection(app); |
| 205 | requestRoutesSystemPCIeDevice(app); |
| 206 | |
| 207 | requestRoutesSensorCollection(app); |
| 208 | requestRoutesSensor(app); |
| 209 | |
| 210 | requestRoutesTaskMonitor(app); |
| 211 | requestRoutesTaskService(app); |
| 212 | requestRoutesTaskCollection(app); |
| 213 | requestRoutesTask(app); |
| 214 | requestRoutesEventService(app); |
| 215 | requestRoutesEventServiceSse(app); |
| 216 | requestRoutesEventDestinationCollection(app); |
| 217 | requestRoutesEventDestination(app); |
| 218 | requestRoutesFabricAdapters(app); |
| 219 | requestRoutesFabricAdapterCollection(app); |
| 220 | requestRoutesSubmitTestEvent(app); |
| 221 | |
| 222 | requestRoutesHypervisorSystems(app); |
| 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 |