Convert all schemas to flat format with inline required/secret
All schemas (parameters, output, output_schema, conf_schema) now use the
StackStorm-style flat format expected by Attune:
{ param_name: { type, description, required, secret, ... } }
Instead of the standard JSON Schema format:
{ type: object, properties: { ... }, required: [...] }
Also fix rule template syntax: trigger.payload.* -> event.payload.*
This commit is contained in:
@@ -19,24 +19,19 @@ parameter_format: json
|
||||
# Output format: json (structured data parsing enabled)
|
||||
output_format: json
|
||||
|
||||
# Action parameters schema (standard JSON Schema format)
|
||||
# Action parameters schema (flat format with inline required/secret)
|
||||
parameters:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
description: "Optional name to include in greeting"
|
||||
default: "Python"
|
||||
name:
|
||||
type: string
|
||||
description: "Optional name to include in greeting"
|
||||
default: "Python"
|
||||
|
||||
# Output schema
|
||||
# Output schema (flat format)
|
||||
output_schema:
|
||||
type: object
|
||||
properties:
|
||||
message:
|
||||
type: string
|
||||
description: "The greeting message"
|
||||
required:
|
||||
- message
|
||||
message:
|
||||
type: string
|
||||
description: "The greeting message"
|
||||
required: true
|
||||
|
||||
# Tags for categorization
|
||||
tags:
|
||||
|
||||
@@ -19,46 +19,45 @@ parameter_format: json
|
||||
# Output format: json (structured data)
|
||||
output_format: json
|
||||
|
||||
# Action parameters schema
|
||||
# Action parameters schema (StackStorm-style: inline required/secret per parameter)
|
||||
parameters:
|
||||
type: object
|
||||
properties:
|
||||
url:
|
||||
type: string
|
||||
description: "URL to request (defaults to https://example.com)"
|
||||
default: "https://example.com"
|
||||
method:
|
||||
type: string
|
||||
description: "HTTP method"
|
||||
default: "GET"
|
||||
enum:
|
||||
- GET
|
||||
- POST
|
||||
- PUT
|
||||
- DELETE
|
||||
url:
|
||||
type: string
|
||||
description: "URL to request (defaults to https://example.com)"
|
||||
default: "https://example.com"
|
||||
method:
|
||||
type: string
|
||||
description: "HTTP method"
|
||||
default: "GET"
|
||||
enum:
|
||||
- GET
|
||||
- POST
|
||||
- PUT
|
||||
- DELETE
|
||||
|
||||
# Output schema
|
||||
# Output schema (StackStorm-style flat format)
|
||||
output_schema:
|
||||
type: object
|
||||
properties:
|
||||
status_code:
|
||||
type: integer
|
||||
description: "HTTP response status code"
|
||||
url:
|
||||
type: string
|
||||
description: "URL that was requested"
|
||||
content_length:
|
||||
type: integer
|
||||
description: "Length of the response body in bytes"
|
||||
content_type:
|
||||
type: string
|
||||
description: "Content-Type header from the response"
|
||||
title:
|
||||
type: string
|
||||
description: "Extracted page title (if HTML response)"
|
||||
success:
|
||||
type: boolean
|
||||
description: "Whether the request succeeded (2xx status)"
|
||||
status_code:
|
||||
type: integer
|
||||
description: "HTTP response status code"
|
||||
required: true
|
||||
url:
|
||||
type: string
|
||||
description: "URL that was requested"
|
||||
required: true
|
||||
content_length:
|
||||
type: integer
|
||||
description: "Length of the response body in bytes"
|
||||
content_type:
|
||||
type: string
|
||||
description: "Content-Type header from the response"
|
||||
title:
|
||||
type: string
|
||||
description: "Extracted page title (if HTML response)"
|
||||
success:
|
||||
type: boolean
|
||||
description: "Whether the request succeeded (2xx status)"
|
||||
required: true
|
||||
|
||||
# Tags for categorization
|
||||
tags:
|
||||
|
||||
@@ -19,36 +19,30 @@ parameter_format: json
|
||||
# Output format: json (structured data)
|
||||
output_format: json
|
||||
|
||||
# Action parameters schema
|
||||
# Action parameters schema (StackStorm-style: inline required per parameter)
|
||||
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
|
||||
counter:
|
||||
type: integer
|
||||
description: "The counter value to consume"
|
||||
required: true
|
||||
rule_ref:
|
||||
type: string
|
||||
description: "The rule reference the counter is scoped to"
|
||||
default: ""
|
||||
|
||||
# Output schema
|
||||
# Output schema (StackStorm-style: inline required per parameter)
|
||||
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
|
||||
message:
|
||||
type: string
|
||||
description: "Formatted message containing the counter value"
|
||||
required: true
|
||||
counter:
|
||||
type: integer
|
||||
description: "The counter value that was consumed"
|
||||
required: true
|
||||
rule_ref:
|
||||
type: string
|
||||
description: "The rule reference the counter is scoped to"
|
||||
|
||||
# Tags for categorization
|
||||
tags:
|
||||
|
||||
12
pack.yaml
12
pack.yaml
@@ -11,14 +11,12 @@ email: "support@attune.io"
|
||||
system: false
|
||||
enabled: true
|
||||
|
||||
# Pack configuration schema
|
||||
# Pack configuration schema (flat format with inline required/secret)
|
||||
conf_schema:
|
||||
type: object
|
||||
properties:
|
||||
counter_key_prefix:
|
||||
type: string
|
||||
description: "Prefix for counter keys in the keystore"
|
||||
default: "python_example.counter"
|
||||
counter_key_prefix:
|
||||
type: string
|
||||
description: "Prefix for counter keys in the keystore"
|
||||
default: "python_example.counter"
|
||||
|
||||
# Default pack configuration
|
||||
config:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Connects the counter sensor trigger to the read_counter action
|
||||
#
|
||||
# When the counter sensor fires, this rule passes the counter value
|
||||
# and rule reference from the trigger payload into the read_counter action.
|
||||
# and rule reference from the event payload into the read_counter action.
|
||||
|
||||
ref: python_example.count_and_log
|
||||
pack_ref: python_example
|
||||
@@ -13,10 +13,10 @@ description: "Fires on each counter tick and logs the current counter value"
|
||||
trigger_ref: python_example.counter
|
||||
action_ref: python_example.read_counter
|
||||
|
||||
# Map trigger payload fields into action parameters
|
||||
# Map event payload fields into action parameters
|
||||
action_params:
|
||||
counter: "{{ trigger.payload.counter }}"
|
||||
rule_ref: "{{ trigger.payload.rule_ref }}"
|
||||
counter: "{{ event.payload.counter }}"
|
||||
rule_ref: "{{ event.payload.rule_ref }}"
|
||||
|
||||
# No conditions — fire on every counter event
|
||||
conditions: {}
|
||||
|
||||
@@ -20,20 +20,18 @@ entry_point: counter_sensor.py
|
||||
trigger_types:
|
||||
- python_example.counter
|
||||
|
||||
# Sensor configuration schema
|
||||
# Sensor configuration schema (flat format with inline required/secret)
|
||||
parameters:
|
||||
type: object
|
||||
properties:
|
||||
default_interval_seconds:
|
||||
type: integer
|
||||
description: "Default interval between counter emissions (in seconds)"
|
||||
default: 1
|
||||
minimum: 1
|
||||
maximum: 3600
|
||||
key_prefix:
|
||||
type: string
|
||||
description: "Prefix for counter keys in the Attune keystore"
|
||||
default: "python_example.counter"
|
||||
default_interval_seconds:
|
||||
type: integer
|
||||
description: "Default interval between counter emissions (in seconds)"
|
||||
default: 1
|
||||
minimum: 1
|
||||
maximum: 3600
|
||||
key_prefix:
|
||||
type: string
|
||||
description: "Prefix for counter keys in the Attune keystore"
|
||||
default: "python_example.counter"
|
||||
|
||||
# Poll interval (how often the sensor checks for events)
|
||||
poll_interval: 1
|
||||
|
||||
@@ -9,39 +9,32 @@ enabled: true
|
||||
# Trigger type
|
||||
type: custom
|
||||
|
||||
# Parameter schema - configuration for the trigger instance
|
||||
# Parameter schema - configuration for the trigger instance (flat format with inline required/secret)
|
||||
parameters:
|
||||
type: object
|
||||
properties:
|
||||
interval_seconds:
|
||||
type: integer
|
||||
description: "Seconds between each counter emission"
|
||||
default: 1
|
||||
minimum: 1
|
||||
maximum: 3600
|
||||
required: []
|
||||
interval_seconds:
|
||||
type: integer
|
||||
description: "Seconds between each counter emission"
|
||||
default: 1
|
||||
minimum: 1
|
||||
maximum: 3600
|
||||
|
||||
# Payload schema - data emitted when trigger fires
|
||||
# Payload schema - data emitted when trigger fires (flat format with inline required/secret)
|
||||
output:
|
||||
type: object
|
||||
properties:
|
||||
counter:
|
||||
type: integer
|
||||
description: "Current counter value (monotonically increasing per rule)"
|
||||
rule_ref:
|
||||
type: string
|
||||
description: "Reference of the rule that this counter is scoped to"
|
||||
sensor_ref:
|
||||
type: string
|
||||
description: "Reference to the sensor that generated this event"
|
||||
fired_at:
|
||||
type: string
|
||||
format: date-time
|
||||
description: "Timestamp when the trigger fired"
|
||||
required:
|
||||
- counter
|
||||
- rule_ref
|
||||
- fired_at
|
||||
counter:
|
||||
type: integer
|
||||
description: "Current counter value (monotonically increasing per rule)"
|
||||
required: true
|
||||
rule_ref:
|
||||
type: string
|
||||
description: "Reference of the rule that this counter is scoped to"
|
||||
required: true
|
||||
sensor_ref:
|
||||
type: string
|
||||
description: "Reference to the sensor that generated this event"
|
||||
fired_at:
|
||||
type: string
|
||||
description: "Timestamp when the trigger fired"
|
||||
required: true
|
||||
|
||||
# Tags for categorization
|
||||
tags:
|
||||
|
||||
Reference in New Issue
Block a user