Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions docs/source/sensors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,26 @@ A list of available triggers for each resource is included below:

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

An example rule to use ``core.st2.key_value_pair.*`` triggers is included below:

.. code-block:: yaml

trigger:
type: "core.st2.key_value_pair.create"

criteria:
trigger.object.name:
type: "eq"
pattern: "x"

action:
ref: "core.local"
parameters:
cmd: "echo {{ trigger.object }}"

Above rule will execute whenever a new key-value pair with name ``x`` is created in the
datastore. The action will print the details of the created key-value pair.

Creating a Sensor
-----------------

Expand Down