Refactor GetSubTreePaths method
Since the GetSubTreePaths method has been implemented in dbus_utility
and this commit is to integrate all the places where the
GetSubTreePaths method is called, and use the method in dbus_utility
uniformly.
Requires https://gerrit.openbmc.org/c/openbmc/sdbusplus/+/60020 to
build.
Tested: Redfish Validator Passed
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: Ie4140d4484a7e4f4b943013f4371ffd2d44a22e9
diff --git a/redfish-core/lib/trigger.hpp b/redfish-core/lib/trigger.hpp
index ad38556..4da1ed5 100644
--- a/redfish-core/lib/trigger.hpp
+++ b/redfish-core/lib/trigger.hpp
@@ -10,6 +10,8 @@
#include <sdbusplus/unpack_properties.hpp>
#include <utils/dbus_utils.hpp>
+#include <array>
+#include <string_view>
#include <tuple>
#include <variant>
#include <vector>
@@ -304,7 +306,8 @@
asyncResp->res.jsonValue["@odata.id"] =
"/redfish/v1/TelemetryService/Triggers";
asyncResp->res.jsonValue["Name"] = "Triggers Collection";
- const std::vector<const char*> interfaces{telemetry::triggerInterface};
+ constexpr std::array<std::string_view, 1> interfaces{
+ telemetry::triggerInterface};
collection_util::getCollectionMembers(
asyncResp,
boost::urls::url("/redfish/v1/TelemetryService/Triggers"),