Compare commits
1 Commits
57532efabd
...
daf3d04395
| Author | SHA1 | Date | |
|---|---|---|---|
| daf3d04395 |
@@ -9,6 +9,9 @@ enabled: true
|
|||||||
# Runner type determines how the action is executed
|
# Runner type determines how the action is executed
|
||||||
runner_type: python
|
runner_type: python
|
||||||
|
|
||||||
|
# Minimum Python version required (semver constraint)
|
||||||
|
runtime_version: ">=3.9"
|
||||||
|
|
||||||
# Entry point is the Python script to execute
|
# Entry point is the Python script to execute
|
||||||
entry_point: hello.py
|
entry_point: hello.py
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,9 @@ enabled: true
|
|||||||
# Runner type
|
# Runner type
|
||||||
runner_type: python
|
runner_type: python
|
||||||
|
|
||||||
|
# Minimum Python version required (semver constraint)
|
||||||
|
runtime_version: ">=3.9"
|
||||||
|
|
||||||
# Entry point
|
# Entry point
|
||||||
entry_point: http_example.py
|
entry_point: http_example.py
|
||||||
|
|
||||||
|
|||||||
26
actions/list_numbers.py
Normal file
26
actions/list_numbers.py
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""
|
||||||
|
List Numbers Action - Python Example Pack
|
||||||
|
|
||||||
|
Returns a list of sequential integers as JSON.
|
||||||
|
Result format: {"items": [start, start+1, ..., start+n-1]}
|
||||||
|
|
||||||
|
Actions receive parameters as JSON on stdin and write results to stdout.
|
||||||
|
"""
|
||||||
|
|
||||||
|
import json
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
# Read parameters from stdin (JSON format)
|
||||||
|
params = json.loads(sys.stdin.readline())
|
||||||
|
n = int(params.get("n", 10))
|
||||||
|
start = int(params.get("start", 0))
|
||||||
|
|
||||||
|
result = {"items": list(range(start, n + start))}
|
||||||
|
print(json.dumps(result))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
47
actions/list_numbers.yaml
Normal file
47
actions/list_numbers.yaml
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
# List Numbers Action
|
||||||
|
# Returns a list of sequential integers as JSON
|
||||||
|
|
||||||
|
ref: python_example.list_numbers
|
||||||
|
label: "List Numbers"
|
||||||
|
description: "Returns a list of sequential integers starting from a given value"
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
# Runner type determines how the action is executed
|
||||||
|
runner_type: python
|
||||||
|
|
||||||
|
# Minimum Python version required (semver constraint)
|
||||||
|
runtime_version: ">=3.9"
|
||||||
|
|
||||||
|
# Entry point is the Python script to execute
|
||||||
|
entry_point: list_numbers.py
|
||||||
|
|
||||||
|
# Parameter delivery: stdin for secure parameter passing
|
||||||
|
parameter_delivery: stdin
|
||||||
|
parameter_format: json
|
||||||
|
|
||||||
|
# Output format: json (structured data parsing enabled)
|
||||||
|
output_format: json
|
||||||
|
|
||||||
|
# Action parameters schema (flat format with inline required/secret)
|
||||||
|
parameters:
|
||||||
|
n:
|
||||||
|
type: integer
|
||||||
|
description: "How many numbers to generate"
|
||||||
|
default: 10
|
||||||
|
start:
|
||||||
|
type: integer
|
||||||
|
description: "Starting value of the sequence"
|
||||||
|
default: 0
|
||||||
|
|
||||||
|
# Output schema (flat format)
|
||||||
|
output_schema:
|
||||||
|
items:
|
||||||
|
type: array
|
||||||
|
description: "The list of sequential integers"
|
||||||
|
required: true
|
||||||
|
|
||||||
|
# Tags for categorization
|
||||||
|
tags:
|
||||||
|
- python
|
||||||
|
- example
|
||||||
|
- utility
|
||||||
@@ -8,6 +8,8 @@ enabled: true
|
|||||||
|
|
||||||
# Runner type
|
# Runner type
|
||||||
runner_type: python
|
runner_type: python
|
||||||
|
# Minimum Python version required (semver constraint)
|
||||||
|
runtime_version: ">=3.9"
|
||||||
|
|
||||||
# Entry point
|
# Entry point
|
||||||
entry_point: read_counter.py
|
entry_point: read_counter.py
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ enabled: true
|
|||||||
# Sensor runner type
|
# Sensor runner type
|
||||||
runner_type: python
|
runner_type: python
|
||||||
|
|
||||||
|
# Minimum Python version required
|
||||||
|
runtime_version: ">=3.9"
|
||||||
|
|
||||||
# Entry point for sensor execution
|
# Entry point for sensor execution
|
||||||
entry_point: counter_sensor.py
|
entry_point: counter_sensor.py
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user