summaryrefslogtreecommitdiff
path: root/redfish-core/lib/processor.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'redfish-core/lib/processor.hpp')
-rw-r--r--redfish-core/lib/processor.hpp125
1 files changed, 61 insertions, 64 deletions
diff --git a/redfish-core/lib/processor.hpp b/redfish-core/lib/processor.hpp
index 59b7ff29d7..ec24735ba1 100644
--- a/redfish-core/lib/processor.hpp
+++ b/redfish-core/lib/processor.hpp
@@ -591,8 +591,7 @@ inline void getCpuConfigData(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
},
service, dbusPath, "org.freedesktop.DBus.Properties",
"Get",
- "xyz.openbmc_project.Inventory.Item.Cpu."
- "OperatingConfig",
+ "xyz.openbmc_project.Inventory.Item.Cpu.OperatingConfig",
"BaseSpeedPrioritySettings");
}
else if (dbusPropName == "BaseSpeedPriorityEnabled")
@@ -778,8 +777,8 @@ inline void getProcessorData(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
{
getCpuAssetData(aResp, serviceName, objectPath);
}
- else if (interface == "xyz.openbmc_project.Inventory."
- "Decorator.Revision")
+ else if (interface ==
+ "xyz.openbmc_project.Inventory.Decorator.Revision")
{
getCpuRevisionData(aResp, serviceName, objectPath);
}
@@ -788,19 +787,20 @@ inline void getProcessorData(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
getCpuDataByService(aResp, processorId, serviceName,
objectPath);
}
- else if (interface == "xyz.openbmc_project.Inventory."
- "Item.Accelerator")
+ else if (interface ==
+ "xyz.openbmc_project.Inventory.Item.Accelerator")
{
getAcceleratorDataByService(aResp, processorId, serviceName,
objectPath);
}
- else if (interface == "xyz.openbmc_project.Control.Processor."
- "CurrentOperatingConfig")
+ else if (
+ interface ==
+ "xyz.openbmc_project.Control.Processor.CurrentOperatingConfig")
{
getCpuConfigData(aResp, processorId, serviceName, objectPath);
}
- else if (interface == "xyz.openbmc_project.Inventory."
- "Decorator.LocationCode")
+ else if (interface ==
+ "xyz.openbmc_project.Inventory.Decorator.LocationCode")
{
getCpuLocationCode(aResp, serviceName, objectPath);
}
@@ -808,8 +808,8 @@ inline void getProcessorData(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
{
getProcessorUUID(aResp, serviceName, objectPath);
}
- else if (interface == "xyz.openbmc_project.Inventory."
- "Decorator.UniqueIdentifier")
+ else if (interface ==
+ "xyz.openbmc_project.Inventory.Decorator.UniqueIdentifier")
{
getCpuUniqueId(aResp, serviceName, objectPath);
}
@@ -1068,61 +1068,58 @@ inline void requestRoutesOperatingConfigCollection(App& app)
BMCWEB_ROUTE(
app, "/redfish/v1/Systems/system/Processors/<str>/OperatingConfigs/")
.privileges(redfish::privileges::getOperatingConfigCollection)
- .methods(boost::beast::http::verb::get)(
- [](const crow::Request& req,
- const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
- const std::string& cpuName) {
- asyncResp->res.jsonValue["@odata.type"] =
- "#OperatingConfigCollection.OperatingConfigCollection";
- asyncResp->res.jsonValue["@odata.id"] = req.url;
- asyncResp->res.jsonValue["Name"] =
- "Operating Config Collection";
-
- // First find the matching CPU object so we know how to
- // constrain our search for related Config objects.
- crow::connections::systemBus->async_method_call(
- [asyncResp,
- cpuName](const boost::system::error_code ec,
- const std::vector<std::string>& objects) {
- if (ec)
- {
- BMCWEB_LOG_WARNING << "D-Bus error: " << ec << ", "
- << ec.message();
- messages::internalError(asyncResp->res);
- return;
- }
+ .methods(
+ boost::beast::http::verb::get)([](const crow::Request& req,
+ const std::shared_ptr<
+ bmcweb::AsyncResp>& asyncResp,
+ const std::string& cpuName) {
+ asyncResp->res.jsonValue["@odata.type"] =
+ "#OperatingConfigCollection.OperatingConfigCollection";
+ asyncResp->res.jsonValue["@odata.id"] = req.url;
+ asyncResp->res.jsonValue["Name"] = "Operating Config Collection";
+
+ // First find the matching CPU object so we know how to
+ // constrain our search for related Config objects.
+ crow::connections::systemBus->async_method_call(
+ [asyncResp, cpuName](const boost::system::error_code ec,
+ const std::vector<std::string>& objects) {
+ if (ec)
+ {
+ BMCWEB_LOG_WARNING << "D-Bus error: " << ec << ", "
+ << ec.message();
+ messages::internalError(asyncResp->res);
+ return;
+ }
- for (const std::string& object : objects)
+ for (const std::string& object : objects)
+ {
+ if (!boost::ends_with(object, cpuName))
{
- if (!boost::ends_with(object, cpuName))
- {
- continue;
- }
-
- // Not expected that there will be multiple matching
- // CPU objects, but if there are just use the first
- // one.
-
- // Use the common search routine to construct the
- // Collection of all Config objects under this CPU.
- collection_util::getCollectionMembers(
- asyncResp,
- "/redfish/v1/Systems/system/Processors/" +
- cpuName + "/OperatingConfigs",
- {"xyz.openbmc_project.Inventory.Item.Cpu."
- "OperatingConfig"},
- object.c_str());
- return;
+ continue;
}
- },
- "xyz.openbmc_project.ObjectMapper",
- "/xyz/openbmc_project/object_mapper",
- "xyz.openbmc_project.ObjectMapper", "GetSubTreePaths",
- "/xyz/openbmc_project/inventory", 0,
- std::array<const char*, 1>{
- "xyz.openbmc_project.Control.Processor."
- "CurrentOperatingConfig"});
- });
+
+ // Not expected that there will be multiple matching
+ // CPU objects, but if there are just use the first
+ // one.
+
+ // Use the common search routine to construct the
+ // Collection of all Config objects under this CPU.
+ collection_util::getCollectionMembers(
+ asyncResp,
+ "/redfish/v1/Systems/system/Processors/" + cpuName +
+ "/OperatingConfigs",
+ {"xyz.openbmc_project.Inventory.Item.Cpu.OperatingConfig"},
+ object.c_str());
+ return;
+ }
+ },
+ "xyz.openbmc_project.ObjectMapper",
+ "/xyz/openbmc_project/object_mapper",
+ "xyz.openbmc_project.ObjectMapper", "GetSubTreePaths",
+ "/xyz/openbmc_project/inventory", 0,
+ std::array<const char*, 1>{
+ "xyz.openbmc_project.Control.Processor.CurrentOperatingConfig"});
+ });
}
inline void requestRoutesOperatingConfig(App& app)