StackStorm分析(三)Action说明

本文详细介绍了StackStorm的Action,包括内置Action的查询与使用,如何自定义Action及其元数据,ActionRunner的工作原理,以及ActionChain在Workflow中的作用。StackStorm作为一个强大的自动化平台,提供了丰富的自动化任务执行方式,并支持自定义扩展。
摘要由CSDN通过智能技术生成

StackStorm介绍

       StackStorm是一个强大的自动化平台,结合DevOpsChatOps,提供可扩展、灵活和健壮的工具链用于应用、服务和工作流的自动化能力。

 


 

Action

Action是StackStrom事件触发后的处理方式,也就是自动化任务的执行体。

 

内置Action

StackStorm内置了许多Action,可以通过命令行查询:

# List all available actions (note that output may be lengthy)
$ st2 action list
 
# List all actions in "linux" pack
$ st2 action list -p linux

 

比较常用的Action,比如core.local就是在本地执行Linux命令,我们可以查询Action的详细说明:

$ st2 action get core.local
+-------------+--------------------------------------------------------------+
| Property    | Value                                                        |
+-------------+--------------------------------------------------------------+
| id          | 5afa49082b2556016fc96b82                                     |
| uid         | action:core:local                                            |
| ref         | core.local                                                   |
| pack        | core                                                         |
| name        | local                                                        |
| description | Action that executes an arbitrary Linux command on the       |
|             | localhost.                                                   |
| enabled     | True                                                         |
| entry_point |                                                              |
| runner_type | local-shell-cmd                                              |
| parameters  | {                                                            |
|             |     "cmd": {                                                 |
|             |         "required": true,                                    |
|             |         "type": "string",                                    |
|             |         "description": "Arbitrary Linux command to be        |
|             | executed on the local host."                                 |
|             |     },                                                       |
|             |     "sudo": {                                                |
|             |         "immutable": true                                    |
|             |     }                                                        |
|             | }                                                            |
| notify      |                                                              |
| tags        |                                                              |
+-------------+--------------------------------------------------------------+

 

  • pack: Action归属的Pack,StackStorm中Action和Workflow,Rule和Sensor都归属于Pack。可以通过st2 packlist查询Pack。
  • entry_point Action的执行入口,类似DockerENTRYPOINT
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值