Initial commit: Node.js Example Pack for Attune
Includes: - 3 Node.js actions (hello, http_example, read_counter) - 1 counter trigger type - 1 counter sensor (Node.js, keystore-backed, per-rule state) - 1 example rule (count_and_log) - package.json with node-fetch and amqplib - README with full usage documentation
This commit is contained in:
65
actions/http_example.yaml
Normal file
65
actions/http_example.yaml
Normal file
@@ -0,0 +1,65 @@
|
||||
# HTTP Example Action
|
||||
# Demonstrates using node-fetch to make HTTP calls
|
||||
|
||||
ref: nodejs_example.http_example
|
||||
label: "HTTP Example"
|
||||
description: "Makes an HTTP GET request to example.com using the node-fetch library"
|
||||
enabled: true
|
||||
|
||||
# Runner type
|
||||
runner_type: nodejs
|
||||
|
||||
# Entry point
|
||||
entry_point: http_example.js
|
||||
|
||||
# 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:
|
||||
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:
|
||||
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 characters"
|
||||
snippet:
|
||||
type: string
|
||||
description: "First 500 characters of the response body"
|
||||
success:
|
||||
type: boolean
|
||||
description: "Whether the request succeeded (2xx status)"
|
||||
|
||||
# Tags for categorization
|
||||
tags:
|
||||
- http
|
||||
- nodejs
|
||||
- example
|
||||
- fetch
|
||||
Reference in New Issue
Block a user