Lines Matching +full:redfish +full:- +full:messages
1 // SPDX-License-Identifier: Apache-2.0
2 // SPDX-FileCopyrightText: Copyright OpenBMC Authors
3 // SPDX-FileCopyrightText: Copyright 2018 Intel Corporation
47 namespace redfish namespace
50 // Interfaces which imply a D-Bus object represents a Processor
57 * requesting data from the given D-Bus object.
60 * @param[in] service D-Bus service to query.
61 * @param[in] objPath D-Bus object to query.
75 messages::internalError(asyncResp->res); in getProcessorUUID()
78 asyncResp->res.jsonValue["UUID"] = property; in getProcessorUUID()
89 asyncResp->res.jsonValue["Status"]["State"] = resource::State::Enabled; in getCpuDataByInterface()
90 asyncResp->res.jsonValue["Status"]["Health"] = resource::Health::OK; in getCpuDataByInterface()
102 messages::internalError(asyncResp->res); in getCpuDataByInterface()
108 asyncResp->res.jsonValue["Status"]["State"] = in getCpuDataByInterface()
117 messages::internalError(asyncResp->res); in getCpuDataByInterface()
122 asyncResp->res.jsonValue["Status"]["Health"] = in getCpuDataByInterface()
132 messages::internalError(asyncResp->res); in getCpuDataByInterface()
135 asyncResp->res.jsonValue["TotalCores"] = *coresCount; in getCpuDataByInterface()
142 asyncResp->res.jsonValue["MaxSpeedMHz"] = *value; in getCpuDataByInterface()
151 asyncResp->res.jsonValue["Socket"] = *value; in getCpuDataByInterface()
159 asyncResp->res.jsonValue["TotalThreads"] = *value; in getCpuDataByInterface()
167 asyncResp->res.jsonValue["ProcessorId"]["EffectiveFamily"] = in getCpuDataByInterface()
176 messages::internalError(asyncResp->res); in getCpuDataByInterface()
181 asyncResp->res.jsonValue["ProcessorId"]["EffectiveModel"] = in getCpuDataByInterface()
190 asyncResp->res in getCpuDataByInterface()
200 messages::internalError(asyncResp->res); in getCpuDataByInterface()
205 asyncResp->res.jsonValue["ProcessorId"]["MicrocodeInfo"] = in getCpuDataByInterface()
214 messages::internalError(asyncResp->res); in getCpuDataByInterface()
219 asyncResp->res.jsonValue["ProcessorId"]["Step"] = in getCpuDataByInterface()
242 messages::internalError(asyncResp->res); in getCpuDataByService()
245 asyncResp->res.jsonValue["Id"] = cpuId; in getCpuDataByService()
246 asyncResp->res.jsonValue["Name"] = "Processor"; in getCpuDataByService()
247 asyncResp->res.jsonValue["ProcessorType"] = in getCpuDataByService()
262 * @brief Translates throttle cause DBUS property to redfish.
266 * @return Returns as a string, the throttle cause in Redfish terms. If
308 messages::internalError(asyncResp->res); in readThrottleProperties()
319 messages::internalError(asyncResp->res); in readThrottleProperties()
323 asyncResp->res.jsonValue["Throttled"] = *status; in readThrottleProperties()
330 messages::internalError(asyncResp->res); in readThrottleProperties()
336 asyncResp->res.jsonValue["ThrottleCauses"] = std::move(rCauses); in readThrottleProperties()
366 messages::internalError(asyncResp->res); in getCpuAssetData()
383 messages::internalError(asyncResp->res); in getCpuAssetData()
387 if (serialNumber != nullptr && !serialNumber->empty()) in getCpuAssetData()
389 asyncResp->res.jsonValue["SerialNumber"] = *serialNumber; in getCpuAssetData()
392 if ((model != nullptr) && !model->empty()) in getCpuAssetData()
394 asyncResp->res.jsonValue["Model"] = *model; in getCpuAssetData()
399 asyncResp->res.jsonValue["Manufacturer"] = *manufacturer; in getCpuAssetData()
402 if (manufacturer->find("Intel") != std::string::npos) in getCpuAssetData()
404 asyncResp->res.jsonValue["ProcessorArchitecture"] = "x86"; in getCpuAssetData()
405 asyncResp->res.jsonValue["InstructionSet"] = "x86-64"; in getCpuAssetData()
407 else if (manufacturer->find("IBM") != std::string::npos) in getCpuAssetData()
409 asyncResp->res.jsonValue["ProcessorArchitecture"] = "Power"; in getCpuAssetData()
410 asyncResp->res.jsonValue["InstructionSet"] = "PowerISA"; in getCpuAssetData()
416 asyncResp->res.jsonValue["PartNumber"] = *partNumber; in getCpuAssetData()
419 if (sparePartNumber != nullptr && !sparePartNumber->empty()) in getCpuAssetData()
421 asyncResp->res.jsonValue["SparePartNumber"] = *sparePartNumber; in getCpuAssetData()
439 messages::internalError(asyncResp->res); in getCpuRevisionData()
451 messages::internalError(asyncResp->res); in getCpuRevisionData()
457 asyncResp->res.jsonValue["Version"] = *version; in getCpuRevisionData()
475 messages::internalError(asyncResp->res); in getAcceleratorDataByService()
488 messages::internalError(asyncResp->res); in getAcceleratorDataByService()
508 asyncResp->res.jsonValue["Id"] = acclrtrId; in getAcceleratorDataByService()
509 asyncResp->res.jsonValue["Name"] = "Processor"; in getAcceleratorDataByService()
510 asyncResp->res.jsonValue["Status"]["State"] = state; in getAcceleratorDataByService()
511 asyncResp->res.jsonValue["Status"]["Health"] = health; in getAcceleratorDataByService()
512 asyncResp->res.jsonValue["ProcessorType"] = in getAcceleratorDataByService()
517 // OperatingConfig D-Bus Types
526 * OperatingConfig D-Bus property.
537 // The D-Bus property does not indicate which bucket is the "high in highSpeedCoreIdsHandler()
553 nlohmann::json& jsonCoreIds = asyncResp->res.jsonValue["HighSpeedCoreIDs"]; in highSpeedCoreIdsHandler()
556 // There may not be any entries in the D-Bus property, so only populate in highSpeedCoreIdsHandler()
566 * data from the given D-Bus object.
569 * @param[in] cpuId CPU D-Bus name.
570 * @param[in] service D-Bus service to query.
571 * @param[in] objPath D-Bus object to query.
589 BMCWEB_LOG_WARNING("D-Bus error: {}, {}", ec, ec.message()); in getCpuConfigData()
590 messages::internalError(asyncResp->res); in getCpuConfigData()
594 nlohmann::json& json = asyncResp->res.jsonValue; in getCpuConfigData()
606 messages::internalError(asyncResp->res); in getCpuConfigData()
612 const std::string& dbusPath = appliedConfig->str; in getCpuConfigData()
615 "/redfish/v1/Systems/{}/Processors/{}/OperatingConfigs", in getCpuConfigData()
619 // Reuse the D-Bus config object name for the Redfish in getCpuConfigData()
623 baseNamePos == (dbusPath.size() - 1)) in getCpuConfigData()
628 messages::internalError(asyncResp->res); in getCpuConfigData()
633 "/redfish/v1/Systems/{}/Processors/{}/OperatingConfigs/{}", in getCpuConfigData()
652 BMCWEB_LOG_WARNING("D-Bus Property Get error: {}", in getCpuConfigData()
654 messages::internalError(asyncResp->res); in getCpuConfigData()
672 * requesting data from the given D-Bus object.
675 * @param[in] service D-Bus service to query.
676 * @param[in] objPath D-Bus object to query.
691 messages::internalError(asyncResp->res); in getCpuLocationCode()
695 asyncResp->res in getCpuLocationCode()
703 * from the given D-Bus object.
706 * @param[in] service D-Bus service to query.
707 * @param[in] objPath D-Bus object to query.
723 messages::internalError(asyncResp->res); in getCpuUniqueId()
726 asyncResp->res in getCpuUniqueId()
732 * Find the D-Bus object representing the requested Processor, and call the
737 * @param[in] processorId Redfish Processor Id.
767 messages::internalError(resp->res); in getProcessorObject()
779 // Filter out objects that don't have the CPU-specific in getProcessorObject()
780 // interfaces to make sure we can return 404 on non-CPUs in getProcessorObject()
781 // (e.g. /redfish/../Processors/dimm0) in getProcessorObject()
806 messages::resourceNotFound(resp->res, "Processor", processorId); in getProcessorObject()
869 * Request all the properties for the given D-Bus object and fill out the
870 * related entries in the Redfish OperatingConfig response.
873 * @param[in] service D-Bus service name to query.
874 * @param[in] objPath D-Bus object to query.
887 BMCWEB_LOG_WARNING("D-Bus error: {}, {}", ec, ec.message()); in getOperatingConfigData()
888 messages::internalError(asyncResp->res); in getOperatingConfigData()
911 messages::internalError(asyncResp->res); in getOperatingConfigData()
915 nlohmann::json& json = asyncResp->res.jsonValue; in getOperatingConfigData()
975 * validation of the input data, and then set the D-Bus property.
1004 messages::internalError(resp->res); in patchAppliedOperatingConfig()
1009 std::string expectedPrefix(std::format("/redfish/v1/Systems/{}/Processors/", in patchAppliedOperatingConfig()
1016 messages::propertyValueIncorrect(resp->res, "AppliedOperatingConfig", in patchAppliedOperatingConfig()
1021 // Generate the D-Bus path of the OperatingConfig object, by assuming it's a in patchAppliedOperatingConfig()
1043 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in handleProcessorHead()
1047 asyncResp->res.addHeader( in handleProcessorHead()
1049 "</redfish/v1/JsonSchemas/Processor/Processor.json>; rel=describedby"); in handleProcessorHead()
1057 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in handleProcessorCollectionHead()
1061 asyncResp->res.addHeader( in handleProcessorCollectionHead()
1063 "</redfish/v1/JsonSchemas/ProcessorCollection/ProcessorCollection.json>; rel=describedby"); in handleProcessorCollectionHead()
1069 "/redfish/v1/Systems/<str>/Processors/<str>/OperatingConfigs/") in requestRoutesOperatingConfigCollection()
1070 .privileges(redfish::privileges::getOperatingConfigCollection) in requestRoutesOperatingConfigCollection()
1077 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in requestRoutesOperatingConfigCollection()
1085 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesOperatingConfigCollection()
1092 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesOperatingConfigCollection()
1096 asyncResp->res.jsonValue["@odata.type"] = in requestRoutesOperatingConfigCollection()
1098 asyncResp->res.jsonValue["@odata.id"] = boost::urls::format( in requestRoutesOperatingConfigCollection()
1099 "/redfish/v1/Systems/{}/Processors/{}/OperatingConfigs", in requestRoutesOperatingConfigCollection()
1101 asyncResp->res.jsonValue["Name"] = "Operating Config Collection"; in requestRoutesOperatingConfigCollection()
1115 BMCWEB_LOG_WARNING("D-Bus error: {}, {}", ec, in requestRoutesOperatingConfigCollection()
1117 messages::internalError(asyncResp->res); in requestRoutesOperatingConfigCollection()
1139 "/redfish/v1/Systems/{}/Processors/{}/OperatingConfigs", in requestRoutesOperatingConfigCollection()
1152 "/redfish/v1/Systems/<str>/Processors/<str>/OperatingConfigs/<str>/") in requestRoutesOperatingConfig()
1153 .privileges(redfish::privileges::getOperatingConfig) in requestRoutesOperatingConfig()
1161 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in requestRoutesOperatingConfig()
1168 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesOperatingConfig()
1175 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesOperatingConfig()
1190 BMCWEB_LOG_WARNING("D-Bus error: {}, {}", ec, in requestRoutesOperatingConfig()
1192 messages::internalError(asyncResp->res); in requestRoutesOperatingConfig()
1206 nlohmann::json& json = asyncResp->res.jsonValue; in requestRoutesOperatingConfig()
1210 "/redfish/v1/Systems/{}/Processors/{}/OperatingConfigs/{}", in requestRoutesOperatingConfig()
1216 // Just use the first implementation of the object - not in requestRoutesOperatingConfig()
1220 asyncResp, serviceMap.begin()->first, objectPath); in requestRoutesOperatingConfig()
1223 messages::resourceNotFound(asyncResp->res, in requestRoutesOperatingConfig()
1234 BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/Processors/") in requestRoutesProcessorCollection()
1235 .privileges(redfish::privileges::headProcessorCollection) in requestRoutesProcessorCollection()
1239 BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/Processors/") in requestRoutesProcessorCollection()
1240 .privileges(redfish::privileges::getProcessorCollection) in requestRoutesProcessorCollection()
1246 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in requestRoutesProcessorCollection()
1253 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesProcessorCollection()
1260 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesProcessorCollection()
1265 asyncResp->res.addHeader( in requestRoutesProcessorCollection()
1267 … "</redfish/v1/JsonSchemas/ProcessorCollection/ProcessorCollection.json>; rel=describedby"); in requestRoutesProcessorCollection()
1269 asyncResp->res.jsonValue["@odata.type"] = in requestRoutesProcessorCollection()
1271 asyncResp->res.jsonValue["Name"] = "Processor Collection"; in requestRoutesProcessorCollection()
1273 asyncResp->res.jsonValue["@odata.id"] = in requestRoutesProcessorCollection()
1274 std::format("/redfish/v1/Systems/{}/Processors", in requestRoutesProcessorCollection()
1279 boost::urls::format("/redfish/v1/Systems/{}/Processors", in requestRoutesProcessorCollection()
1291 BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/Processors/<str>/") in requestRoutesProcessor()
1292 .privileges(redfish::privileges::headProcessor) in requestRoutesProcessor()
1296 BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/Processors/<str>/") in requestRoutesProcessor()
1297 .privileges(redfish::privileges::getProcessor) in requestRoutesProcessor()
1304 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in requestRoutesProcessor()
1311 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesProcessor()
1317 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesProcessor()
1322 asyncResp->res.addHeader( in requestRoutesProcessor()
1324 "</redfish/v1/JsonSchemas/Processor/Processor.json>; rel=describedby"); in requestRoutesProcessor()
1325 asyncResp->res.jsonValue["@odata.type"] = in requestRoutesProcessor()
1327 asyncResp->res.jsonValue["@odata.id"] = boost::urls::format( in requestRoutesProcessor()
1328 "/redfish/v1/Systems/{}/Processors/{}", in requestRoutesProcessor()
1336 BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/Processors/<str>/") in requestRoutesProcessor()
1337 .privileges(redfish::privileges::patchProcessor) in requestRoutesProcessor()
1343 if (!redfish::setUpRedfishRoute(app, req, asyncResp)) in requestRoutesProcessor()
1350 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesProcessor()
1356 messages::resourceNotFound(asyncResp->res, "ComputerSystem", in requestRoutesProcessor()
1363 req, asyncResp->res, // in requestRoutesProcessor()
1372 // Check for 404 and find matching D-Bus object, then run in requestRoutesProcessor()
1382 } // namespace redfish