StackStorm介绍
StackStorm是一个强大的自动化平台,结合DevOps和ChatOps,提供可扩展、灵活和健壮的工具链用于应用、服务和工作流的自动化能力。
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的执行入口,类似Docker的ENTRYPOINT