全部產品
Search
文件中心

Alibaba Cloud DevOps:CreateServiceConnection - 建立服務串連

更新時間:Jul 07, 2026

通過 OpenAPI 建立服務串連。

服務存取點與授權資訊

產品

資源

要求的權限

流水線

服務串連

讀寫

請求文法

Region版

POST https://{domain}/oapi/v1/flow/createServiceConnection

要求標頭

參數

類型

是否必填

描述

樣本值

x-yunxiao-token

string

個人存取權杖。

pt-0fh3****0fbG_35af****0484

請求參數

參數

類型

位置

是否必填

描述

樣本值

-

object

body

authId

integer

body

服務授權 id。

111

authType

string

body

服務授與類型。

CREDENTIAL (服務憑證); AUTHENTICATION (服務授權)

connectionName

string

body

服務串連名稱。

ecs 串連

connectionType

string

body

服務連線類型。
中心版:ecs Elastic Compute Service; Gitee 碼雲; Github Github; docker_register_aliyun Container Registry(ACR); ack Container Service Kubernetes(ACK); Codeup 雲效 Codeup; oss Object Storage Service; edas 企業級分布式應用(EDAS); sae Serverless 應用引擎(SAE); ros Resource Orchestration Service服務(ROS); fc 阿里雲Function Compute(FC); emas 移動研發平台(EMAS); PACKAGES 雲效 Packages; customGitlab 自建 Gitlab; git 通用 Git; gitlab Gitlab; bitbucket Bitbucket; jenkins Jenkins; private_docker_registry 私人鏡像倉庫; ess Auto Scaling(ESS); atomGit AtomGit; svn SVN; gitlabAPI 自建 Gitlab(API V4及以上版本); vpc Virtual Private Cloud。
Region 版:ecs Elastic Compute Service; Github Github; docker_register_aliyun Container Registry(ACR); ack Container Service Kubernetes(ACK); Codeup 雲效 Codeup; oss Object Storage Service; sae Serverless 應用引擎(SAE); PACKAGES 雲效 Packages; customGitlab 自建 Gitlab; git 通用 Git; gitlab Gitlab; bitbucket Bitbucket; private_docker_registry 私人鏡像倉庫; gitlabAPI 自建 Gitlab(API V4及以上版本); vpc Virtual Private Cloud。




ecs

scope

string

body

可見範圍:如 PERSON,GLOBAL,CUSTOM。

PERSON (私人); GLOBAL (公開); CUSTOM (自訂)

請求樣本

Region版

curl -X 'POST' \
  'https://{domain}/oapi/v1/flow/createServiceConnection' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "authId": 111,
        "authType": "CREDENTIAL  (服務憑證); AUTHENTICATION  (服務授權)",
        "connectionName": "ecs串連",
        "connectionType": "ecs",
        "scope": "PERSON  (私人); GLOBAL   (公開); CUSTOM  (自訂)"
    }'

返回參數

參數

類型

描述

樣本值

-

integer

服務串連 id。

19224

返回樣本

19224

錯誤碼

訪問錯誤碼中心查看 API 相關錯誤碼。