summaryrefslogtreecommitdiff
path: root/redfish-core/lib/metric_report.hpp
diff options
context:
space:
mode:
authorWilly Tu <wltu@google.com>2022-09-27 08:48:07 +0300
committerEd Tanous <ed@tanous.net>2022-11-02 20:00:26 +0300
commitae9031f0e8595ee88945ac565d10be0c3832ed01 (patch)
tree7cf1c6aa5e91aa80cac6441b5955edb9a355dd54 /redfish-core/lib/metric_report.hpp
parent6107da1e94ce2e3b5ea975f13e7410583ecb815f (diff)
downloadbmcweb-ae9031f0e8595ee88945ac565d10be0c3832ed01.tar.xz
Update CollectionMembers to use UrlFromPieces
Refactor getCollectionMembers to make sure all Url created with dbus paths are generated via UrlFromPieces helper function. This allow us to manage all URL generated from dbus in one place and allow us to make future changes to affect all resources. We can make changes to all resources easier if they are all managed by one function. Tested: Redfish Validator Passed. All Collections working as expected and match previous implmentation. Change-Id: I5d3b2b32f047ce4f20a2287a36a3e099efd6eace Signed-off-by: Willy Tu <wltu@google.com>
Diffstat (limited to 'redfish-core/lib/metric_report.hpp')
-rw-r--r--redfish-core/lib/metric_report.hpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/redfish-core/lib/metric_report.hpp b/redfish-core/lib/metric_report.hpp
index 6b79c5124a..33c8c9c826 100644
--- a/redfish-core/lib/metric_report.hpp
+++ b/redfish-core/lib/metric_report.hpp
@@ -16,9 +16,6 @@ namespace redfish
namespace telemetry
{
-constexpr const char* metricReportUri =
- "/redfish/v1/TelemetryService/MetricReports";
-
using Readings =
std::vector<std::tuple<std::string, std::string, double, uint64_t>>;
using TimestampReadings = std::tuple<uint64_t, Readings>;
@@ -77,11 +74,14 @@ inline void requestRoutesMetricReportCollection(App& app)
asyncResp->res.jsonValue["@odata.type"] =
"#MetricReportCollection.MetricReportCollection";
- asyncResp->res.jsonValue["@odata.id"] = telemetry::metricReportUri;
+ asyncResp->res.jsonValue["@odata.id"] =
+ "/redfish/v1/TelemetryService/MetricReports";
asyncResp->res.jsonValue["Name"] = "Metric Report Collection";
const std::vector<const char*> interfaces{telemetry::reportInterface};
collection_util::getCollectionMembers(
- asyncResp, telemetry::metricReportUri, interfaces,
+ asyncResp,
+ boost::urls::url("/redfish/v1/TelemetryService/MetricReports"),
+ interfaces,
"/xyz/openbmc_project/Telemetry/Reports/TelemetryService");
});
}