首页 > 其他 > 详细

StackStorm简介之actions

时间:2021-05-16 23:55:28      阅读:34      评论:0      收藏:0      [点我收藏+]

 

获取示例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)

  

StackStorm简介之actions

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!