Includes: - 3 Python actions (hello, http_example, read_counter) - 1 counter trigger type - 1 counter sensor (Python, keystore-backed, per-rule state) - 1 example rule (count_and_log) - requirements.txt with requests and pika - README with full usage documentation
59 lines
1.3 KiB
YAML
59 lines
1.3 KiB
YAML
# Read Counter Action
|
|
# Consumes a counter value and returns a formatted message
|
|
|
|
ref: python_example.read_counter
|
|
label: "Read Counter"
|
|
description: "Receives a counter value (typically from the counter trigger) and returns a formatted message containing it"
|
|
enabled: true
|
|
|
|
# Runner type
|
|
runner_type: python
|
|
|
|
# Entry point
|
|
entry_point: read_counter.py
|
|
|
|
# Parameter delivery: stdin for secure parameter passing
|
|
parameter_delivery: stdin
|
|
parameter_format: json
|
|
|
|
# Output format: json (structured data)
|
|
output_format: json
|
|
|
|
# Action parameters schema
|
|
parameters:
|
|
type: object
|
|
properties:
|
|
counter:
|
|
type: integer
|
|
description: "The counter value to consume"
|
|
rule_ref:
|
|
type: string
|
|
description: "The rule reference the counter is scoped to"
|
|
default: ""
|
|
required:
|
|
- counter
|
|
|
|
# Output schema
|
|
output_schema:
|
|
type: object
|
|
properties:
|
|
message:
|
|
type: string
|
|
description: "Formatted message containing the counter value"
|
|
counter:
|
|
type: integer
|
|
description: "The counter value that was consumed"
|
|
rule_ref:
|
|
type: string
|
|
description: "The rule reference the counter is scoped to"
|
|
required:
|
|
- message
|
|
- counter
|
|
|
|
# Tags for categorization
|
|
tags:
|
|
- counter
|
|
- example
|
|
- python
|
|
- consumer
|