1 /* 2 // Copyright (c) 2018-2019 Intel Corporation 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 18 #include "account_service.hpp" 19 #include "bios.hpp" 20 #include "cable.hpp" 21 #include "certificate_service.hpp" 22 #include "chassis.hpp" 23 #include "environment_metrics.hpp" 24 #include "ethernet.hpp" 25 #include "event_service.hpp" 26 #include "hypervisor_system.hpp" 27 #include "log_services.hpp" 28 #include "manager_diagnostic_data.hpp" 29 #include "managers.hpp" 30 #include "memory.hpp" 31 #include "message_registries.hpp" 32 #include "metric_report.hpp" 33 #include "metric_report_definition.hpp" 34 #include "network_protocol.hpp" 35 #include "pcie.hpp" 36 #include "power.hpp" 37 #include "power_subsystem.hpp" 38 #include "processor.hpp" 39 #include "redfish_sessions.hpp" 40 #include "redfish_v1.hpp" 41 #include "roles.hpp" 42 #include "sensors.hpp" 43 #include "service_root.hpp" 44 #include "storage.hpp" 45 #include "systems.hpp" 46 #include "task.hpp" 47 #include "telemetry_service.hpp" 48 #include "thermal.hpp" 49 #include "thermal_subsystem.hpp" 50 #include "trigger.hpp" 51 #include "update_service.hpp" 52 #include "virtual_media.hpp" 53 54 namespace redfish 55 { 56 /* 57 * @brief Top level class installing and providing Redfish services 58 */ 59 class RedfishService 60 { 61 public: 62 /* 63 * @brief Redfish service constructor 64 * 65 * Loads Redfish configuration and installs schema resources 66 * 67 * @param[in] app Crow app on which Redfish will initialize 68 */ 69 explicit RedfishService(App& app) 70 { 71 requestAccountServiceRoutes(app); 72 requestRoutesRoles(app); 73 requestRoutesRoleCollection(app); 74 requestRoutesServiceRoot(app); 75 requestRoutesNetworkProtocol(app); 76 requestRoutesSession(app); 77 requestEthernetInterfacesRoutes(app); 78 #ifdef BMCWEB_ALLOW_DEPRECATED_POWER_THERMAL 79 requestRoutesThermal(app); 80 requestRoutesPower(app); 81 #endif 82 #ifdef BMCWEB_NEW_POWERSUBSYSTEM_THERMALSUBSYSTEM 83 requestRoutesEnvironmentMetrics(app); 84 requestRoutesPowerSubsystem(app); 85 requestRoutesThermalSubsystem(app); 86 #endif 87 requestRoutesManagerCollection(app); 88 requestRoutesManager(app); 89 requestRoutesManagerResetAction(app); 90 requestRoutesManagerResetActionInfo(app); 91 requestRoutesManagerResetToDefaultsAction(app); 92 requestRoutesManagerDiagnosticData(app); 93 requestRoutesChassisCollection(app); 94 requestRoutesChassis(app); 95 requestRoutesChassisResetAction(app); 96 requestRoutesChassisResetActionInfo(app); 97 requestRoutesChassisDrive(app); 98 requestRoutesChassisDriveName(app); 99 requestRoutesUpdateService(app); 100 requestRoutesStorageCollection(app); 101 requestRoutesStorage(app); 102 requestRoutesDrive(app); 103 requestRoutesCable(app); 104 requestRoutesCableCollection(app); 105 #ifdef BMCWEB_INSECURE_ENABLE_REDFISH_FW_TFTP_UPDATE 106 requestRoutesUpdateServiceActionsSimpleUpdate(app); 107 #endif 108 requestRoutesSoftwareInventoryCollection(app); 109 requestRoutesSoftwareInventory(app); 110 111 requestRoutesSystemLogServiceCollection(app); 112 requestRoutesEventLogService(app); 113 requestRoutesPostCodesEntryAdditionalData(app); 114 115 requestRoutesPostCodesLogService(app); 116 requestRoutesPostCodesClear(app); 117 requestRoutesPostCodesEntry(app); 118 requestRoutesPostCodesEntryCollection(app); 119 120 #ifdef BMCWEB_ENABLE_REDFISH_DUMP_LOG 121 requestRoutesSystemDumpService(app); 122 requestRoutesSystemDumpEntryCollection(app); 123 requestRoutesSystemDumpEntry(app); 124 requestRoutesSystemDumpCreate(app); 125 requestRoutesSystemDumpClear(app); 126 127 requestRoutesBMCDumpService(app); 128 requestRoutesBMCDumpEntryCollection(app); 129 requestRoutesBMCDumpEntry(app); 130 requestRoutesBMCDumpCreate(app); 131 requestRoutesBMCDumpClear(app); 132 133 requestRoutesFaultLogDumpService(app); 134 requestRoutesFaultLogDumpEntryCollection(app); 135 requestRoutesFaultLogDumpEntry(app); 136 requestRoutesFaultLogDumpClear(app); 137 #endif 138 139 #ifndef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES 140 requestRoutesJournalEventLogEntryCollection(app); 141 requestRoutesJournalEventLogEntry(app); 142 requestRoutesJournalEventLogClear(app); 143 #endif 144 145 requestRoutesBMCLogServiceCollection(app); 146 #ifdef BMCWEB_ENABLE_REDFISH_BMC_JOURNAL 147 requestRoutesBMCJournalLogService(app); 148 requestRoutesBMCJournalLogEntryCollection(app); 149 requestRoutesBMCJournalLogEntry(app); 150 #endif 151 152 #ifdef BMCWEB_ENABLE_REDFISH_CPU_LOG 153 requestRoutesCrashdumpService(app); 154 requestRoutesCrashdumpEntryCollection(app); 155 requestRoutesCrashdumpEntry(app); 156 requestRoutesCrashdumpFile(app); 157 requestRoutesCrashdumpClear(app); 158 requestRoutesCrashdumpCollect(app); 159 #endif // BMCWEB_ENABLE_REDFISH_CPU_LOG 160 161 requestRoutesProcessorCollection(app); 162 requestRoutesProcessor(app); 163 requestRoutesOperatingConfigCollection(app); 164 requestRoutesOperatingConfig(app); 165 requestRoutesMemoryCollection(app); 166 requestRoutesMemory(app); 167 168 requestRoutesSystemsCollection(app); 169 requestRoutesSystems(app); 170 requestRoutesSystemActionsReset(app); 171 requestRoutesSystemResetActionInfo(app); 172 requestRoutesBiosService(app); 173 requestRoutesBiosReset(app); 174 175 #ifdef BMCWEB_ENABLE_VM_NBDPROXY 176 requestNBDVirtualMediaRoutes(app); 177 #endif // BMCWEB_ENABLE_VM_NBDPROXY 178 179 #ifdef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES 180 requestRoutesDBusLogServiceActionsClear(app); 181 requestRoutesDBusEventLogEntryCollection(app); 182 requestRoutesDBusEventLogEntry(app); 183 requestRoutesDBusEventLogEntryDownload(app); 184 #endif 185 186 #ifdef BMCWEB_ENABLE_REDFISH_HOST_LOGGER 187 requestRoutesSystemHostLogger(app); 188 requestRoutesSystemHostLoggerCollection(app); 189 requestRoutesSystemHostLoggerLogEntry(app); 190 #endif 191 192 requestRoutesMessageRegistryFileCollection(app); 193 requestRoutesMessageRegistryFile(app); 194 requestRoutesMessageRegistry(app); 195 196 requestRoutesCertificateService(app); 197 requestRoutesHTTPSCertificate(app); 198 requestRoutesLDAPCertificate(app); 199 requestRoutesTrustStoreCertificate(app); 200 201 requestRoutesSystemPCIeFunctionCollection(app); 202 requestRoutesSystemPCIeFunction(app); 203 requestRoutesSystemPCIeDeviceCollection(app); 204 requestRoutesSystemPCIeDevice(app); 205 206 requestRoutesSensorCollection(app); 207 requestRoutesSensor(app); 208 209 requestRoutesTaskMonitor(app); 210 requestRoutesTaskService(app); 211 requestRoutesTaskCollection(app); 212 requestRoutesTask(app); 213 requestRoutesEventService(app); 214 requestRoutesEventDestinationCollection(app); 215 requestRoutesEventDestination(app); 216 requestRoutesSubmitTestEvent(app); 217 218 hypervisor::requestRoutesHypervisorSystems(app); 219 220 requestRoutesTelemetryService(app); 221 requestRoutesMetricReportDefinitionCollection(app); 222 requestRoutesMetricReportDefinition(app); 223 requestRoutesMetricReportCollection(app); 224 requestRoutesMetricReport(app); 225 requestRoutesTriggerCollection(app); 226 requestRoutesTrigger(app); 227 228 // Note, this must be the last route registered 229 requestRoutesRedfish(app); 230 } 231 }; 232 233 } // namespace redfish 234