文档首页> 容器镜像服务 SWR> API参考> API> 触发器管理> 获取镜像仓库下的触发器列表
更新时间:2023-11-30 GMT+08:00
分享

获取镜像仓库下的触发器列表

功能介绍

获取镜像仓库下的触发器列表

接口约束

调用方法

请参见如何调用API

URI

GET /v2/manage/namespaces/{namespace}/repos/{repository}/triggers

表1 路径参数

参数

是否必选

参数类型

描述

namespace

String

组织名称。小写字母开头,后面跟小写字母、数字、小数点、下划线或中划线(其中下划线最多允许连续两个,小数点、下划线、中划线不能直接相连),小写字母或数字结尾,1-64个字符。

repository

String

镜像仓库名称

请求参数

表2 请求Header参数

参数

是否必选

参数类型

描述

Content-Type

String

消息体的类型(格式),下方类型可任选其一使用: application/json;charset=utf-8 application/json

缺省值:application/json

X-Auth-Token

String

用户Token。

通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。

响应参数

状态码: 200

表3 响应Body参数

参数

参数类型

描述

[数组元素]

Array of Trigger objects

触发器列表

表4 Trigger

参数

参数类型

描述

action

String

触发动作,update

app_type

String

应用类型,deployments、statefulsets

application

String

应用名

cluster_id

String

集群ID(cci时为空)

cluster_name

String

集群名(cci时为空)

cluster_ns

String

应用名所在的namespace

condition

String

触发条件,type为all时为.*,type为tag时为tag名,type为regular时为正则表达式

container

String

需更新的container名,默认为所有container

created_at

String

创建时间

creator_name

String

创建人

enable

String

是否生效

name

String

触发器名

trigger_history

Array of TriggerHistories objects

触发器历史

trigger_mode

String

触发器类型,cce、cci

trigger_type

String

触发条件,all、tag、regular

表5 TriggerHistories

参数

参数类型

描述

action

String

触发动作,update

app_type

String

应用类型,deployments、statefulsets

application

String

应用名

cluster_id

String

集群ID(cci时为空)

cluster_name

String

集群名(cci时为空)

cluster_ns

String

应用名所在的namespace

condition

String

触发条件,type为all时为.*,type为tag时为tag名,type为regular时为正则表达式

container

String

需更新的container名,默认为所有container

created_at

String

创建时间

creator_name

String

创建人

detail

String

详情

result

String

更新结果,success、failed

tag

String

触发的版本号

请求示例

GET https://{endpoint}/v2/manage/namespaces/{namespace}/repos/{repository}/triggers

响应示例

状态码: 200

查询成功

[ {
  "action" : "update",
  "app_type" : "deployments",
  "application" : "abcde",
  "cluster_id" : "******************",
  "cluster_name" : "test123",
  "cluster_ns" : "default",
  "condition" : ".*",
  "container" : "",
  "created_at" : "2020-04-16T02:04:55.922236Z",
  "creator_name" : "************",
  "enable" : "true",
  "name" : "test1",
  "trigger_history" : null,
  "trigger_mode" : "cce",
  "trigger_type" : "all"
} ]

状态码

状态码

描述

200

查询成功

400

错误的请求

401

鉴权失败

404

组织或镜像仓库不存在

500

内部错误

错误码

请参见错误码

分享:

    相关文档

    相关产品