Skip to content

Commit deda800

Browse files
committed
Key-value pairs trigger example
- Include example demonstrating a rule to use key-value based internal trigger resulting into an action Signed-off-by: NitinNahal <[email protected]>
1 parent 87e39c0 commit deda800

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

docs/source/sensors.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,25 @@ A list of available triggers for each resource is included below:
3131

3232
.. _ref-sensors-authoring-a-sensor:
3333

34+
An example rule to use ``core.st2.key_value_pair.*`` triggers is included below:
35+
.. code-block:: yaml
36+
37+
trigger:
38+
type: "core.st2.key_value_pair.create"
39+
40+
criteria:
41+
trigger.object.name:
42+
type: "eq"
43+
pattern : "x"
44+
45+
action:
46+
ref: "core.local"
47+
parameters:
48+
cmd: "echo {{ trigger.object }}"
49+
50+
Above rule will execute whenever a new key-value pair with name ``x`` is created in the
51+
datastore. The action will print the details of the created key-value pair.
52+
3453
Creating a Sensor
3554
-----------------
3655

0 commit comments

Comments
 (0)