-
-
Notifications
You must be signed in to change notification settings - Fork 782
Closed
Labels
Description
See https://github.com/StackStorm/st2/pull/3398/files#r120671893.
To repro:
Declare a trigger type in sensor YAML like so
---
class_name: "FileWatchSensor"
enabled: true
entry_point: "file_watch_sensor.py"
description: "Sensor which monitors files for new lines"
trigger_types:
-
name: "file_watch.line"
pack: "linux"
description: "Trigger which indicates a new line has been detected"
# This sensor can be supplied a path to a file to tail via a rule.
parameters_schema:
type: "object"
properties:
file_path: # User ``st2`` should have permissions to be able to read this file.
description: "Path to the file to monitor"
type: "string"
required: true
additionalProperties: false
Now try to register a rule which doesn't confirm to the schema for parameters we defined in sensor YAML like so
---
name: sample_rule_file_watch
pack: "examples"
description: Sample rule custom trigger type - add a file to be watched by file_watch_sensor in linux pack.
enabled: true
trigger:
parameters:
iam_messing_up: /tmp/st2_test
type: linux.file_watch.line
criteria: {}
action:
parameters:
cmd: echo "{{trigger}}"
ref: core.local
You'll see that a trigger is created and rule will register successfully both of which shouldn't happen.