Skip to content

Commit 782d711

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 782d711

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

docs/source/sensors.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,26 @@ 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+
36+
.. code-block:: yaml
37+
38+
trigger:
39+
type: "core.st2.key_value_pair.create"
40+
41+
criteria:
42+
trigger.object.name:
43+
type: "eq"
44+
pattern: "x"
45+
46+
action:
47+
ref: "core.local"
48+
parameters:
49+
cmd: "echo {{ trigger.object }}"
50+
51+
Above rule will execute whenever a new key-value pair with name ``x`` is created in the
52+
datastore. The action will print the details of the created key-value pair.
53+
3454
Creating a Sensor
3555
-----------------
3656

0 commit comments

Comments
 (0)