action元数据介绍

stackstorm----action元数据介绍

学习stackstorm的action元数据

本文学习自stackstorm官方文档,如有不正确之处,还请大神指教.

什么是action元数据?

action的元数据用于描述action,并且作为YAML文件被定义.
而Yaml文件是一种标记语言,其较直观的表现的形式,在展示上更易查错和关系描述

属性特征
name ---- action的名称, 例如 name: “send_sms”
runner_type ---- 执行action的runner类型, 例如 runner_type : “python-script”
description ---- 该action的yaml文件描述, 例如 介绍其用途
enabled ---- 禁用时无法调用action, 例如: enabled: true 或者 enabled: false [指禁用时]
entry_point ---- action执行入口,在路径 /opt/stackstorm/packs/${pack_name}/actions/ 下的action 脚本启动文件
parameters ---- 参数,字典类型的参数,可选择的去描述元数据类型,默认的参数.元数据的参数类型: string,Boolean,number,object,integer,array
tags ---- 为此actions 标记一个数组用来达到提供补充信息的目的

例子的参数释义
例如:
parameters:
from_number:
type: “string”
description: “Your twilio ‘from’ number in E.164 format. Example +14151234567.”
required: false ---- 此参数不是必需的
position: 0
to_number:
type: “string”
description: “Recipient number in E.164 format. Example +14151234567.”
required: true ---- 此参数是必需的
position: 1
secret: true ---- 参数to_number 的属性secret值为true.如果一个属性作为一个secret被标记,这个值的属性将在StackStorm服务日志被屏蔽.
body:
type: “string” ---- 此参数的类型
description: “Body of the message.” ---- 此参数的描述
required: true
position: 2
default: “Hello {% if system.user %} {{ st2kv.system.user }} {% else %} dude {% endif %}!”

此action携带的参数有三个 (from_number, to_number, body)

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值