创建集成
使用 tcb integration create 命令创建新的集成配置。
tcb integration create [options]
命令参数
| 参数 | 说明 | 必填 |
|---|---|---|
--name <name> | 集成名称 | 是 |
--auth-type <authType> | 认证类型,可选值:custom(自定义)、wechat(微信) | 是 |
--description <description> | 集成描述 | 否 |
--json | 以 JSON 格式输出结果 | 否 |
--yes | 跳过交互确认 | 否 |
使用示例
交互式创建
不指定参数时,CLI 会引导您输入必要信息:
tcb integration create
命令行创建
# 创建自定义认证类型的集成
tcb integration create --name my-integration --auth-type custom --description "我的集成"
# 创建微信认证类型的集成
tcb integration create --name wechat-integration --auth-type wechat
# 以 JSON 格式输出结果
tcb integration create --name my-integration --auth-type custom --json
自动化脚本
在 CI/CD 流程中,建议使用 --yes 参数跳过交互确认:
tcb integration create --name my-integration --auth-type custom --yes
输出示例
普通输出
✓ 创建集成成功
集成信息:
Key ID: key-721a6e232e169382d3cbc5faa3dc2cd6
名称: my-integration
认证类型: custom
描述: 我的集成
下一步:
使用 'tcb integration bind-resource --key-id key-721a6e232e169382d3cbc5faa3dc2cd6 --function <function-name>' 绑定云函数
JSON 输出
tcb integration create --name my-integration --auth-type custom --json
{
"KeyId": "key-721a6e232e169382d3cbc5faa3dc2cd6",
"Name": "my-integration",
"AuthTypeCode": "custom",
"Description": "",
"CreateTime": "2024-01-01T00:00:00Z"
}
注意事项
- 集成名称在同一环境下必须唯一
- 认证类型创建后不可修改
- 创建成功后会返回 Key ID,请妥善保存用于后续操作