Add Id to Trigger
Currently, Trigger is using Name as unique identifier. By adding Id, we
can be compliant with redfish specification:
- Id will be used as unique identifier
- Name will be used as human readable, non-unique name
AddTrigger dbus method is now requiring both id and name. Each of them
can be passed as empty string and the service will fill them with
correct values. If only id is an empty string, name will be used to
generate its value.
Dbus object path and persistent storage filename are now be based on id,
instead of name.
Added validation for AddTrigger:
- correct characters in id
- max id length
Added Name property for Trigger object, which can be modified from dbus.
Testing done:
- Unit test added and passing
- Trigger was added using dbus, without errors
- Id generation is working properly
- Name property is accessible and writable from dbus
Signed-off-by: Szymon Dompke <szymon.dompke@intel.com>
Change-Id: Ibb553586eaf51943044c93a35bc0725e6ef67ce9
diff --git a/src/trigger_factory.hpp b/src/trigger_factory.hpp
index e7f8fb0..757d663 100644
--- a/src/trigger_factory.hpp
+++ b/src/trigger_factory.hpp
@@ -16,7 +16,7 @@
interfaces::ReportManager& reportManager);
std::unique_ptr<interfaces::Trigger>
- make(const std::string& name,
+ make(const std::string& id, const std::string& name,
const std::vector<std::string>& triggerActions,
const std::vector<std::string>& reportNames,
interfaces::TriggerManager& triggerManager,