Create a service connection using OpenAPI.
Endpoint and authorization information
-
Get the endpoint: Replace {domain} in the API request syntax.
|
Product |
Resource |
Required permission |
|
Pipeline |
Service connection |
Read and write |
Request syntax
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 |
| - |
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: such as PERSON, GLOBAL, CUSTOM. |
PERSON (private); GLOBAL (public); CUSTOM (custom) |
Request examples
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
Visit the Error Code Center to view API-related error codes.