summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Tanous <etanous@nvidia.com>2024-11-12 08:58:57 +0300
committerEd Tanous <ed@tanous.net>2024-12-17 00:21:48 +0300
commitdeae6a789444debc4724fb6902fc5def299afbee (patch)
treed6951664f3dcf2275e27fb2efdb94b8163e1ed16
parent66aabb702da479b12dca47e53c97986a6abc99cb (diff)
downloadbmcweb-deae6a789444debc4724fb6902fc5def299afbee.tar.xz
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>
-rw-r--r--include/dbus_utility.hpp52
-rw-r--r--include/openbmc_dbus_rest.hpp4
-rw-r--r--include/vm_websocket.hpp4
-rw-r--r--redfish-core/include/snmp_trap_event_clients.hpp6
-rw-r--r--redfish-core/include/utils/sw_utils.hpp7
-rw-r--r--redfish-core/lib/account_service.hpp13
-rw-r--r--redfish-core/lib/cable.hpp7
-rw-r--r--redfish-core/lib/certificate_service.hpp4
-rw-r--r--redfish-core/lib/chassis.hpp40
-rw-r--r--redfish-core/lib/fabric_adapters.hpp18
-rw-r--r--redfish-core/lib/fan.hpp18
-rw-r--r--redfish-core/lib/hypervisor_system.hpp4
-rw-r--r--redfish-core/lib/led.hpp14
-rw-r--r--redfish-core/lib/log_services.hpp13
-rw-r--r--redfish-core/lib/manager_diagnostic_data.hpp52
-rw-r--r--redfish-core/lib/managers.hpp28
-rw-r--r--redfish-core/lib/memory.hpp8
-rw-r--r--redfish-core/lib/metric_report_definition.hpp12
-rw-r--r--redfish-core/lib/network_protocol.hpp6
-rw-r--r--redfish-core/lib/pcie.hpp22
-rw-r--r--redfish-core/lib/pcie_slots.hpp4
-rw-r--r--redfish-core/lib/power.hpp8
-rw-r--r--redfish-core/lib/power_supply.hpp33
-rw-r--r--redfish-core/lib/processor.hpp44
-rw-r--r--redfish-core/lib/redfish_util.hpp2
-rw-r--r--redfish-core/lib/roles.hpp3
-rw-r--r--redfish-core/lib/sensors.hpp13
-rw-r--r--redfish-core/lib/storage.hpp30
-rw-r--r--redfish-core/lib/systems.hpp112
-rw-r--r--redfish-core/lib/systems_logservices_postcodes.hpp4
-rw-r--r--redfish-core/lib/telemetry_service.hpp5
-rw-r--r--redfish-core/lib/thermal_metrics.hpp2
-rw-r--r--redfish-core/lib/update_service.hpp5
33 files changed, 300 insertions, 297 deletions
diff --git a/include/dbus_utility.hpp b/include/dbus_utility.hpp
index efeb2a0425..68b3930ef7 100644
--- a/include/dbus_utility.hpp
+++ b/include/dbus_utility.hpp
@@ -140,13 +140,57 @@ inline bool getNthStringFromPath(const std::string& path, int index,
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 @@ inline void getAssociationEndPoints(
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 fc074d6843..8a6830e0ad 100644
--- a/include/openbmc_dbus_rest.hpp
+++ b/include/openbmc_dbus_rest.hpp
@@ -181,8 +181,8 @@ inline void getPropertiesForEnumerate(
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 1e56cd984d..5d92f5f30a 100644
--- a/include/vm_websocket.hpp
+++ b/include/vm_websocket.hpp
@@ -474,8 +474,8 @@ inline void onOpen(crow::websocket::Connection& conn)
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 ebc028081b..39285cc299 100644
--- a/redfish-core/include/snmp_trap_event_clients.hpp
+++ b/redfish-core/include/snmp_trap_event_clients.hpp
@@ -70,9 +70,9 @@ inline void
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 ef3163b333..cbf2ae6f36 100644
--- a/redfish-core/include/utils/sw_utils.hpp
+++ b/redfish-core/include/utils/sw_utils.hpp
@@ -199,7 +199,7 @@ inline void afterGetSubtree(
// 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 @@ inline void getSwStatus(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
{
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 bf320145a9..d54db201b8 100644
--- a/redfish-core/lib/account_service.hpp
+++ b/redfish-core/lib/account_service.hpp
@@ -1415,9 +1415,9 @@ inline void
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 @@ inline void handleAccountCollectionPost(
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 27ee276a55..7493b29fc8 100644
--- a/redfish-core/lib/cable.hpp
+++ b/redfish-core/lib/cable.hpp
@@ -91,7 +91,7 @@ inline void
{
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 @@ inline void
}
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 f16b169a23..26b2f966ec 100644
--- a/redfish-core/lib/certificate_service.hpp
+++ b/redfish-core/lib/certificate_service.hpp
@@ -299,8 +299,8 @@ inline void getCertificateProperties(
{
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 e2461e9126..d405e75548 100644
--- a/redfish-core/lib/chassis.hpp
+++ b/redfish-core/lib/chassis.hpp
@@ -104,9 +104,9 @@ inline chassis::ChassisType
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 getStorageLink(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
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 @@ inline void handlePhysicalSecurityGetSubTree(
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 @@ inline void getChassisLocationCode(
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 @@ inline void getChassisUUID(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,
- "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 @@ inline void handleChassisGetSubTree(
{
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 @@ inline void handleChassisGetSubTree(
}
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 @@ inline void handleChassisGetSubTree(
}
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 @@ inline void handleChassisGetSubTree(
}
}
- 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 20e6726c07..b899c03350 100644
--- a/redfish-core/lib/fabric_adapters.hpp
+++ b/redfish-core/lib/fabric_adapters.hpp
@@ -28,8 +28,8 @@ inline void getFabricAdapterLocation(
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 @@ inline void getFabricAdapterAsset(
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 @@ inline void getFabricAdapterState(
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 @@ inline void getFabricAdapterHealth(
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 28b995e794..4dbe58d91d 100644
--- a/redfish-core/lib/fan.hpp
+++ b/redfish-core/lib/fan.hpp
@@ -233,8 +233,8 @@ inline void addFanCommonProperties(crow::Response& resp,
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 getFanHealth(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
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 getFanState(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
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 @@ inline void getFanLocation(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
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 b05112fe00..74e54094d9 100644
--- a/redfish-core/lib/hypervisor_system.hpp
+++ b/redfish-core/lib/hypervisor_system.hpp
@@ -38,8 +38,8 @@ inline void
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 1acde11dc8..d4f4b654b7 100644
--- a/redfish-core/lib/led.hpp
+++ b/redfish-core/lib/led.hpp
@@ -37,8 +37,8 @@ inline void
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 @@ inline void
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 @@ inline void getSystemLocationIndicatorActive(
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 @@ inline void getSystemLocationIndicatorActive(
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 73eb0b1bee..0f5641f6be 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -1766,8 +1766,8 @@ inline void dBusEventLogEntryGet(
// 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 @@ inline void
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 @@ inline void requestRoutesCrashdumpFile(App& app)
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 1ca80fdd54..cb917e11f5 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 @@ inline void managerGetStorageStatistics(
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 @@ inline void managerGetProcessorStatistics(
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 @@ inline void managerGetMemoryStatistics(
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 afterGetManagerStartTime(
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 82ee25fb9d..2f21656b87 100644
--- a/redfish-core/lib/managers.hpp
+++ b/redfish-core/lib/managers.hpp
@@ -1289,7 +1289,7 @@ struct GetPIDValues : std::enable_shared_from_this<GetPIDValues>
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 @@ struct SetPIDValues : std::enable_shared_from_this<SetPIDValues>
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 @@ inline void getLocation(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
{
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 @@ inline void
{
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 setDateTime(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
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 @@ inline void requestRoutesManager(App& app)
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 @@ inline void requestRoutesManager(App& app)
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 eb5fb2312c..a287593b26 100644
--- a/redfish-core/lib/memory.hpp
+++ b/redfish-core/lib/memory.hpp
@@ -619,8 +619,8 @@ inline void getDimmDataByService(
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 @@ inline void getDimmPartitionData(std::shared_ptr<bmcweb::AsyncResp> asyncResp,
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 c1fdb1cb0d..9a6b25edc5 100644
--- a/redfish-core/lib/metric_report_definition.hpp
+++ b/redfish-core/lib/metric_report_definition.hpp
@@ -1192,9 +1192,9 @@ inline void setReportMetrics(
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 @@ inline void handleMetricReportGet(
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 7868f987a2..ea36d274d5 100644
--- a/redfish-core/lib/network_protocol.hpp
+++ b/redfish-core/lib/network_protocol.hpp
@@ -448,9 +448,9 @@ inline std::string getHostName()
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 7ddbaa0177..4068bac6d2 100644
--- a/redfish-core/lib/pcie.hpp
+++ b/redfish-core/lib/pcie.hpp
@@ -271,8 +271,8 @@ inline void afterGetDbusObject(
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 @@ inline void getPCIeDeviceHealth(
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 @@ inline void getPCIeDeviceState(
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 @@ inline void getPCIeDeviceAsset(
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 @@ inline void getPCIeDeviceProperties(
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 a6796b9913..bb9cde0755 100644
--- a/redfish-core/lib/pcie_slots.hpp
+++ b/redfish-core/lib/pcie_slots.hpp
@@ -148,8 +148,8 @@ inline void onMapperAssociationDone(
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 36a3b152b0..6ce95bddbd 100644
--- a/redfish-core/lib/power.hpp
+++ b/redfish-core/lib/power.hpp
@@ -99,8 +99,8 @@ inline void afterGetChassisPath(
{
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 @@ inline void afterGetChassis(
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 f08527226f..3af8defcd7 100644
--- a/redfish-core/lib/power_supply.hpp
+++ b/redfish-core/lib/power_supply.hpp
@@ -198,9 +198,8 @@ inline void
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 @@ inline void
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 @@ inline void
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 @@ inline void getPowerSupplyFirmwareVersion(
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 @@ inline void
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 @@ inline void handlePowerSupplyAttributesSubTreeResponse(
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 c0d3103fb8..d089381260 100644
--- a/redfish-core/lib/processor.hpp
+++ b/redfish-core/lib/processor.hpp
@@ -62,9 +62,8 @@ inline void getProcessorUUID(std::shared_ptr<bmcweb::AsyncResp> asyncResp,
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 @@ inline void getThrottleProperties(
{
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 @@ inline void getCpuAssetData(std::shared_ptr<bmcweb::AsyncResp> asyncResp,
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 @@ inline void getCpuRevisionData(std::shared_ptr<bmcweb::AsyncResp> asyncResp,
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 @@ inline void getAcceleratorDataByService(
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 @@ inline void
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 @@ inline void
// 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 @@ inline void getCpuLocationCode(std::shared_ptr<bmcweb::AsyncResp> asyncResp,
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 @@ inline void getCpuUniqueId(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
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 @@ inline void getOperatingConfigData(
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 4164e10775..117f972d34 100644
--- a/redfish-core/lib/redfish_util.hpp
+++ b/redfish-core/lib/redfish_util.hpp
@@ -208,7 +208,7 @@ void getPortStatusAndPath(
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 c17a2256be..d663ce3574 100644
--- a/redfish-core/lib/roles.hpp
+++ b/redfish-core/lib/roles.hpp
@@ -133,8 +133,7 @@ inline void requestRoutesRoleCollection(App& app)
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 697e3c5ab1..3ee36afae1 100644
--- a/redfish-core/lib/sensors.hpp
+++ b/redfish-core/lib/sensors.hpp
@@ -555,7 +555,7 @@ inline void populateFanRedundancy(
{
return;
}
- sdbusplus::asio::getAllProperties(
+ dbus::utility::getAllProperties(
*crow::connections::systemBus, owner, path,
"xyz.openbmc_project.Control.FanRedundancy",
[path, sensorsAsyncResp](
@@ -1375,9 +1375,8 @@ void getInventoryLedData(
};
// 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 @@ void getPowerSupplyAttributesData(
// 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 @@ inline void
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 e670de72e3..adcb7880a6 100644
--- a/redfish-core/lib/storage.hpp
+++ b/redfish-core/lib/storage.hpp
@@ -291,9 +291,8 @@ inline void getDriveAsset(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.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 @@ inline void getDrivePresent(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
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 @@ inline void getDriveState(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
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 @@ inline void getDriveItemProperties(
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 @@ inline void populateStorageController(
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 @@ inline void populateStorageController(
}
});
- 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 5265436e5b..e04bb8aa09 100644
--- a/redfish-core/lib/systems.hpp
+++ b/redfish-core/lib/systems.hpp
@@ -205,14 +205,12 @@ inline void
};
// 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 @@ inline void
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 @@ inline void afterSystemGetSubTree(
{
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 @@ inline void afterSystemGetSubTree(
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 @@ inline void afterSystemGetSubTree(
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
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 int assignBootParameters(
*/
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 getBootProgress(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
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 getBootProgressLastStateTime(
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
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
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 @@ inline void processBootOverrideEnable(
// 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 processBootOverrideEnable(
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 @@ inline void
{
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 @@ inline void getAutomaticRebootAttempts(
{
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 @@ inline void
{
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 @@ inline void
{
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 @@ inline void
{
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 @@ inline void getTrustedModuleRequiredToBoot(
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 @@ inline void
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 @@ inline void getPowerMode(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
}
// 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 @@ inline void
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 @@ inline void
}
// 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 @@ inline void handleSystemCollectionResetActionGet(
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 f7f84c76ac..715b568907 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 @@ inline void
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 cd051dcc0c..6b0cf2e3a4 100644
--- a/redfish-core/lib/telemetry_service.hpp
+++ b/redfish-core/lib/telemetry_service.hpp
@@ -36,9 +36,8 @@ inline void handleTelemetryServiceGet(
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 abf296ca77..d90ab6c5e3 100644
--- a/redfish-core/lib/thermal_metrics.hpp
+++ b/redfish-core/lib/thermal_metrics.hpp
@@ -86,7 +86,7 @@ inline void handleTemperatureReadingsCelsius(
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 243b9ad80e..a82630b7cc 100644
--- a/redfish-core/lib/update_service.hpp
+++ b/redfish-core/lib/update_service.hpp
@@ -1177,9 +1177,8 @@ inline void
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) {