触发条件(Trigger)

trigger文件是触发文件或者指引文件,它定义了接口名称,并指向一个pipe文件,每一个trigger对应了一个接口

格式:

{
    "enabled": true,
    "service": "httpd",
    "title": "my_trigger",
    "pipe": "my_pipe",
    "service_args": {
        "format": "json",
        "method": "GET",
        "path": "test/my_pipe"
    },
    "pipe_params": {},
    "input": null
}

参数:

  • enabled:是否激活,布尔型,true/false
  • service:服务协议,可选(httpd/WebService/rabbitmq/mongodb/cron)
  • title:名称
  • pipe:指向的pipe文件名,不写后缀名
  • pipe_params:pipe参数
  • input:输入值
service_args:服务变量,根据服务类型不同,参数不同,以下列出:
{
    "service": "http",
    "service_args": {
        "format": "json",
        "method": "GET",
        "path": "test/my_pipe"
    },
}
{
    "service": "cron",
    "service_args": {
        "time": ""//时间
    }
}
{
    "service": "rabbitmq",
    "service_args": {
        "node": "",//RabbitMQ节点
        "queue":"",//读取的队列名
        "requeue_enerror":""//出错时扔出队列
    }
}
{
    "service": "ftpd",
    "service_args": {
        "path": "",
        "user":"",
        "password":""
    }
}
  • 数据格式:json
  • 文件后缀名:.json

沪ICP备05002918号

© 2003-2017 ShopEx,Inc.All rights reserved.