有奖捉虫:云通信与企业服务文档专题,速来> HOT
说明:

当前页面接口为旧版 API,未来可能停止维护。容器服务 API 3.0 版本接口定义更加规范,访问时延下降显著,建议使用 容器服务 API 3.0

1. 接口描述

本接口 ( AddUpdateServiceTrigger ) 添加触发器。
接口请求域名:ccr.api.qcloud.com

2. 输入参数

以下请求参数列表仅列出了接口请求参数,其它参数见 公共请求参数

参数名称 描述 类型 必选
triggerName 触发器名称 String
reponame 触发器绑定的仓库名 String
invokeMethod 触发方式 String
invokeExpr 触发方式对应的表达式 String
serviceName 服务名称 String
clusterId 集群 ID String
namespace 命名空间 String
containerName 容器名称 String
clusterRegion 集群区域 Int

3. 输出参数

参数名称 描述 类型
code 公共错误码。0 表示成功,其他值表示失败 Int
codeDesc 业务侧错误码。成功时返回 Success,错误时返回具体业务错误原因 String
message 模块错误信息描述,与接口相关 String

4. 示例

输入

  https://domain/v2/index.php?Action=AddUpdateServiceTrigger
  &triggerName=trigger_test
  &reponame=test/kube_test
  &invokeMethod=taglist
  &invokeExpr=v1;v2
  &serviceName=nginx-test
  &clusterId=cls-xxxxxx
  &namespace=default
  &containerName=nginx-test
  &clusterRegion=1
  &其它公共参数

输出

{
    "code": 0,
    "message": "", 
    "codeDesc": "Success"
}