Report: make dbus properties writable
ReadingParametersFutureVersion interface for Reports is enhanced from
read-only to read write and supports modification of readingParameteres,
which is done by updating metrics at the first place and re-registering
them for sensors updates. Similar ReportActions interface is enhanced to
read write. Additionally reportActions policy was modified that reports
always contain 'LogToMetricReportsCollection' action. The whole change
enables Redfish support for PATCH method added on webserver side.
Tested:
- New unit tests were created, ran all new and previous UTs, all passed
- Tested under QEMU, interface was checked for RW via dbus cli commands,
checked if Reading Parameters of the Report can be read or written,
if metrics are properly updated and registration/unregistration for
updates works properly, checked if actions of Report can be read or
written, if actions are properly updated and related action behavior
follows the change accordingly
- Tested under QEMU, verified if 'LogToMetricReportsCollection' action
is always added when Report is created or when actions of Report are
updated by dbus interface
- Tested via webserver if it communicates properly with dbus interfaces
of Telemetry and read/write operations via Redfish can be successfully
executed
Signed-off-by: Lukasz Kazmierczak <lukasz.kazmierczak@intel.com>
Change-Id: I7f2fe8eae1631c436cf61a516d5fd0b8358a76bd
diff --git a/src/utils/contains.hpp b/src/utils/contains.hpp
index ea1dd16..0a26cc1 100644
--- a/src/utils/contains.hpp
+++ b/src/utils/contains.hpp
@@ -13,6 +13,12 @@
container.find(container.begin()->first);
};
+template <class T>
+concept HasMemberContains = requires(T container)
+{
+ container.contains(*container.begin());
+};
+
} // namespace detail
template <detail::HasMemberFind T>
@@ -22,6 +28,12 @@
return container.find(key) != container.end();
}
+template <detail::HasMemberContains T>
+inline bool contains(const T& container, const typename T::value_type& key)
+{
+ return container.contains(key);
+}
+
template <class T>
inline bool contains(const T& container, const typename T::value_type& key)
{