StackStorm简介之actions

官网: https://stackstorm.com/

获取示例pack的地址

https://exchange.stackstorm.org/

ST2 代码地址
https://github.com/StackStorm/st2


ST 原理图


python actions yaml

vim my_echo_action.yaml
---
name: "echo_action"
runner_type: "python-script"
description: "Print message to standard output."
enabled: true
entry_point: "my_echo_action.py"
parameters:
    message:
        type: "string"
        description: "Message to print."
        required: true
        position: 0

  python actions  python

vim my_echo_action.py
import sys
from st2common.runners.base_action import Action
class MyEchoAction(Action):
    def run(self, message):
        print(message)

        if message == 'working':
            return (True, message)
        return (False, message)

  

原文地址:https://www.cnblogs.com/workherd/p/14775066.html