CreateServiceConnection - Create a service connection
Create a service connection using OpenAPI.
|
Applicable editions |
Central edition, Region edition |
Endpoint and authorization information
-
Get the endpoint: Replace {domain} in the API request syntax.
-
Obtain organizationId: Required only for the Central edition. Go to the Basic Information page in the Organization Management console to retrieve your organization ID.
|
Product |
Resource |
Required permission |
|
Pipeline |
Service connection |
Read and write |
Request syntax
Central edition
POST https://{domain}/oapi/v1/flow/organizations/{organizationId}/createServiceConnection
Region edition
POST https://{domain}/oapi/v1/flow/createServiceConnection
Request headers
|
Parameter |
Type |
Required |
Description |
Example value |
|
x-yunxiao-token |
string |
Yes |
Personal access token. |
pt-0fh3****0fbG_35af****0484 |
Request parameters
|
Parameter |
Type |
Location |
Required |
Description |
Example value |
|
organizationId |
string |
path |
|
Organization ID. |
5ebbc0228123212b59xxxxx |
| - |
object |
body |
No |
||
|
authId |
integer |
body |
No |
Service authorization ID. |
111 |
|
authType |
string |
body |
No |
Service authorization type. |
CREDENTIAL (service certificate); AUTHENTICATION (service authorization) |
|
connectionName |
string |
body |
No |
Service connection name. |
ECS connection |
|
connectionType |
string |
body |
No |
Service connection type. |
ecs |
|
scope |
string |
body |
No |
Visibility scope of the service connection. |
PERSON (private); GLOBAL (public); CUSTOM (custom) |
Request examples
Central edition
curl -X 'POST' \
'https://{domain}/oapi/v1/flow/organizations/5ebbc0228123212b59xxxxx/createServiceConnection' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
--data '
{
"authId": 111,
"authType": "CREDENTIAL (service certificate); AUTHENTICATION (service authorization)",
"connectionName": "ECS connection",
"connectionType": "ecs",
"scope": "PERSON (private); GLOBAL (public); CUSTOM (custom)"
}'
Region edition
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 (service certificate); AUTHENTICATION (service authorization)",
"connectionName": "ECS connection",
"connectionType": "ecs",
"scope": "PERSON (private); GLOBAL (public); CUSTOM (custom)"
}'
Response parameters
|
Parameter |
Type |
Description |
Example value |
|
- |
integer |
Service connection ID. |
19224 |
Response example
19224
Error codes
For API error codes, see the Error Code Center.