跳到主要内容

查询集成列表

使用 tcb integration list 命令查询当前环境下的所有集成配置。

tcb integration list [options]

命令参数

参数说明必填
-e, --env-id <envId>环境 ID(未指定时交互选择)
--name <name>按名称筛选(模糊查询)
--auth-type-code <code>按授权类型 code 筛选(如 customwechat
--limit <n>返回条数上限,默认 20
--offset <n>跳过条数,默认 0
--json以 JSON 格式输出结果

输出格式

表格格式(默认)

默认以表格形式展示,包含以下列:

说明
名称集成实例名称
标识集成实例 KeyID
集成类型授权类型名称(如"自定义认证")
绑定云函数关联的云函数名称,未绑定显示 -
更新时间最后更新时间(YYYY-MM-DD HH:mm
描述集成描述,未填写显示 -

JSON 格式(--json)

使用 --json 选项时,输出为 JSON 数组,每个元素包含以下字段:

字段类型说明
keyIdstring集成唯一标识(KeyID)
namestring集成名称
authTypeNamestring授权类型名称
authTypeCodestring授权类型 code
descriptionstring集成描述
boundFunctionstring绑定的云函数名称,未绑定为 null
updateTimestring更新时间(YYYY-MM-DD HH:mm

JSON 输出还包含元数据(通过 outputJson 的第二个参数):

{
"data": [ ... ],
"meta": {
"total": 42,
"limit": 20,
"offset": 0
}
}

使用示例

基本查询

# 查询前 20 条集成记录(默认)
tcb integration list

# 指定环境
tcb integration list -e env-abc123

# 查询前 50 条记录
tcb integration list --limit 50

# 跳过前 10 条,查询接下来的 20 条
tcb integration list --offset 10 --limit 20

筛选查询

# 按名称筛选
tcb integration list --name my-integration

# 按授权类型筛选
tcb integration list --auth-type-code custom

# 组合筛选
tcb integration list --name my-integration --auth-type-code custom

JSON 格式输出

# 以 JSON 格式输出所有集成
tcb integration list --json

# 筛选后以 JSON 格式输出
tcb integration list --name my-integration --json

JSON 输出示例:

{
"data": [
{
"keyId": "key-721a6e232e169382d3cbc5faa3dc2cd6",
"name": "my-integration",
"authTypeName": "自定义认证",
"authTypeCode": "custom",
"description": "我的集成",
"boundFunction": "my-function",
"updateTime": "2024-01-01 12:00"
}
],
"meta": {
"total": 1,
"limit": 20,
"offset": 0
}
}

空结果处理

当当前环境暂无集成实例时:

  • 表格模式:输出提示 当前环境暂无集成实例,请先在控制台创建集成
  • JSON 模式:输出空数组 []

分页查询

当集成数量较多时,可以使用 --limit--offset 参数进行分页查询:

# 第一页(1-20 条)
tcb integration list --limit 20 --offset 0

# 第二页(21-40 条)
tcb integration list --limit 20 --offset 20

# 第三页(41-60 条)
tcb integration list --limit 20 --offset 40

相关文档