Add Trigger and TriggerManager interfaces
Trigger and TriggerManager interfaces design are based on Telemetry
design. Interfaces be implemented in openbmc/telemetry repository.
Ref.:
https://github.com/openbmc/docs/blob/master/designs/telemetry.md
Signed-off-by: Wludzik, Jozef <jozef.wludzik@intel.com>
Change-Id: I41c31aa2ae091d3283ddb4ec422885483f4d0429
diff --git a/xyz/openbmc_project/Telemetry/Trigger.interface.yaml b/xyz/openbmc_project/Telemetry/Trigger.interface.yaml
new file mode 100644
index 0000000..268c53e
--- /dev/null
+++ b/xyz/openbmc_project/Telemetry/Trigger.interface.yaml
@@ -0,0 +1,96 @@
+description: >
+ Implement this interface to provide trigger inspection features. An
+ implementation service should additionaly implement
+ xyz.openbmc_project.Object.Delete for deletion of individual trigger.
+
+properties:
+ - name: Discrete
+ type: boolean
+ description: >
+ If true than trigger uses discrete thresholds as threshold conditions.
+ Otherwise numeric thresholds is used.
+ flags:
+ - const
+ - name: LogToJournal
+ type: boolean
+ description: >
+ Defines if trigger logs to system journal when threshold conditions are
+ met. LogToJournal is a trigger action.
+ flags:
+ - const
+ - name: LogToRedfish
+ type: boolean
+ description: >
+ Defines if trigger logs Redfish message when threshold conditions are
+ met. LogToRedfish is a trigger action.
+ flags:
+ - const
+ - name: UpdateReport
+ type: boolean
+ description: >
+ Defines if trigger updates report when threshold conditions are
+ met. Reports that will be updated are specified in ReportNames property.
+ UpdateReport is a trigger action.
+ flags:
+ - const
+ - name: Persistent
+ type: boolean
+ description: Defines if Trigger is stored in non volatile memory.
+ - name: ReportNames
+ type: array[string]
+ description: >
+ Collection of report names that are updated when threshold conditions
+ are met. List is ignored if UpdateReport property is false.
+ - name: Sensors
+ type: array[struct[object_path, string]]
+ description: >
+ Array of sensors that is monitored within trigger. First parameter of a
+ structure is a sensor path. Second parameter is a metadata that is used
+ to store user data about sensor.
+ - name: Thresholds
+ type: variant[array[struct[enum[self.Type],enum[self.Direction],uint64,double]],array[struct[string,enum[self.Severity],uint64,double]]]
+ description: >
+ First type in variant is a collection of numeric thresholds that has
+ following fields - type, direction, dwell time and threshold value.
+ Second type holds by variant is a collection of discrete thresholds that
+ contains following fields - user id, severity, dwell time and threshold
+ value. Numeric threshold array is limited by Type enumeration, only 4
+ elements are allowed. Discrete threshold array size is not limited. If
+ Discrete threshold array is empty than every value change is taken into
+ account of threshold condition. Dwell time specify for how long
+ condition has to persist to trigger an action.
+
+enumerations:
+ - name: Type
+ description: >
+ Defines a context of a message that is logged when numeric threshold
+ condition is met.
+ values:
+ - name: LowerCritical
+ - name: LowerWarning
+ - name: UpperWarning
+ - name: UpperCritical
+ - name: Direction
+ description: >
+ Defines in which direction threshold value is crossed to fulfill numeric
+ threshold condition.
+ values:
+ - name: Either
+ description: >
+ Crossing threshold value fulfill numeric threshold condition.
+ - name: Decreasing
+ description: >
+ If threshold value is crossed and previous sensor value was greater
+ then threshold value then numeric threshold condition is met.
+ - name: Increasing
+ description: >
+ If threshold value is crossed and previous sensor value was less
+ then threshold value then numeric threshold condition is met.
+ - name: Severity
+ description: >
+ Defines a context of a message that is logged when discrete threshold
+ condition is met.
+ values:
+ - name: OK
+ - name: Warning
+ - name: Critical
diff --git a/xyz/openbmc_project/Telemetry/TriggerManager.interface.yaml b/xyz/openbmc_project/Telemetry/TriggerManager.interface.yaml
new file mode 100644
index 0000000..e6b1e7e
--- /dev/null
+++ b/xyz/openbmc_project/Telemetry/TriggerManager.interface.yaml
@@ -0,0 +1,59 @@
+description: >
+ Implement to provide triggers management.
+
+methods:
+ - name: AddTrigger
+ description:
+ Create new object that represent Trigger with
+ xyz.openbmc_project.Telemetry.Trigger interface stored in path
+ /xyz/openbmc_project/Telemetry/Triggers/{Domain}/{Name} where
+ Domain and Name are parameters of this method.
+ parameters:
+ - name: name
+ type: string
+ description: >
+ Defines the name of report to be exposed over D-Bus. Service allows
+ to use separator '/' in name to group reports in directory.
+ - name: discrete
+ type: boolean
+ description: >
+ Defines if thresholds parameter contains discrete thresholds.
+ Otherwise thresholds contain numeric thresholds.
+ - name: logToJournal
+ type: boolean
+ description: >
+ Defines if trigger logs to system journal when threshold conditions
+ are met.
+ - name: logToRedfish
+ type: boolean
+ description: >
+ Defines if trigger logs Redfish message when threshold conditions
+ are met.
+ - name: updateReport
+ type: boolean
+ description: >
+ Defines if trigger updates reports that are specified in reportNames
+ parameter when threshold conditions are met.
+ - name: sensors
+ type: array[struct[object_path,string]]
+ description: >
+ Array of sensors that is monitored within trigger. Object path
+ points to a sensor in DBus envrionment. String is used as user
+ metadata.
+ - name: reportNames
+ type: array[string]
+ description: >
+ Collection of report names that are updated when threshold
+ conditions are met. This parameter is ignored if updateReport
+ parameter is set to false.
+ - name: thresholds
+ type: variant[array[struct[enum[xyz.openbmc_project.Telemetry.Trigger.Type],enum[xyz.openbmc_project.Telemetry.Trigger.Direction],uint64,double]],array[struct[string,enum[xyz.openbmc_project.Telemetry.Trigger.Severity],uint64,double]]]
+ description: >
+ Contains array of numeric or discrete thresholds that are described
+ in xyz.openbmc_project.Telemetry.Trigger interface.
+ returns:
+ - name: triggerPath
+ type: object_path
+ description: >
+ Path to new trigger ->
+ /xyz/openbmc_project/Telemetry/Triggers/{name}.