CreateChangeRequest - Create change request
Applicable version | Centralized edition, Region edition |
Service endpoint and authorization
- Get a service endpoint: Replace
{domain}in the API request syntax. - Get a personal access token.
- Get the organization ID: Required only for the Centralized Edition. Go to the Organization Management console and find the ID on the Basic Information page.
Product | Resource | Required permission |
Application Delivery | change request | Read and write |
Request syntax
Centralized edition
POST https://{domain}/oapi/v1/appstack/organizations/{organizationId}/apps/{appName}/changeRequests
Region edition
POST https://{domain}/oapi/v1/appstack/apps/{appName}/changeRequests
Request headers
Parameter | Type | Required | Description | Example |
x-yunxiao-token | string | Yes | Your personal access token. | pt-0fh3****0fbG_35af****0484 |
Request parameters
Parameter | Type | Location | Required | Description | Example |
appName | string | path | Yes | The application name. | my-web-service |
organizationId | string | path |
| The organization ID. | ec766e63aee3437d9a51f334d6exe671 |
| - | object | body | No | The request body for creating a change request. | |
| appCodeRepoSn | string | body | Yes | The unique identifier of the application's code repository. | app-code-repo-sn-xxxx |
| autoDeleteBranchWhenEnd | boolean | body | Yes | Specifies whether to automatically delete the branch when the change request is complete. | false |
| branchName | string | body | Yes | The name of the code branch. | master |
| createBranch | boolean | body | Yes | Specifies whether to create a new branch. | false |
| ownerAccountId | string | body | No | The Alibaba Cloud account ID of the owner. | 10df6011-2837-4fdb-ad92-356a679a60ca |
| ownerId | string | body | No | The ID of the owner. | 10df6011-2837-4fdb-ad92-356a679a60ca |
| title | string | body | Yes | The title of the change request. | title-xxxx |
| workItems | array[string] | body | No | A list of associated work item identifiers. | ["e8700c743a17b9def1f96e47ee"] |
Request examples
Centralized edition
curl -X 'POST' \
'https://{domain}/oapi/v1/appstack/organizations/ec766e63aee3437d9a51f334d6exe671/apps/my-web-service/changeRequests' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
--data '
{
"appCodeRepoSn": "app-code-repo-sn-xxxx",
"autoDeleteBranchWhenEnd": false,
"branchName": "master",
"createBranch": false,
"ownerAccountId": "10df6011-2837-4fdb-ad92-356a679a60ca",
"ownerId": "10df6011-2837-4fdb-ad92-356a679a60ca",
"title": "title-xxxx",
"workItems": ["e8700c743a17b9def1f96e47ee"]
}'
Region edition
curl -X 'POST' \
'https://{domain}/oapi/v1/appstack/apps/my-web-service/changeRequests' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
--data '
{
"appCodeRepoSn": "app-code-repo-sn-xxxx",
"autoDeleteBranchWhenEnd": false,
"branchName": "master",
"createBranch": false,
"ownerAccountId": "10df6011-2837-4fdb-ad92-356a679a60ca",
"ownerId": "10df6011-2837-4fdb-ad92-356a679a60ca",
"title": "title-xxxx",
"workItems": ["e8700c743a17b9def1f96e47ee"]
}'
Response parameters
Parameter | Type | Description | Example |
| - | object | Details of the change request. | |
| appCodeRepoSn | string | The unique identifier of the application's code repository. | my-web-app-repo |
| appName | string | The application name. | my-web-service |
| autoDeleteBranchWhenEnd | boolean | Indicates whether the branch is automatically deleted when the change request is complete. | true |
| branch | string | The code branch for the change request. | master |
| creatorAccountId | string | The primary key (PK) of the creator's Alibaba Cloud account. | 10df6011-2837-4fdb-ad92-356a679a60ca |
| creatorId | string | The Alibaba Cloud DevOps ID of the creator. | 10df6011-2837-4fdb-ad92-356a679a60ca |
| gmtCreate | string | The time the change request was created. | 2024-09-01 00:00:00 |
| gmtModified | string | The time the change request was last modified. | 2024-09-01 00:00:00 |
| name | string | The name of the change request. | my-cr |
| originBranch | string | The source branch. | master |
| originBranchRevisionSha | string | The revision SHA of the source branch. | c229f22024535638af41838daa43af1e6d468116 |
| ownerAccountId | string | The primary key (PK) of the owner's Alibaba Cloud account. | 10df6011-2837-4fdb-ad92-356a679a60ca |
| ownerId | string | The ID of the owner. | 10df6011-2837-4fdb-ad92-356a679a60ca |
| sn | string | The unique identifier of the change request. | cde06968-68e6-4122-a769-abda138d7c62 |
| state | string | The state of the change request. | INIT |
| type | string | The type of the change request. | APP |
Response example
{
"appCodeRepoSn": "my-web-app-repo",
"appName": "my-web-service",
"autoDeleteBranchWhenEnd": true,
"branch": "master",
"creatorAccountId": "10df6011-2837-4fdb-ad92-356a679a60ca",
"creatorId": "10df6011-2837-4fdb-ad92-356a679a60ca",
"gmtCreate": "2024-09-01 00:00:00",
"gmtModified": "2024-09-01 00:00:00",
"name": "my-cr",
"originBranch": "master",
"originBranchRevisionSha": "c229f22024535638af41838daa43af1e6d468116",
"ownerAccountId": "10df6011-2837-4fdb-ad92-356a679a60ca",
"ownerId": "10df6011-2837-4fdb-ad92-356a679a60ca",
"sn": "cde06968-68e6-4122-a769-abda138d7c62",
"state": "INIT",
"type": "APP"
}
Error codes
For a list of API error codes, see the Error Code Center.