created AddReportFutureVersion dbus method
New method will support CollectionTimeScope, CollectionDuration
In order to make not breaking interface changes bmcweb will switch to
AddReportFutureVersion, then AddReport will be changed to match
AddReportFutureVersion, then redfish will switch back to use AddReport,
then AddReportFutureVersion will be removed.
Tested:
- Verified that current version of bmcweb works fine with old API
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
Change-Id: I51a9b7fb2f4da5b8d2f688ccd5e93710352b1ac7
diff --git a/tests/src/params/report_params.hpp b/tests/src/params/report_params.hpp
index 25422bc..3bfd308 100644
--- a/tests/src/params/report_params.hpp
+++ b/tests/src/params/report_params.hpp
@@ -1,7 +1,7 @@
#pragma once
-#include "interfaces/types.hpp"
#include "report_manager.hpp"
+#include "types/report_types.hpp"
#include <chrono>
#include <string>
@@ -53,26 +53,26 @@
return logToMetricReportCollectionProperty;
}
- ReportParams& interval(std::chrono::milliseconds val)
+ ReportParams& interval(Milliseconds val)
{
intervalProperty = val;
return *this;
}
- std::chrono::milliseconds interval() const
+ Milliseconds interval() const
{
return intervalProperty;
}
- ReportParams& readingParameters(ReadingParameters val)
+ ReportParams& metricParameters(std::vector<LabeledMetricParameters> val)
{
- readingParametersProperty = std::move(val);
+ metricParametersProperty = std::move(val);
return *this;
}
- const ReadingParameters& readingParameters() const
+ const std::vector<LabeledMetricParameters>& metricParameters() const
{
- return readingParametersProperty;
+ return metricParametersProperty;
}
private:
@@ -80,16 +80,22 @@
std::string reportingTypeProperty = "OnRequest";
bool emitReadingUpdateProperty = true;
bool logToMetricReportCollectionProperty = true;
- std::chrono::milliseconds intervalProperty = ReportManager::minInterval;
- ReadingParameters readingParametersProperty = {
- {{sdbusplus::message::object_path(
- "/xyz/openbmc_project/sensors/power/p1")},
- utils::enumToString(OperationType::single),
- "MetricId1",
- "Metadata1"},
- {{sdbusplus::message::object_path(
- "/xyz/openbmc_project/sensors/power/p2")},
- utils::enumToString(OperationType::single),
- "MetricId2",
- "Metadata2"}};
+ Milliseconds intervalProperty = ReportManager::minInterval;
+ std::vector<LabeledMetricParameters> metricParametersProperty{
+ {LabeledMetricParameters{
+ {LabeledSensorParameters{"Service",
+ "/xyz/openbmc_project/sensors/power/p1"}},
+ OperationType::single,
+ "MetricId1",
+ "Metadata1",
+ CollectionTimeScope::point,
+ CollectionDuration(Milliseconds(0u))},
+ LabeledMetricParameters{
+ {LabeledSensorParameters{"Service",
+ "/xyz/openbmc_project/sensors/power/p2"}},
+ OperationType::single,
+ "MetricId2",
+ "Metadata2",
+ CollectionTimeScope::point,
+ CollectionDuration(Milliseconds(0u))}}};
};