Read persistent triggers from storage
Read json storage file for persistent triggers.
Add trigger to telemetry service.
Cover code with UTs.
Tested:
- Passed unit tests
- Tested on QEMU
* starting app without configuration
* restart app with configuration stored
* restart app with configuration in incorrect version
* restart app with configuration malformed
Change-Id: I2cb9324abdb8323be8a7f0c932ed7f70c5bc2891
Signed-off-by: Cezary Zwolak <cezary.zwolak@intel.com>
Signed-off-by: Lukasz Kazmierczak <lukasz.kazmierczak@intel.com>
diff --git a/src/trigger.hpp b/src/trigger.hpp
index b2bdc1d..a108caf 100644
--- a/src/trigger.hpp
+++ b/src/trigger.hpp
@@ -14,18 +14,17 @@
class Trigger : public interfaces::Trigger
{
public:
- Trigger(
- boost::asio::io_context& ioc,
- const std::shared_ptr<sdbusplus::asio::object_server>& objServer,
- const std::string& name, const bool isDiscrete, const bool logToJournal,
- const bool logToRedfish, const bool updateReport,
- const std::vector<
- std::pair<sdbusplus::message::object_path, std::string>>& sensorsIn,
- const std::vector<std::string>& reportNames,
- const TriggerThresholdParams& thresholdParams,
- std::vector<std::shared_ptr<interfaces::Threshold>>&& thresholds,
- interfaces::TriggerManager& triggerManager,
- interfaces::JsonStorage& triggerStorage);
+ Trigger(boost::asio::io_context& ioc,
+ const std::shared_ptr<sdbusplus::asio::object_server>& objServer,
+ const std::string& name, const bool isDiscrete,
+ const bool logToJournal, const bool logToRedfish,
+ const bool updateReport,
+ const std::vector<std::string>& reportNames,
+ const std::vector<LabeledSensorInfo>& LabeledSensorsInfoIn,
+ const LabeledTriggerThresholdParams& labeledThresholdParamsIn,
+ std::vector<std::shared_ptr<interfaces::Threshold>>&& thresholds,
+ interfaces::TriggerManager& triggerManager,
+ interfaces::JsonStorage& triggerStorage);
Trigger(const Trigger&) = delete;
Trigger(Trigger&&) = delete;
@@ -52,9 +51,9 @@
bool updateReport;
const std::string path;
bool persistent = false;
- TriggerSensors sensors;
std::vector<std::string> reportNames;
- TriggerThresholdParams thresholdParams;
+ std::vector<LabeledSensorInfo> labeledSensorsInfo;
+ LabeledTriggerThresholdParams labeledThresholdParams;
std::unique_ptr<sdbusplus::asio::dbus_interface> deleteIface;
std::unique_ptr<sdbusplus::asio::dbus_interface> triggerIface;
std::vector<std::shared_ptr<interfaces::Threshold>> thresholds;