Move getProperty calls to utility
Having all dbus calls run through the same utility reduces the amount of
generated code, and more importantly, gives us a place where we can log
the requests and responses to help with debugging.
Tested: Redfish service validator passes.
Change-Id: Ic1bf45130b5069cd57f7af26e12c8d3159c87c67
Signed-off-by: Ed Tanous <etanous@nvidia.com>
diff --git a/include/dbus_utility.hpp b/include/dbus_utility.hpp
index efeb2a0..68b3930 100644
--- a/include/dbus_utility.hpp
+++ b/include/dbus_utility.hpp
@@ -140,13 +140,57 @@
return count >= index;
}
+inline void
+ getAllProperties(const std::string& service, const std::string& objectPath,
+ const std::string& interface,
+ std::function<void(const boost::system::error_code&,
+ const DBusPropertiesMap&)>&& callback)
+{
+ sdbusplus::asio::getAllProperties(*crow::connections::systemBus, service,
+ objectPath, interface,
+ std::move(callback));
+}
+
+template <typename PropertyType>
+inline void getProperty(
+ const std::string& service, const std::string& objectPath,
+ const std::string& interface, const std::string& propertyName,
+ std::function<void(const boost::system::error_code&, const PropertyType&)>&&
+ callback)
+{
+ sdbusplus::asio::getProperty<PropertyType>(
+ *crow::connections::systemBus, service, objectPath, interface,
+ propertyName, std::move(callback));
+}
+
+template <typename PropertyType>
+inline void getProperty(
+ sdbusplus::asio::connection& /*conn*/, const std::string& service,
+ const std::string& objectPath, const std::string& interface,
+ const std::string& propertyName,
+ std::function<void(const boost::system::error_code&, const PropertyType&)>&&
+ callback)
+{
+ getProperty(service, objectPath, interface, propertyName,
+ std::move(callback));
+}
+
+inline void getAllProperties(
+ sdbusplus::asio::connection& /*conn*/, const std::string& service,
+ const std::string& objectPath, const std::string& interface,
+ std::function<void(const boost::system::error_code&,
+ const DBusPropertiesMap&)>&& callback)
+{
+ getAllProperties(service, objectPath, interface, std::move(callback));
+}
+
template <typename Callback>
inline void checkDbusPathExists(const std::string& path, Callback&& callback)
{
crow::connections::systemBus->async_method_call(
[callback = std::forward<Callback>(callback)](
const boost::system::error_code& ec,
- const dbus::utility::MapperGetObject& objectNames) {
+ const MapperGetObject& objectNames) {
callback(!ec && !objectNames.empty());
},
"xyz.openbmc_project.ObjectMapper",
@@ -283,9 +327,9 @@
std::function<void(const boost::system::error_code&,
const MapperEndPoints&)>&& callback)
{
- sdbusplus::asio::getProperty<MapperEndPoints>(
- *crow::connections::systemBus, "xyz.openbmc_project.ObjectMapper", path,
- "xyz.openbmc_project.Association", "endpoints", std::move(callback));
+ getProperty<MapperEndPoints>("xyz.openbmc_project.ObjectMapper", path,
+ "xyz.openbmc_project.Association", "endpoints",
+ std::move(callback));
}
inline void getManagedObjects(
diff --git a/include/openbmc_dbus_rest.hpp b/include/openbmc_dbus_rest.hpp
index fc074d6..8a6830e 100644
--- a/include/openbmc_dbus_rest.hpp
+++ b/include/openbmc_dbus_rest.hpp
@@ -181,8 +181,8 @@
BMCWEB_LOG_DEBUG("getPropertiesForEnumerate {} {} {}", objectPath, service,
interface);
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, service, objectPath, interface,
+ dbus::utility::getAllProperties(
+ service, objectPath, interface,
[asyncResp, objectPath, service,
interface](const boost::system::error_code& ec,
const dbus::utility::DBusPropertiesMap& propertiesList) {
diff --git a/include/vm_websocket.hpp b/include/vm_websocket.hpp
index 1e56cd9..5d92f5f 100644
--- a/include/vm_websocket.hpp
+++ b/include/vm_websocket.hpp
@@ -474,8 +474,8 @@
std::string path =
std::format("/xyz/openbmc_project/VirtualMedia/Proxy/Slot_{}", index);
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, "xyz.openbmc_project.VirtualMedia", path,
+ dbus::utility::getAllProperties(
+ "xyz.openbmc_project.VirtualMedia", path,
"xyz.openbmc_project.VirtualMedia.MountPoint",
[&conn, path](const boost::system::error_code& ec,
const dbus::utility::DBusPropertiesMap& propertiesList) {
diff --git a/redfish-core/include/snmp_trap_event_clients.hpp b/redfish-core/include/snmp_trap_event_clients.hpp
index ebc0280..39285cc 100644
--- a/redfish-core/include/snmp_trap_event_clients.hpp
+++ b/redfish-core/include/snmp_trap_event_clients.hpp
@@ -70,9 +70,9 @@
asyncResp->res.jsonValue["EventFormatType"] =
event_destination::EventFormatType::Event;
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, "xyz.openbmc_project.Network.SNMP",
- objectPath, "xyz.openbmc_project.Network.Client",
+ dbus::utility::getAllProperties(
+ "xyz.openbmc_project.Network.SNMP", objectPath,
+ "xyz.openbmc_project.Network.Client",
[asyncResp](const boost::system::error_code& ec,
const dbus::utility::DBusPropertiesMap& properties) {
afterGetSnmpTrapClientdata(asyncResp, ec, properties);
diff --git a/redfish-core/include/utils/sw_utils.hpp b/redfish-core/include/utils/sw_utils.hpp
index ef3163b..cbf2ae6 100644
--- a/redfish-core/include/utils/sw_utils.hpp
+++ b/redfish-core/include/utils/sw_utils.hpp
@@ -199,7 +199,7 @@
// Now grab its version
// info
- sdbusplus::asio::getAllProperties(
+ dbus::utility::getAllProperties(
*crow::connections::systemBus, obj.second[0].first, obj.first,
"xyz.openbmc_project.Software.Version",
[asyncResp, swId, runningImage, swVersionPurpose,
@@ -377,9 +377,8 @@
{
BMCWEB_LOG_DEBUG("getSwStatus: swId {} svc {}", *swId, dbusSvc);
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, dbusSvc,
- "/xyz/openbmc_project/software/" + *swId,
+ dbus::utility::getAllProperties(
+ dbusSvc, "/xyz/openbmc_project/software/" + *swId,
"xyz.openbmc_project.Software.Activation",
[asyncResp,
swId](const boost::system::error_code& ec,
diff --git a/redfish-core/lib/account_service.hpp b/redfish-core/lib/account_service.hpp
index bf32014..d54db20 100644
--- a/redfish-core/lib/account_service.hpp
+++ b/redfish-core/lib/account_service.hpp
@@ -1415,9 +1415,9 @@
asyncResp->res.jsonValue["LDAP"]["Certificates"]["@odata.id"] =
"/redfish/v1/AccountService/LDAP/Certificates";
}
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, "xyz.openbmc_project.User.Manager",
- "/xyz/openbmc_project/user", "xyz.openbmc_project.User.AccountPolicy",
+ dbus::utility::getAllProperties(
+ "xyz.openbmc_project.User.Manager", "/xyz/openbmc_project/user",
+ "xyz.openbmc_project.User.AccountPolicy",
[asyncResp](const boost::system::error_code& ec,
const dbus::utility::DBusPropertiesMap& propertiesList) {
if (ec)
@@ -1923,10 +1923,9 @@
bool enabled = enabledJson.value_or(true);
// Reading AllGroups property
- sdbusplus::asio::getProperty<std::vector<std::string>>(
- *crow::connections::systemBus, "xyz.openbmc_project.User.Manager",
- "/xyz/openbmc_project/user", "xyz.openbmc_project.User.Manager",
- "AllGroups",
+ dbus::utility::getProperty<std::vector<std::string>>(
+ "xyz.openbmc_project.User.Manager", "/xyz/openbmc_project/user",
+ "xyz.openbmc_project.User.Manager", "AllGroups",
[asyncResp, username, password{std::move(password)}, roleId, enabled,
accountTypes](const boost::system::error_code& ec,
const std::vector<std::string>& allGroupsList) {
diff --git a/redfish-core/lib/cable.hpp b/redfish-core/lib/cable.hpp
index 27ee276..7493b29 100644
--- a/redfish-core/lib/cable.hpp
+++ b/redfish-core/lib/cable.hpp
@@ -91,7 +91,7 @@
{
if (interface == "xyz.openbmc_project.Inventory.Item.Cable")
{
- sdbusplus::asio::getAllProperties(
+ dbus::utility::getAllProperties(
*crow::connections::systemBus, service, cableObjectPath,
interface,
[asyncResp](
@@ -102,9 +102,8 @@
}
else if (interface == "xyz.openbmc_project.Inventory.Item")
{
- sdbusplus::asio::getProperty<bool>(
- *crow::connections::systemBus, service, cableObjectPath,
- interface, "Present",
+ dbus::utility::getProperty<bool>(
+ service, cableObjectPath, interface, "Present",
[asyncResp, cableObjectPath](
const boost::system::error_code& ec, bool present) {
if (ec)
diff --git a/redfish-core/lib/certificate_service.hpp b/redfish-core/lib/certificate_service.hpp
index f16b169..26b2f96 100644
--- a/redfish-core/lib/certificate_service.hpp
+++ b/redfish-core/lib/certificate_service.hpp
@@ -299,8 +299,8 @@
{
BMCWEB_LOG_DEBUG("getCertificateProperties Path={} certId={} certURl={}",
objectPath, certId, certURL);
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, service, objectPath, certs::certPropIntf,
+ dbus::utility::getAllProperties(
+ service, objectPath, certs::certPropIntf,
[asyncResp, certURL, certId,
name](const boost::system::error_code& ec,
const dbus::utility::DBusPropertiesMap& properties) {
diff --git a/redfish-core/lib/chassis.hpp b/redfish-core/lib/chassis.hpp
index e2461e9..d405e75 100644
--- a/redfish-core/lib/chassis.hpp
+++ b/redfish-core/lib/chassis.hpp
@@ -104,9 +104,9 @@
inline void getStorageLink(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const sdbusplus::message::object_path& path)
{
- sdbusplus::asio::getProperty<std::vector<std::string>>(
- *crow::connections::systemBus, "xyz.openbmc_project.ObjectMapper",
- (path / "storage").str, "xyz.openbmc_project.Association", "endpoints",
+ dbus::utility::getProperty<std::vector<std::string>>(
+ "xyz.openbmc_project.ObjectMapper", (path / "storage").str,
+ "xyz.openbmc_project.Association", "endpoints",
[asyncResp](const boost::system::error_code& ec,
const std::vector<std::string>& storageList) {
if (ec)
@@ -147,8 +147,8 @@
inline void getChassisState(std::shared_ptr<bmcweb::AsyncResp> asyncResp)
{
// crow::connections::systemBus->async_method_call(
- sdbusplus::asio::getProperty<std::string>(
- *crow::connections::systemBus, "xyz.openbmc_project.State.Chassis",
+ dbus::utility::getProperty<std::string>(
+ "xyz.openbmc_project.State.Chassis",
"/xyz/openbmc_project/state/chassis0",
"xyz.openbmc_project.State.Chassis", "CurrentPowerState",
[asyncResp{std::move(asyncResp)}](const boost::system::error_code& ec,
@@ -212,8 +212,8 @@
BMCWEB_LOG_DEBUG("Get intrusion status by service ");
- sdbusplus::asio::getProperty<std::string>(
- *crow::connections::systemBus, service.first, object.first,
+ dbus::utility::getProperty<std::string>(
+ service.first, object.first,
"xyz.openbmc_project.Chassis.Intrusion", "Status",
[asyncResp](const boost::system::error_code& ec1,
const std::string& value) {
@@ -377,8 +377,8 @@
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& connectionName, const std::string& path)
{
- sdbusplus::asio::getProperty<std::string>(
- *crow::connections::systemBus, connectionName, path,
+ dbus::utility::getProperty<std::string>(
+ connectionName, path,
"xyz.openbmc_project.Inventory.Decorator.LocationCode", "LocationCode",
[asyncResp](const boost::system::error_code& ec,
const std::string& property) {
@@ -399,9 +399,8 @@
const std::string& connectionName,
const std::string& path)
{
- sdbusplus::asio::getProperty<std::string>(
- *crow::connections::systemBus, connectionName, path,
- "xyz.openbmc_project.Common.UUID", "UUID",
+ dbus::utility::getProperty<std::string>(
+ connectionName, path, "xyz.openbmc_project.Common.UUID", "UUID",
[asyncResp](const boost::system::error_code& ec,
const std::string& chassisUUID) {
if (ec)
@@ -619,9 +618,8 @@
{
if (interface == assetTagInterface)
{
- sdbusplus::asio::getProperty<std::string>(
- *crow::connections::systemBus, connectionName, path,
- assetTagInterface, "AssetTag",
+ dbus::utility::getProperty<std::string>(
+ connectionName, path, assetTagInterface, "AssetTag",
[asyncResp, chassisId](const boost::system::error_code& ec2,
const std::string& property) {
if (ec2)
@@ -636,9 +634,8 @@
}
else if (interface == replaceableInterface)
{
- sdbusplus::asio::getProperty<bool>(
- *crow::connections::systemBus, connectionName, path,
- replaceableInterface, "HotPluggable",
+ dbus::utility::getProperty<bool>(
+ connectionName, path, replaceableInterface, "HotPluggable",
[asyncResp, chassisId](const boost::system::error_code& ec2,
const bool property) {
if (ec2)
@@ -654,9 +651,8 @@
}
else if (interface == revisionInterface)
{
- sdbusplus::asio::getProperty<std::string>(
- *crow::connections::systemBus, connectionName, path,
- revisionInterface, "Version",
+ dbus::utility::getProperty<std::string>(
+ connectionName, path, revisionInterface, "Version",
[asyncResp, chassisId](const boost::system::error_code& ec2,
const std::string& property) {
if (ec2)
@@ -681,7 +677,7 @@
}
}
- sdbusplus::asio::getAllProperties(
+ dbus::utility::getAllProperties(
*crow::connections::systemBus, connectionName, path,
"xyz.openbmc_project.Inventory.Decorator.Asset",
[asyncResp, chassisId,
diff --git a/redfish-core/lib/fabric_adapters.hpp b/redfish-core/lib/fabric_adapters.hpp
index 20e6726..b899c03 100644
--- a/redfish-core/lib/fabric_adapters.hpp
+++ b/redfish-core/lib/fabric_adapters.hpp
@@ -28,8 +28,8 @@
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& serviceName, const std::string& fabricAdapterPath)
{
- sdbusplus::asio::getProperty<std::string>(
- *crow::connections::systemBus, serviceName, fabricAdapterPath,
+ dbus::utility::getProperty<std::string>(
+ serviceName, fabricAdapterPath,
"xyz.openbmc_project.Inventory.Decorator.LocationCode", "LocationCode",
[asyncResp](const boost::system::error_code& ec,
const std::string& property) {
@@ -53,8 +53,8 @@
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& serviceName, const std::string& fabricAdapterPath)
{
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, serviceName, fabricAdapterPath,
+ dbus::utility::getAllProperties(
+ serviceName, fabricAdapterPath,
"xyz.openbmc_project.Inventory.Decorator.Asset",
[fabricAdapterPath, asyncResp{asyncResp}](
const boost::system::error_code& ec,
@@ -111,9 +111,9 @@
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& serviceName, const std::string& fabricAdapterPath)
{
- sdbusplus::asio::getProperty<bool>(
- *crow::connections::systemBus, serviceName, fabricAdapterPath,
- "xyz.openbmc_project.Inventory.Item", "Present",
+ dbus::utility::getProperty<bool>(
+ serviceName, fabricAdapterPath, "xyz.openbmc_project.Inventory.Item",
+ "Present",
[asyncResp](const boost::system::error_code& ec, const bool present) {
if (ec)
{
@@ -137,8 +137,8 @@
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& serviceName, const std::string& fabricAdapterPath)
{
- sdbusplus::asio::getProperty<bool>(
- *crow::connections::systemBus, serviceName, fabricAdapterPath,
+ dbus::utility::getProperty<bool>(
+ serviceName, fabricAdapterPath,
"xyz.openbmc_project.State.Decorator.OperationalStatus", "Functional",
[asyncResp](const boost::system::error_code& ec,
const bool functional) {
diff --git a/redfish-core/lib/fan.hpp b/redfish-core/lib/fan.hpp
index 28b995e..4dbe58d 100644
--- a/redfish-core/lib/fan.hpp
+++ b/redfish-core/lib/fan.hpp
@@ -233,8 +233,8 @@
inline void getFanHealth(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& fanPath, const std::string& service)
{
- sdbusplus::asio::getProperty<bool>(
- *crow::connections::systemBus, service, fanPath,
+ dbus::utility::getProperty<bool>(
+ service, fanPath,
"xyz.openbmc_project.State.Decorator.OperationalStatus", "Functional",
[asyncResp](const boost::system::error_code& ec, const bool value) {
if (ec)
@@ -259,9 +259,8 @@
inline void getFanState(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& fanPath, const std::string& service)
{
- sdbusplus::asio::getProperty<bool>(
- *crow::connections::systemBus, service, fanPath,
- "xyz.openbmc_project.Inventory.Item", "Present",
+ dbus::utility::getProperty<bool>(
+ service, fanPath, "xyz.openbmc_project.Inventory.Item", "Present",
[asyncResp](const boost::system::error_code& ec, const bool value) {
if (ec)
{
@@ -285,9 +284,8 @@
inline void getFanAsset(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& fanPath, const std::string& service)
{
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, service, fanPath,
- "xyz.openbmc_project.Inventory.Decorator.Asset",
+ dbus::utility::getAllProperties(
+ service, fanPath, "xyz.openbmc_project.Inventory.Decorator.Asset",
[fanPath, asyncResp{asyncResp}](
const boost::system::error_code& ec,
const dbus::utility::DBusPropertiesMap& assetList) {
@@ -344,8 +342,8 @@
const std::string& fanPath,
const std::string& service)
{
- sdbusplus::asio::getProperty<std::string>(
- *crow::connections::systemBus, service, fanPath,
+ dbus::utility::getProperty<std::string>(
+ service, fanPath,
"xyz.openbmc_project.Inventory.Decorator.LocationCode", "LocationCode",
[asyncResp](const boost::system::error_code& ec,
const std::string& property) {
diff --git a/redfish-core/lib/hypervisor_system.hpp b/redfish-core/lib/hypervisor_system.hpp
index b05112f..74e5409 100644
--- a/redfish-core/lib/hypervisor_system.hpp
+++ b/redfish-core/lib/hypervisor_system.hpp
@@ -38,8 +38,8 @@
getHypervisorState(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
{
BMCWEB_LOG_DEBUG("Get hypervisor state information.");
- sdbusplus::asio::getProperty<std::string>(
- *crow::connections::systemBus, "xyz.openbmc_project.State.Hypervisor",
+ dbus::utility::getProperty<std::string>(
+ "xyz.openbmc_project.State.Hypervisor",
"/xyz/openbmc_project/state/hypervisor0",
"xyz.openbmc_project.State.Host", "CurrentHostState",
[asyncResp](const boost::system::error_code& ec,
diff --git a/redfish-core/lib/led.hpp b/redfish-core/lib/led.hpp
index 1acde11..d4f4b65 100644
--- a/redfish-core/lib/led.hpp
+++ b/redfish-core/lib/led.hpp
@@ -37,8 +37,8 @@
getIndicatorLedState(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
{
BMCWEB_LOG_DEBUG("Get led groups");
- sdbusplus::asio::getProperty<bool>(
- *crow::connections::systemBus, "xyz.openbmc_project.LED.GroupManager",
+ dbus::utility::getProperty<bool>(
+ "xyz.openbmc_project.LED.GroupManager",
"/xyz/openbmc_project/led/groups/enclosure_identify_blink",
"xyz.openbmc_project.Led.Group", "Asserted",
[asyncResp](const boost::system::error_code& ec, const bool blinking) {
@@ -60,8 +60,7 @@
return;
}
- sdbusplus::asio::getProperty<bool>(
- *crow::connections::systemBus,
+ dbus::utility::getProperty<bool>(
"xyz.openbmc_project.LED.GroupManager",
"/xyz/openbmc_project/led/groups/enclosure_identify",
"xyz.openbmc_project.Led.Group", "Asserted",
@@ -162,8 +161,8 @@
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
{
BMCWEB_LOG_DEBUG("Get LocationIndicatorActive");
- sdbusplus::asio::getProperty<bool>(
- *crow::connections::systemBus, "xyz.openbmc_project.LED.GroupManager",
+ dbus::utility::getProperty<bool>(
+ "xyz.openbmc_project.LED.GroupManager",
"/xyz/openbmc_project/led/groups/enclosure_identify_blink",
"xyz.openbmc_project.Led.Group", "Asserted",
[asyncResp](const boost::system::error_code& ec, const bool blinking) {
@@ -184,8 +183,7 @@
return;
}
- sdbusplus::asio::getProperty<bool>(
- *crow::connections::systemBus,
+ dbus::utility::getProperty<bool>(
"xyz.openbmc_project.LED.GroupManager",
"/xyz/openbmc_project/led/groups/enclosure_identify",
"xyz.openbmc_project.Led.Group", "Asserted",
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index 73eb0b1..0f5641f 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -1766,8 +1766,8 @@
// DBus implementation of EventLog/Entries
// Make call to Logging Service to find all log entry objects
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, "xyz.openbmc_project.Logging",
+ dbus::utility::getAllProperties(
+ "xyz.openbmc_project.Logging",
"/xyz/openbmc_project/logging/entry/" + entryID, "",
[asyncResp, entryID](const boost::system::error_code& ec,
const dbus::utility::DBusPropertiesMap& resp) {
@@ -2788,10 +2788,9 @@
logEntryJson.update(logEntry);
}
};
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, crashdumpObject,
- crashdumpPath + std::string("/") + logID, crashdumpInterface,
- std::move(getStoredLogCallback));
+ dbus::utility::getAllProperties(
+ crashdumpObject, crashdumpPath + std::string("/") + logID,
+ crashdumpInterface, std::move(getStoredLogCallback));
}
inline void requestRoutesCrashdumpEntryCollection(App& app)
@@ -2994,7 +2993,7 @@
boost::beast::http::field::content_disposition,
"attachment");
};
- sdbusplus::asio::getAllProperties(
+ dbus::utility::getAllProperties(
*crow::connections::systemBus, crashdumpObject,
crashdumpPath + std::string("/") + logID,
crashdumpInterface, std::move(getStoredLogCallback));
diff --git a/redfish-core/lib/manager_diagnostic_data.hpp b/redfish-core/lib/manager_diagnostic_data.hpp
index 1ca80fd..cb917e1 100644
--- a/redfish-core/lib/manager_diagnostic_data.hpp
+++ b/redfish-core/lib/manager_diagnostic_data.hpp
@@ -2,6 +2,7 @@
#include "app.hpp"
#include "async_resp.hpp"
+#include "dbus_utility.hpp"
#include "http_request.hpp"
#include "privileges.hpp"
#include "query.hpp"
@@ -83,9 +84,9 @@
constexpr auto freeStorageObjPath =
"/xyz/openbmc_project/metric/bmc/storage/rw";
- sdbusplus::asio::getProperty<double>(
- *crow::connections::systemBus, healthMonitorServiceName,
- freeStorageObjPath, valueInterface, valueProperty,
+ dbus::utility::getProperty<double>(
+ healthMonitorServiceName, freeStorageObjPath, valueInterface,
+ valueProperty,
std::bind_front(setBytesProperty, asyncResp,
nlohmann::json::json_pointer("/FreeStorageSpaceKiB")));
}
@@ -118,15 +119,14 @@
constexpr auto userCPUObjPath = "/xyz/openbmc_project/metric/bmc/cpu/user";
using json_pointer = nlohmann::json::json_pointer;
- sdbusplus::asio::getProperty<double>(
- *crow::connections::systemBus, healthMonitorServiceName,
- kernelCPUObjPath, valueInterface, valueProperty,
+ dbus::utility::getProperty<double>(
+ healthMonitorServiceName, kernelCPUObjPath, valueInterface,
+ valueProperty,
std::bind_front(setPercentProperty, asyncResp,
json_pointer("/ProcessorStatistics/KernelPercent")));
- sdbusplus::asio::getProperty<double>(
- *crow::connections::systemBus, healthMonitorServiceName, userCPUObjPath,
- valueInterface, valueProperty,
+ dbus::utility::getProperty<double>(
+ healthMonitorServiceName, userCPUObjPath, valueInterface, valueProperty,
std::bind_front(setPercentProperty, asyncResp,
json_pointer("/ProcessorStatistics/UserPercent")));
}
@@ -137,42 +137,42 @@
using json_pointer = nlohmann::json::json_pointer;
constexpr auto availableMemoryObjPath =
"/xyz/openbmc_project/metric/bmc/memory/available";
- sdbusplus::asio::getProperty<double>(
- *crow::connections::systemBus, healthMonitorServiceName,
- availableMemoryObjPath, valueInterface, valueProperty,
+ dbus::utility::getProperty<double>(
+ healthMonitorServiceName, availableMemoryObjPath, valueInterface,
+ valueProperty,
std::bind_front(setBytesProperty, asyncResp,
json_pointer("/MemoryStatistics/AvailableBytes")));
constexpr auto bufferedAndCachedMemoryObjPath =
"/xyz/openbmc_project/metric/bmc/memory/buffered_and_cached";
- sdbusplus::asio::getProperty<double>(
- *crow::connections::systemBus, healthMonitorServiceName,
- bufferedAndCachedMemoryObjPath, valueInterface, valueProperty,
+ dbus::utility::getProperty<double>(
+ healthMonitorServiceName, bufferedAndCachedMemoryObjPath,
+ valueInterface, valueProperty,
std::bind_front(
setBytesProperty, asyncResp,
json_pointer("/MemoryStatistics/BuffersAndCacheBytes")));
constexpr auto freeMemoryObjPath =
"/xyz/openbmc_project/metric/bmc/memory/free";
- sdbusplus::asio::getProperty<double>(
- *crow::connections::systemBus, healthMonitorServiceName,
- freeMemoryObjPath, valueInterface, valueProperty,
+ dbus::utility::getProperty<double>(
+ healthMonitorServiceName, freeMemoryObjPath, valueInterface,
+ valueProperty,
std::bind_front(setBytesProperty, asyncResp,
json_pointer("/MemoryStatistics/FreeBytes")));
constexpr auto sharedMemoryObjPath =
"/xyz/openbmc_project/metric/bmc/memory/shared";
- sdbusplus::asio::getProperty<double>(
- *crow::connections::systemBus, healthMonitorServiceName,
- sharedMemoryObjPath, valueInterface, valueProperty,
+ dbus::utility::getProperty<double>(
+ healthMonitorServiceName, sharedMemoryObjPath, valueInterface,
+ valueProperty,
std::bind_front(setBytesProperty, asyncResp,
json_pointer("/MemoryStatistics/SharedBytes")));
constexpr auto totalMemoryObjPath =
"/xyz/openbmc_project/metric/bmc/memory/total";
- sdbusplus::asio::getProperty<double>(
- *crow::connections::systemBus, healthMonitorServiceName,
- totalMemoryObjPath, valueInterface, valueProperty,
+ dbus::utility::getProperty<double>(
+ healthMonitorServiceName, totalMemoryObjPath, valueInterface,
+ valueProperty,
std::bind_front(setBytesProperty, asyncResp,
json_pointer("/MemoryStatistics/TotalBytes")));
}
@@ -216,8 +216,8 @@
inline void managerGetServiceRootUptime(
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
{
- sdbusplus::asio::getProperty<uint64_t>(
- *crow::connections::systemBus, "org.freedesktop.systemd1",
+ dbus::utility::getProperty<uint64_t>(
+ "org.freedesktop.systemd1",
"/org/freedesktop/systemd1/unit/bmcweb_2eservice",
"org.freedesktop.systemd1.Unit", "ActiveEnterTimestampMonotonic",
std::bind_front(afterGetManagerStartTime, asyncResp));
diff --git a/redfish-core/lib/managers.hpp b/redfish-core/lib/managers.hpp
index 82ee25f..2f21656 100644
--- a/redfish-core/lib/managers.hpp
+++ b/redfish-core/lib/managers.hpp
@@ -1289,7 +1289,7 @@
const std::string& path = subtreeLocal[0].first;
const std::string& owner = subtreeLocal[0].second[0].first;
- sdbusplus::asio::getAllProperties(
+ dbus::utility::getAllProperties(
*crow::connections::systemBus, owner, path,
thermalModeIface,
[path, owner,
@@ -1487,7 +1487,7 @@
const std::string& path = subtree[0].first;
const std::string& owner = subtree[0].second[0].first;
- sdbusplus::asio::getAllProperties(
+ dbus::utility::getAllProperties(
*crow::connections::systemBus, owner, path,
thermalModeIface,
[self, path,
@@ -1777,8 +1777,8 @@
{
BMCWEB_LOG_DEBUG("Get BMC manager Location data.");
- sdbusplus::asio::getProperty<std::string>(
- *crow::connections::systemBus, connectionName, path,
+ dbus::utility::getProperty<std::string>(
+ connectionName, path,
"xyz.openbmc_project.Inventory.Decorator.LocationCode", "LocationCode",
[asyncResp](const boost::system::error_code& ec,
const std::string& property) {
@@ -1801,10 +1801,9 @@
{
BMCWEB_LOG_DEBUG("Getting Manager Last Reset Time");
- sdbusplus::asio::getProperty<uint64_t>(
- *crow::connections::systemBus, "xyz.openbmc_project.State.BMC",
- "/xyz/openbmc_project/state/bmc0", "xyz.openbmc_project.State.BMC",
- "LastRebootTime",
+ dbus::utility::getProperty<uint64_t>(
+ "xyz.openbmc_project.State.BMC", "/xyz/openbmc_project/state/bmc0",
+ "xyz.openbmc_project.State.BMC", "LastRebootTime",
[asyncResp](const boost::system::error_code& ec,
const uint64_t lastResetTime) {
if (ec)
@@ -1988,8 +1987,8 @@
inline void
checkForQuiesced(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
{
- sdbusplus::asio::getProperty<std::string>(
- *crow::connections::systemBus, "org.freedesktop.systemd1",
+ dbus::utility::getProperty<std::string>(
+ "org.freedesktop.systemd1",
"/org/freedesktop/systemd1/unit/obmc-bmc-service-quiesce@0.target",
"org.freedesktop.systemd1.Unit", "ActiveState",
[asyncResp](const boost::system::error_code& ec,
@@ -2176,10 +2175,9 @@
chassiUrl;
});
- sdbusplus::asio::getProperty<double>(
- *crow::connections::systemBus, "org.freedesktop.systemd1",
- "/org/freedesktop/systemd1", "org.freedesktop.systemd1.Manager",
- "Progress",
+ dbus::utility::getProperty<double>(
+ "org.freedesktop.systemd1", "/org/freedesktop/systemd1",
+ "org.freedesktop.systemd1.Manager", "Progress",
[asyncResp](const boost::system::error_code& ec, double val) {
if (ec)
{
@@ -2243,7 +2241,7 @@
if (interfaceName ==
"xyz.openbmc_project.Inventory.Decorator.Asset")
{
- sdbusplus::asio::getAllProperties(
+ dbus::utility::getAllProperties(
*crow::connections::systemBus, connectionName,
path,
"xyz.openbmc_project.Inventory.Decorator.Asset",
diff --git a/redfish-core/lib/memory.hpp b/redfish-core/lib/memory.hpp
index eb5fb23..a287593 100644
--- a/redfish-core/lib/memory.hpp
+++ b/redfish-core/lib/memory.hpp
@@ -619,8 +619,8 @@
const std::string& service, const std::string& objPath)
{
BMCWEB_LOG_DEBUG("Get available system components.");
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, service, objPath, "",
+ dbus::utility::getAllProperties(
+ service, objPath, "",
[dimmId, asyncResp{std::move(asyncResp)}](
const boost::system::error_code& ec,
const dbus::utility::DBusPropertiesMap& properties) {
@@ -692,8 +692,8 @@
const std::string& service,
const std::string& path)
{
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, service, path,
+ dbus::utility::getAllProperties(
+ service, path,
"xyz.openbmc_project.Inventory.Item.PersistentMemory.Partition",
[asyncResp{std::move(asyncResp)}](
const boost::system::error_code& ec,
diff --git a/redfish-core/lib/metric_report_definition.hpp b/redfish-core/lib/metric_report_definition.hpp
index c1fdb1c..9a6b25e 100644
--- a/redfish-core/lib/metric_report_definition.hpp
+++ b/redfish-core/lib/metric_report_definition.hpp
@@ -1192,9 +1192,9 @@
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, std::string_view id,
std::vector<nlohmann::json::object_t>&& metrics)
{
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, telemetry::service,
- telemetry::getDbusReportPath(id), telemetry::reportInterface,
+ dbus::utility::getAllProperties(
+ telemetry::service, telemetry::getDbusReportPath(id),
+ telemetry::reportInterface,
[asyncResp, id = std::string(id), redfishMetrics = std::move(metrics)](
boost::system::error_code ec,
const dbus::utility::DBusPropertiesMap& properties) mutable {
@@ -1475,9 +1475,9 @@
boost::beast::http::field::link,
"</redfish/v1/JsonSchemas/MetricReport/MetricReport.json>; rel=describedby");
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, telemetry::service,
- telemetry::getDbusReportPath(id), telemetry::reportInterface,
+ dbus::utility::getAllProperties(
+ telemetry::service, telemetry::getDbusReportPath(id),
+ telemetry::reportInterface,
[asyncResp, id](const boost::system::error_code& ec,
const dbus::utility::DBusPropertiesMap& properties) {
if (!redfish::telemetry::verifyCommonErrors(asyncResp->res, id, ec))
diff --git a/redfish-core/lib/network_protocol.hpp b/redfish-core/lib/network_protocol.hpp
index 7868f98..ea36d27 100644
--- a/redfish-core/lib/network_protocol.hpp
+++ b/redfish-core/lib/network_protocol.hpp
@@ -448,9 +448,9 @@
inline void
getNTPProtocolEnabled(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
{
- sdbusplus::asio::getProperty<bool>(
- *crow::connections::systemBus, "org.freedesktop.timedate1",
- "/org/freedesktop/timedate1", "org.freedesktop.timedate1", "NTP",
+ dbus::utility::getProperty<bool>(
+ "org.freedesktop.timedate1", "/org/freedesktop/timedate1",
+ "org.freedesktop.timedate1", "NTP",
[asyncResp](const boost::system::error_code& ec, bool enabled) {
if (ec)
{
diff --git a/redfish-core/lib/pcie.hpp b/redfish-core/lib/pcie.hpp
index 7ddbaa0..4068bac 100644
--- a/redfish-core/lib/pcie.hpp
+++ b/redfish-core/lib/pcie.hpp
@@ -271,8 +271,8 @@
messages::internalError(asyncResp->res);
return;
}
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, object.begin()->first, pcieDeviceSlot,
+ dbus::utility::getAllProperties(
+ object.begin()->first, pcieDeviceSlot,
"xyz.openbmc_project.Inventory.Item.PCIeSlot",
[asyncResp](
const boost::system::error_code& ec2,
@@ -298,8 +298,8 @@
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& pcieDevicePath, const std::string& service)
{
- sdbusplus::asio::getProperty<bool>(
- *crow::connections::systemBus, service, pcieDevicePath,
+ dbus::utility::getProperty<bool>(
+ service, pcieDevicePath,
"xyz.openbmc_project.State.Decorator.OperationalStatus", "Functional",
[asyncResp](const boost::system::error_code& ec, const bool value) {
if (ec)
@@ -325,9 +325,9 @@
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& pcieDevicePath, const std::string& service)
{
- sdbusplus::asio::getProperty<bool>(
- *crow::connections::systemBus, service, pcieDevicePath,
- "xyz.openbmc_project.Inventory.Item", "Present",
+ dbus::utility::getProperty<bool>(
+ service, pcieDevicePath, "xyz.openbmc_project.Inventory.Item",
+ "Present",
[asyncResp](const boost::system::error_code& ec, bool value) {
if (ec)
{
@@ -351,8 +351,8 @@
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& pcieDevicePath, const std::string& service)
{
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, service, pcieDevicePath,
+ dbus::utility::getAllProperties(
+ service, pcieDevicePath,
"xyz.openbmc_project.Inventory.Decorator.Asset",
[pcieDevicePath, asyncResp{asyncResp}](
const boost::system::error_code& ec,
@@ -514,8 +514,8 @@
const std::function<void(
const dbus::utility::DBusPropertiesMap& pcieDevProperties)>&& callback)
{
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, service, pcieDevicePath,
+ dbus::utility::getAllProperties(
+ service, pcieDevicePath,
"xyz.openbmc_project.Inventory.Item.PCIeDevice",
[asyncResp,
callback](const boost::system::error_code& ec,
diff --git a/redfish-core/lib/pcie_slots.hpp b/redfish-core/lib/pcie_slots.hpp
index a6796b9..bb9cde0 100644
--- a/redfish-core/lib/pcie_slots.hpp
+++ b/redfish-core/lib/pcie_slots.hpp
@@ -148,8 +148,8 @@
return;
}
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, connectionName, pcieSlotPath,
+ dbus::utility::getAllProperties(
+ connectionName, pcieSlotPath,
"xyz.openbmc_project.Inventory.Item.PCIeSlot",
[asyncResp](const boost::system::error_code& ec2,
const dbus::utility::DBusPropertiesMap& propertiesList) {
diff --git a/redfish-core/lib/power.hpp b/redfish-core/lib/power.hpp
index 36a3b15..6ce95bd 100644
--- a/redfish-core/lib/power.hpp
+++ b/redfish-core/lib/power.hpp
@@ -99,8 +99,8 @@
{
return;
}
- sdbusplus::asio::getProperty<bool>(
- *crow::connections::systemBus, "xyz.openbmc_project.Settings",
+ dbus::utility::getProperty<bool>(
+ "xyz.openbmc_project.Settings",
"/xyz/openbmc_project/control/host0/power_cap",
"xyz.openbmc_project.Control.Power.Cap", "PowerCapEnable",
std::bind_front(afterGetPowerCapEnable, sensorsAsyncResp, *value));
@@ -248,8 +248,8 @@
return;
}
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, "xyz.openbmc_project.Settings",
+ dbus::utility::getAllProperties(
+ "xyz.openbmc_project.Settings",
"/xyz/openbmc_project/control/host0/power_cap",
"xyz.openbmc_project.Control.Power.Cap",
[sensorAsyncResp](const boost::system::error_code& ec,
diff --git a/redfish-core/lib/power_supply.hpp b/redfish-core/lib/power_supply.hpp
index f085272..3af8def 100644
--- a/redfish-core/lib/power_supply.hpp
+++ b/redfish-core/lib/power_supply.hpp
@@ -198,9 +198,8 @@
getPowerSupplyState(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& service, const std::string& path)
{
- sdbusplus::asio::getProperty<bool>(
- *crow::connections::systemBus, service, path,
- "xyz.openbmc_project.Inventory.Item", "Present",
+ dbus::utility::getProperty<bool>(
+ service, path, "xyz.openbmc_project.Inventory.Item", "Present",
[asyncResp](const boost::system::error_code& ec, const bool value) {
if (ec)
{
@@ -225,9 +224,9 @@
getPowerSupplyHealth(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& service, const std::string& path)
{
- sdbusplus::asio::getProperty<bool>(
- *crow::connections::systemBus, service, path,
- "xyz.openbmc_project.State.Decorator.OperationalStatus", "Functional",
+ dbus::utility::getProperty<bool>(
+ service, path, "xyz.openbmc_project.State.Decorator.OperationalStatus",
+ "Functional",
[asyncResp](const boost::system::error_code& ec, const bool value) {
if (ec)
{
@@ -252,9 +251,8 @@
getPowerSupplyAsset(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& service, const std::string& path)
{
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, service, path,
- "xyz.openbmc_project.Inventory.Decorator.Asset",
+ dbus::utility::getAllProperties(
+ service, path, "xyz.openbmc_project.Inventory.Decorator.Asset",
[asyncResp](const boost::system::error_code& ec,
const dbus::utility::DBusPropertiesMap& propertiesList) {
if (ec)
@@ -324,9 +322,8 @@
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& service, const std::string& path)
{
- sdbusplus::asio::getProperty<std::string>(
- *crow::connections::systemBus, service, path,
- "xyz.openbmc_project.Software.Version", "Version",
+ dbus::utility::getProperty<std::string>(
+ service, path, "xyz.openbmc_project.Software.Version", "Version",
[asyncResp](const boost::system::error_code& ec,
const std::string& value) {
if (ec)
@@ -348,9 +345,9 @@
getPowerSupplyLocation(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& service, const std::string& path)
{
- sdbusplus::asio::getProperty<std::string>(
- *crow::connections::systemBus, service, path,
- "xyz.openbmc_project.Inventory.Decorator.LocationCode", "LocationCode",
+ dbus::utility::getProperty<std::string>(
+ service, path, "xyz.openbmc_project.Inventory.Decorator.LocationCode",
+ "LocationCode",
[asyncResp](const boost::system::error_code& ec,
const std::string& value) {
if (ec)
@@ -429,9 +426,9 @@
const auto& [path, serviceMap] = *subtree.begin();
const auto& [service, interfaces] = *serviceMap.begin();
- sdbusplus::asio::getProperty<uint32_t>(
- *crow::connections::systemBus, service, path,
- "xyz.openbmc_project.Control.PowerSupplyAttributes", "DeratingFactor",
+ dbus::utility::getProperty<uint32_t>(
+ service, path, "xyz.openbmc_project.Control.PowerSupplyAttributes",
+ "DeratingFactor",
[asyncResp](const boost::system::error_code& ec1, uint32_t value) {
handleGetEfficiencyResponse(asyncResp, ec1, value);
});
diff --git a/redfish-core/lib/processor.hpp b/redfish-core/lib/processor.hpp
index c0d3103..d089381 100644
--- a/redfish-core/lib/processor.hpp
+++ b/redfish-core/lib/processor.hpp
@@ -62,9 +62,8 @@
const std::string& objPath)
{
BMCWEB_LOG_DEBUG("Get Processor UUID");
- sdbusplus::asio::getProperty<std::string>(
- *crow::connections::systemBus, service, objPath,
- "xyz.openbmc_project.Common.UUID", "UUID",
+ dbus::utility::getProperty<std::string>(
+ service, objPath, "xyz.openbmc_project.Common.UUID", "UUID",
[objPath, asyncResp{std::move(asyncResp)}](
const boost::system::error_code& ec, const std::string& property) {
if (ec)
@@ -340,9 +339,8 @@
{
BMCWEB_LOG_DEBUG("Get processor throttle resources");
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, service, objectPath,
- "xyz.openbmc_project.Control.Power.Throttle",
+ dbus::utility::getAllProperties(
+ service, objectPath, "xyz.openbmc_project.Control.Power.Throttle",
[asyncResp](const boost::system::error_code& ec,
const dbus::utility::DBusPropertiesMap& properties) {
readThrottleProperties(asyncResp, ec, properties);
@@ -354,9 +352,8 @@
const std::string& objPath)
{
BMCWEB_LOG_DEBUG("Get Cpu Asset Data");
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, service, objPath,
- "xyz.openbmc_project.Inventory.Decorator.Asset",
+ dbus::utility::getAllProperties(
+ service, objPath, "xyz.openbmc_project.Inventory.Decorator.Asset",
[objPath, asyncResp{std::move(asyncResp)}](
const boost::system::error_code& ec,
const dbus::utility::DBusPropertiesMap& properties) {
@@ -428,9 +425,8 @@
const std::string& objPath)
{
BMCWEB_LOG_DEBUG("Get Cpu Revision Data");
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, service, objPath,
- "xyz.openbmc_project.Inventory.Decorator.Revision",
+ dbus::utility::getAllProperties(
+ service, objPath, "xyz.openbmc_project.Inventory.Decorator.Revision",
[objPath, asyncResp{std::move(asyncResp)}](
const boost::system::error_code& ec,
const dbus::utility::DBusPropertiesMap& properties) {
@@ -465,8 +461,8 @@
const std::string& service, const std::string& objPath)
{
BMCWEB_LOG_DEBUG("Get available system Accelerator resources by service.");
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, service, objPath, "",
+ dbus::utility::getAllProperties(
+ service, objPath, "",
[acclrtrId, asyncResp{std::move(asyncResp)}](
const boost::system::error_code& ec,
const dbus::utility::DBusPropertiesMap& properties) {
@@ -579,8 +575,8 @@
BMCWEB_LOG_INFO("Getting CPU operating configs for {}", cpuId);
// First, GetAll CurrentOperatingConfig properties on the object
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, service, objPath,
+ dbus::utility::getAllProperties(
+ service, objPath,
"xyz.openbmc_project.Control.Processor.CurrentOperatingConfig",
[asyncResp, cpuId,
service](const boost::system::error_code& ec,
@@ -640,8 +636,8 @@
// Once we found the current applied config, queue another
// request to read the base freq core ids out of that
// config.
- sdbusplus::asio::getProperty<BaseSpeedPrioritySettingsProperty>(
- *crow::connections::systemBus, service, dbusPath,
+ dbus::utility::getProperty<BaseSpeedPrioritySettingsProperty>(
+ service, dbusPath,
"xyz.openbmc_project.Inventory.Item.Cpu."
"OperatingConfig",
"BaseSpeedPrioritySettings",
@@ -681,8 +677,8 @@
const std::string& objPath)
{
BMCWEB_LOG_DEBUG("Get Cpu Location Data");
- sdbusplus::asio::getProperty<std::string>(
- *crow::connections::systemBus, service, objPath,
+ dbus::utility::getProperty<std::string>(
+ service, objPath,
"xyz.openbmc_project.Inventory.Decorator.LocationCode", "LocationCode",
[objPath, asyncResp{std::move(asyncResp)}](
const boost::system::error_code& ec, const std::string& property) {
@@ -712,8 +708,8 @@
const std::string& objectPath)
{
BMCWEB_LOG_DEBUG("Get CPU UniqueIdentifier");
- sdbusplus::asio::getProperty<std::string>(
- *crow::connections::systemBus, service, objectPath,
+ dbus::utility::getProperty<std::string>(
+ service, objectPath,
"xyz.openbmc_project.Inventory.Decorator.UniqueIdentifier",
"UniqueIdentifier",
[asyncResp](const boost::system::error_code& ec,
@@ -878,8 +874,8 @@
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& service, const std::string& objPath)
{
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, service, objPath,
+ dbus::utility::getAllProperties(
+ service, objPath,
"xyz.openbmc_project.Inventory.Item.Cpu.OperatingConfig",
[asyncResp](const boost::system::error_code& ec,
const dbus::utility::DBusPropertiesMap& properties) {
diff --git a/redfish-core/lib/redfish_util.hpp b/redfish-core/lib/redfish_util.hpp
index 4164e10..117f972 100644
--- a/redfish-core/lib/redfish_util.hpp
+++ b/redfish-core/lib/redfish_util.hpp
@@ -208,7 +208,7 @@
template <typename CallbackFunc>
void getPortNumber(const std::string& socketPath, CallbackFunc&& callback)
{
- sdbusplus::asio::getProperty<
+ dbus::utility::getProperty<
std::vector<std::tuple<std::string, std::string>>>(
*crow::connections::systemBus, "org.freedesktop.systemd1", socketPath,
"org.freedesktop.systemd1.Socket", "Listen",
diff --git a/redfish-core/lib/roles.hpp b/redfish-core/lib/roles.hpp
index c17a225..d663ce3 100644
--- a/redfish-core/lib/roles.hpp
+++ b/redfish-core/lib/roles.hpp
@@ -133,8 +133,7 @@
asyncResp->res.jsonValue["Name"] = "Roles Collection";
asyncResp->res.jsonValue["Description"] = "BMC User Roles";
- sdbusplus::asio::getProperty<std::vector<std::string>>(
- *crow::connections::systemBus,
+ dbus::utility::getProperty<std::vector<std::string>>(
"xyz.openbmc_project.User.Manager",
"/xyz/openbmc_project/user",
"xyz.openbmc_project.User.Manager", "AllPrivileges",
diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp
index 697e3c5..3ee36af 100644
--- a/redfish-core/lib/sensors.hpp
+++ b/redfish-core/lib/sensors.hpp
@@ -555,7 +555,7 @@
{
return;
}
- sdbusplus::asio::getAllProperties(
+ dbus::utility::getAllProperties(
*crow::connections::systemBus, owner, path,
"xyz.openbmc_project.Control.FanRedundancy",
[path, sensorsAsyncResp](
@@ -1375,9 +1375,8 @@
};
// Get the State property for the current LED
- sdbusplus::asio::getProperty<std::string>(
- *crow::connections::systemBus, ledConnection, ledPath,
- "xyz.openbmc_project.Led.Physical", "State",
+ dbus::utility::getProperty<std::string>(
+ ledConnection, ledPath, "xyz.openbmc_project.Led.Physical", "State",
std::move(respHandler));
}
@@ -1544,8 +1543,8 @@
// Get the DeratingFactor property for the PowerSupplyAttributes
// Currently only property on the interface/only one we care about
- sdbusplus::asio::getProperty<uint32_t>(
- *crow::connections::systemBus, psAttributesConnection, psAttributesPath,
+ dbus::utility::getProperty<uint32_t>(
+ psAttributesConnection, psAttributesPath,
"xyz.openbmc_project.Control.PowerSupplyAttributes", "DeratingFactor",
std::move(respHandler));
@@ -2407,7 +2406,7 @@
BMCWEB_LOG_DEBUG("Looking up {}", connectionName);
BMCWEB_LOG_DEBUG("Path {}", sensorPath);
- sdbusplus::asio::getAllProperties(
+ ::dbus::utility::getAllProperties(
*crow::connections::systemBus, connectionName, sensorPath, "",
[asyncResp,
sensorPath](const boost::system::error_code& ec,
diff --git a/redfish-core/lib/storage.hpp b/redfish-core/lib/storage.hpp
index e670de7..adcb788 100644
--- a/redfish-core/lib/storage.hpp
+++ b/redfish-core/lib/storage.hpp
@@ -291,9 +291,8 @@
const std::string& connectionName,
const std::string& path)
{
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, connectionName, path,
- "xyz.openbmc_project.Inventory.Decorator.Asset",
+ dbus::utility::getAllProperties(
+ connectionName, path, "xyz.openbmc_project.Inventory.Decorator.Asset",
[asyncResp](const boost::system::error_code& ec,
const std::vector<
std::pair<std::string, dbus::utility::DbusVariantType>>&
@@ -346,9 +345,8 @@
const std::string& connectionName,
const std::string& path)
{
- sdbusplus::asio::getProperty<bool>(
- *crow::connections::systemBus, connectionName, path,
- "xyz.openbmc_project.Inventory.Item", "Present",
+ dbus::utility::getProperty<bool>(
+ connectionName, path, "xyz.openbmc_project.Inventory.Item", "Present",
[asyncResp,
path](const boost::system::error_code& ec, const bool isPresent) {
// this interface isn't necessary, only check it if
@@ -370,9 +368,8 @@
const std::string& connectionName,
const std::string& path)
{
- sdbusplus::asio::getProperty<bool>(
- *crow::connections::systemBus, connectionName, path,
- "xyz.openbmc_project.State.Drive", "Rebuilding",
+ dbus::utility::getProperty<bool>(
+ connectionName, path, "xyz.openbmc_project.State.Drive", "Rebuilding",
[asyncResp](const boost::system::error_code& ec, const bool updating) {
// this interface isn't necessary, only check it
// if we get a good return
@@ -443,9 +440,8 @@
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& connectionName, const std::string& path)
{
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, connectionName, path,
- "xyz.openbmc_project.Inventory.Item.Drive",
+ dbus::utility::getAllProperties(
+ connectionName, path, "xyz.openbmc_project.Inventory.Item.Drive",
[asyncResp](const boost::system::error_code& ec,
const std::vector<
std::pair<std::string, dbus::utility::DbusVariantType>>&
@@ -1036,9 +1032,8 @@
asyncResp->res.jsonValue["Id"] = controllerId;
asyncResp->res.jsonValue["Status"]["State"] = resource::State::Enabled;
- sdbusplus::asio::getProperty<bool>(
- *crow::connections::systemBus, connectionName, path,
- "xyz.openbmc_project.Inventory.Item", "Present",
+ dbus::utility::getProperty<bool>(
+ connectionName, path, "xyz.openbmc_project.Inventory.Item", "Present",
[asyncResp](const boost::system::error_code& ec, bool isPresent) {
// this interface isn't necessary, only check it
// if we get a good return
@@ -1054,9 +1049,8 @@
}
});
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, connectionName, path,
- "xyz.openbmc_project.Inventory.Decorator.Asset",
+ dbus::utility::getAllProperties(
+ connectionName, path, "xyz.openbmc_project.Inventory.Decorator.Asset",
[asyncResp](const boost::system::error_code& ec,
const std::vector<
std::pair<std::string, dbus::utility::DbusVariantType>>&
diff --git a/redfish-core/lib/systems.hpp b/redfish-core/lib/systems.hpp
index 5265436..e04bb8a 100644
--- a/redfish-core/lib/systems.hpp
+++ b/redfish-core/lib/systems.hpp
@@ -205,14 +205,12 @@
};
// Get the Presence of CPU
- sdbusplus::asio::getProperty<bool>(
- *crow::connections::systemBus, service, path,
- "xyz.openbmc_project.Inventory.Item", "Present",
- std::move(getCpuPresenceState));
+ dbus::utility::getProperty<bool>(*crow::connections::systemBus, service,
+ path, "xyz.openbmc_project.Inventory.Item",
+ "Present", std::move(getCpuPresenceState));
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, service, path,
- "xyz.openbmc_project.Inventory.Item.Cpu",
+ dbus::utility::getAllProperties(
+ service, path, "xyz.openbmc_project.Inventory.Item.Cpu",
[asyncResp, service,
path](const boost::system::error_code& ec2,
const dbus::utility::DBusPropertiesMap& properties) {
@@ -289,9 +287,8 @@
getMemorySummary(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& service, const std::string& path)
{
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, service, path,
- "xyz.openbmc_project.Inventory.Item.Dimm",
+ dbus::utility::getAllProperties(
+ service, path, "xyz.openbmc_project.Inventory.Item.Dimm",
[asyncResp, service,
path](const boost::system::error_code& ec2,
const dbus::utility::DBusPropertiesMap& properties) {
@@ -466,7 +463,7 @@
{
BMCWEB_LOG_DEBUG("Found UUID, now get its properties.");
- sdbusplus::asio::getAllProperties(
+ dbus::utility::getAllProperties(
*crow::connections::systemBus, connection.first, path,
"xyz.openbmc_project.Common.UUID",
[asyncResp](const boost::system::error_code& ec3,
@@ -478,7 +475,7 @@
else if (interfaceName ==
"xyz.openbmc_project.Inventory.Item.System")
{
- sdbusplus::asio::getAllProperties(
+ dbus::utility::getAllProperties(
*crow::connections::systemBus, connection.first, path,
"xyz.openbmc_project.Inventory.Decorator.Asset",
[asyncResp](const boost::system::error_code& ec3,
@@ -487,8 +484,8 @@
afterGetInventory(asyncResp, ec3, properties);
});
- sdbusplus::asio::getProperty<std::string>(
- *crow::connections::systemBus, connection.first, path,
+ dbus::utility::getProperty<std::string>(
+ connection.first, path,
"xyz.openbmc_project.Inventory.Decorator."
"AssetTag",
"AssetTag",
@@ -532,10 +529,9 @@
inline void getHostState(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
{
BMCWEB_LOG_DEBUG("Get host information.");
- sdbusplus::asio::getProperty<std::string>(
- *crow::connections::systemBus, "xyz.openbmc_project.State.Host",
- "/xyz/openbmc_project/state/host0", "xyz.openbmc_project.State.Host",
- "CurrentHostState",
+ dbus::utility::getProperty<std::string>(
+ "xyz.openbmc_project.State.Host", "/xyz/openbmc_project/state/host0",
+ "xyz.openbmc_project.State.Host", "CurrentHostState",
[asyncResp](const boost::system::error_code& ec,
const std::string& hostState) {
if (ec)
@@ -833,9 +829,8 @@
*/
inline void getBootProgress(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
{
- sdbusplus::asio::getProperty<std::string>(
- *crow::connections::systemBus, "xyz.openbmc_project.State.Host",
- "/xyz/openbmc_project/state/host0",
+ dbus::utility::getProperty<std::string>(
+ "xyz.openbmc_project.State.Host", "/xyz/openbmc_project/state/host0",
"xyz.openbmc_project.State.Boot.Progress", "BootProgress",
[asyncResp](const boost::system::error_code& ec,
const std::string& bootProgressStr) {
@@ -863,9 +858,8 @@
inline void getBootProgressLastStateTime(
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
{
- sdbusplus::asio::getProperty<uint64_t>(
- *crow::connections::systemBus, "xyz.openbmc_project.State.Host",
- "/xyz/openbmc_project/state/host0",
+ dbus::utility::getProperty<uint64_t>(
+ "xyz.openbmc_project.State.Host", "/xyz/openbmc_project/state/host0",
"xyz.openbmc_project.State.Boot.Progress", "BootProgressLastUpdate",
[asyncResp](const boost::system::error_code& ec,
const uint64_t lastStateTime) {
@@ -898,8 +892,8 @@
inline void
getBootOverrideType(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
{
- sdbusplus::asio::getProperty<std::string>(
- *crow::connections::systemBus, "xyz.openbmc_project.Settings",
+ dbus::utility::getProperty<std::string>(
+ "xyz.openbmc_project.Settings",
"/xyz/openbmc_project/control/host0/boot",
"xyz.openbmc_project.Control.Boot.Type", "BootType",
[asyncResp](const boost::system::error_code& ec,
@@ -939,8 +933,8 @@
inline void
getBootOverrideMode(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
{
- sdbusplus::asio::getProperty<std::string>(
- *crow::connections::systemBus, "xyz.openbmc_project.Settings",
+ dbus::utility::getProperty<std::string>(
+ "xyz.openbmc_project.Settings",
"/xyz/openbmc_project/control/host0/boot",
"xyz.openbmc_project.Control.Boot.Mode", "BootMode",
[asyncResp](const boost::system::error_code& ec,
@@ -991,8 +985,8 @@
inline void
getBootOverrideSource(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
{
- sdbusplus::asio::getProperty<std::string>(
- *crow::connections::systemBus, "xyz.openbmc_project.Settings",
+ dbus::utility::getProperty<std::string>(
+ "xyz.openbmc_project.Settings",
"/xyz/openbmc_project/control/host0/boot",
"xyz.openbmc_project.Control.Boot.Source", "BootSource",
[asyncResp](const boost::system::error_code& ec,
@@ -1046,8 +1040,8 @@
// If boot source override is enabled, we need to check 'one_time'
// property to set a correct value for the "BootSourceOverrideEnabled"
- sdbusplus::asio::getProperty<bool>(
- *crow::connections::systemBus, "xyz.openbmc_project.Settings",
+ dbus::utility::getProperty<bool>(
+ "xyz.openbmc_project.Settings",
"/xyz/openbmc_project/control/host0/boot/one_time",
"xyz.openbmc_project.Object.Enable", "Enabled",
[asyncResp](const boost::system::error_code& ec, bool oneTimeSetting) {
@@ -1082,8 +1076,8 @@
inline void
getBootOverrideEnable(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
{
- sdbusplus::asio::getProperty<bool>(
- *crow::connections::systemBus, "xyz.openbmc_project.Settings",
+ dbus::utility::getProperty<bool>(
+ "xyz.openbmc_project.Settings",
"/xyz/openbmc_project/control/host0/boot",
"xyz.openbmc_project.Object.Enable", "Enabled",
[asyncResp](const boost::system::error_code& ec,
@@ -1137,8 +1131,8 @@
{
BMCWEB_LOG_DEBUG("Getting System Last Reset Time");
- sdbusplus::asio::getProperty<uint64_t>(
- *crow::connections::systemBus, "xyz.openbmc_project.State.Chassis",
+ dbus::utility::getProperty<uint64_t>(
+ "xyz.openbmc_project.State.Chassis",
"/xyz/openbmc_project/state/chassis0",
"xyz.openbmc_project.State.Chassis", "LastStateChangeTime",
[asyncResp](const boost::system::error_code& ec,
@@ -1176,9 +1170,8 @@
{
BMCWEB_LOG_DEBUG("Get Automatic Retry policy");
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, "xyz.openbmc_project.State.Host",
- "/xyz/openbmc_project/state/host0",
+ dbus::utility::getAllProperties(
+ "xyz.openbmc_project.State.Host", "/xyz/openbmc_project/state/host0",
"xyz.openbmc_project.Control.Boot.RebootAttempts",
[asyncResp{asyncResp}](
const boost::system::error_code& ec,
@@ -1233,8 +1226,8 @@
{
BMCWEB_LOG_DEBUG("Get Automatic Retry policy");
- sdbusplus::asio::getProperty<bool>(
- *crow::connections::systemBus, "xyz.openbmc_project.Settings",
+ dbus::utility::getProperty<bool>(
+ "xyz.openbmc_project.Settings",
"/xyz/openbmc_project/control/host0/auto_reboot",
"xyz.openbmc_project.Control.Boot.RebootPolicy", "AutoReboot",
[asyncResp](const boost::system::error_code& ec,
@@ -1333,8 +1326,8 @@
{
BMCWEB_LOG_DEBUG("Get power restore policy");
- sdbusplus::asio::getProperty<std::string>(
- *crow::connections::systemBus, "xyz.openbmc_project.Settings",
+ dbus::utility::getProperty<std::string>(
+ "xyz.openbmc_project.Settings",
"/xyz/openbmc_project/control/host0/power_restore_policy",
"xyz.openbmc_project.Control.Power.RestorePolicy", "PowerRestorePolicy",
[asyncResp](const boost::system::error_code& ec,
@@ -1368,9 +1361,8 @@
{
BMCWEB_LOG_DEBUG("Get Stop Boot On Fault");
- sdbusplus::asio::getProperty<bool>(
- *crow::connections::systemBus, "xyz.openbmc_project.Settings",
- "/xyz/openbmc_project/logging/settings",
+ dbus::utility::getProperty<bool>(
+ "xyz.openbmc_project.Settings", "/xyz/openbmc_project/logging/settings",
"xyz.openbmc_project.Logging.Settings", "QuiesceOnHwError",
[asyncResp](const boost::system::error_code& ec, bool value) {
if (ec)
@@ -1453,9 +1445,9 @@
const std::string& serv = subtree[0].second.begin()->first;
// Valid TPM Enable object found, now reading the current value
- sdbusplus::asio::getProperty<bool>(
- *crow::connections::systemBus, serv, path,
- "xyz.openbmc_project.Control.TPM.Policy", "TPMEnable",
+ dbus::utility::getProperty<bool>(
+ serv, path, "xyz.openbmc_project.Control.TPM.Policy",
+ "TPMEnable",
[asyncResp](const boost::system::error_code& ec2,
bool tpmRequired) {
if (ec2)
@@ -1972,9 +1964,9 @@
getProvisioningStatus(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
{
BMCWEB_LOG_DEBUG("Get OEM information.");
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, "xyz.openbmc_project.PFR.Manager",
- "/xyz/openbmc_project/pfr", "xyz.openbmc_project.PFR.Attributes",
+ dbus::utility::getAllProperties(
+ "xyz.openbmc_project.PFR.Manager", "/xyz/openbmc_project/pfr",
+ "xyz.openbmc_project.PFR.Attributes",
[asyncResp](const boost::system::error_code& ec,
const dbus::utility::DBusPropertiesMap& propertiesList) {
nlohmann::json& oemPFR =
@@ -2200,7 +2192,7 @@
}
// Valid Power Mode object found, now read the mode properties
- sdbusplus::asio::getAllProperties(
+ dbus::utility::getAllProperties(
*crow::connections::systemBus, service, path,
"xyz.openbmc_project.Control.Power.Mode",
[asyncResp](
@@ -2411,9 +2403,8 @@
getHostWatchdogTimer(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
{
BMCWEB_LOG_DEBUG("Get host watchodg");
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, "xyz.openbmc_project.Watchdog",
- "/xyz/openbmc_project/watchdog/host0",
+ dbus::utility::getAllProperties(
+ "xyz.openbmc_project.Watchdog", "/xyz/openbmc_project/watchdog/host0",
"xyz.openbmc_project.State.Watchdog",
[asyncResp](const boost::system::error_code& ec,
const dbus::utility::DBusPropertiesMap& properties) {
@@ -2637,7 +2628,7 @@
}
// Valid IdlePowerSaver object found, now read the current values
- sdbusplus::asio::getAllProperties(
+ dbus::utility::getAllProperties(
*crow::connections::systemBus, service, path,
"xyz.openbmc_project.Control.Power.IdlePowerSaver",
[asyncResp](
@@ -3445,10 +3436,9 @@
asyncResp->res.jsonValue["Id"] = "ResetActionInfo";
// Look to see if system defines AllowedHostTransitions
- sdbusplus::asio::getProperty<std::vector<std::string>>(
- *crow::connections::systemBus, "xyz.openbmc_project.State.Host",
- "/xyz/openbmc_project/state/host0", "xyz.openbmc_project.State.Host",
- "AllowedHostTransitions",
+ dbus::utility::getProperty<std::vector<std::string>>(
+ "xyz.openbmc_project.State.Host", "/xyz/openbmc_project/state/host0",
+ "xyz.openbmc_project.State.Host", "AllowedHostTransitions",
[asyncResp](const boost::system::error_code& ec,
const std::vector<std::string>& allowedHostTransitions) {
afterGetAllowedHostTransitions(asyncResp, ec,
diff --git a/redfish-core/lib/systems_logservices_postcodes.hpp b/redfish-core/lib/systems_logservices_postcodes.hpp
index f7f84c7..715b568 100644
--- a/redfish-core/lib/systems_logservices_postcodes.hpp
+++ b/redfish-core/lib/systems_logservices_postcodes.hpp
@@ -1,6 +1,7 @@
#pragma once
#include "app.hpp"
+#include "dbus_utility.hpp"
#include "generated/enums/log_service.hpp"
#include "query.hpp"
#include "registries/openbmc_message_registry.hpp"
@@ -401,8 +402,7 @@
size_t skip, size_t top)
{
uint64_t entryCount = 0;
- sdbusplus::asio::getProperty<uint16_t>(
- *crow::connections::systemBus,
+ dbus::utility::getProperty<uint16_t>(
"xyz.openbmc_project.State.Boot.PostCode0",
"/xyz/openbmc_project/State/Boot/PostCode0",
"xyz.openbmc_project.State.Boot.PostCode", "CurrentBootCycleCount",
diff --git a/redfish-core/lib/telemetry_service.hpp b/redfish-core/lib/telemetry_service.hpp
index cd051dc..6b0cf2e 100644
--- a/redfish-core/lib/telemetry_service.hpp
+++ b/redfish-core/lib/telemetry_service.hpp
@@ -36,9 +36,8 @@
asyncResp->res.jsonValue["Triggers"]["@odata.id"] =
"/redfish/v1/TelemetryService/Triggers";
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, telemetry::service,
- "/xyz/openbmc_project/Telemetry/Reports",
+ dbus::utility::getAllProperties(
+ telemetry::service, "/xyz/openbmc_project/Telemetry/Reports",
"xyz.openbmc_project.Telemetry.ReportManager",
[asyncResp](const boost::system::error_code& ec,
const dbus::utility::DBusPropertiesMap& ret) {
diff --git a/redfish-core/lib/thermal_metrics.hpp b/redfish-core/lib/thermal_metrics.hpp
index abf296c..d90ab6c5 100644
--- a/redfish-core/lib/thermal_metrics.hpp
+++ b/redfish-core/lib/thermal_metrics.hpp
@@ -86,7 +86,7 @@
for (const auto& [service, sensorPath] : sensorsServiceAndPath)
{
- sdbusplus::asio::getAllProperties(
+ dbus::utility::getAllProperties(
*crow::connections::systemBus, service, sensorPath,
"xyz.openbmc_project.Sensor.Value",
[asyncResp, chassisId,
diff --git a/redfish-core/lib/update_service.hpp b/redfish-core/lib/update_service.hpp
index 243b9ad..a82630b 100644
--- a/redfish-core/lib/update_service.hpp
+++ b/redfish-core/lib/update_service.hpp
@@ -1177,9 +1177,8 @@
const std::string& service, const std::string& path,
const std::string& swId)
{
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, service, path,
- "xyz.openbmc_project.Software.Version",
+ dbus::utility::getAllProperties(
+ service, path, "xyz.openbmc_project.Software.Version",
[asyncResp,
swId](const boost::system::error_code& ec,
const dbus::utility::DBusPropertiesMap& propertiesList) {