适用版本 | 中心版、Region版 |
服务接入点与授权信息
产品 | 资源 | 所需权限 |
应用交付 | 变更 | 读写 |
请求语法
中心版
POST https://{domain}/oapi/v1/appstack/organizations/{organizationId}/apps/{appName}/changeRequests
Region版
POST https://{domain}/oapi/v1/appstack/apps/{appName}/changeRequests
请求头
参数 | 类型 | 是否必填 | 描述 | 示例值 |
x-yunxiao-token | string | 是 | 个人访问令牌。 | pt-0fh3****0fbG_35af****0484 |
请求参数
参数 | 类型 | 位置 | 是否必填 | 描述 | 示例值 |
appName | string | path | 是 | 应用名。 | my-web-service |
organizationId | string | path |
| 组织 ID。 | ec766e63aee3437d9a51f334d6exe671 |
| - | object | body | 否 | 创建变更请求。 | |
| appCodeRepoSn | string | body | 是 | 应用代码仓库标识符。 | app-code-repo-sn-xxxx |
| autoDeleteBranchWhenEnd | boolean | body | 是 | 变更结束时候是否自动删除分支。 | false |
| branchName | string | body | 是 | 应用代码分支名称。 | master |
| createBranch | boolean | body | 是 | 是否创建分支。 | false |
| ownerAccountId | string | body | 否 | 变更负责人账号。 | 10df6011-2837-4fdb-ad92-356a679a60ca |
| ownerId | string | body | 否 | 变更负责人。 | 10df6011-2837-4fdb-ad92-356a679a60ca |
| title | string | body | 是 | 变更标题。 | title-xxxx |
| workItems | array[string] | body | 否 | 关联工作项标识列表。 | ["e8700c743a17b9def1f96e47ee"] |
请求示例
中心版
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版
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"]
}'
返回参数
参数 | 类型 | 描述 | 示例值 |
| - | object | 变更信息。 | |
| appCodeRepoSn | string | 代码仓库唯一标识。 | my-web-app-repo |
| appName | string | 应用名。 | my-web-service |
| autoDeleteBranchWhenEnd | boolean | 结束后是否自动删除分支。 | true |
| branch | string | 变更代码分支。 | master |
| creatorAccountId | string | 创建者的阿里云账号 pk。 | 10df6011-2837-4fdb-ad92-356a679a60ca |
| creatorId | string | 创建者者云效 id。 | 10df6011-2837-4fdb-ad92-356a679a60ca |
| gmtCreate | string | 创建时间。 | 2024-09-01 00:00:00 |
| gmtModified | string | 修改时间。 | 2024-09-01 00:00:00 |
| name | string | 变更名称。 | my-cr |
| originBranch | string | 代码分支源分支。 | master |
| originBranchRevisionSha | string | 代码分支源分支版本。 | c229f22024535638af41838daa43af1e6d468116 |
| ownerAccountId | string | 拥有者的阿里云账号 pk。 | 10df6011-2837-4fdb-ad92-356a679a60ca |
| ownerId | string | 拥有者 ID。 | 10df6011-2837-4fdb-ad92-356a679a60ca |
| sn | string | 唯一标识符。 | cde06968-68e6-4122-a769-abda138d7c62 |
| state | string | 状态。 | INIT |
| type | string | 变更类型。 | APP |
返回示例
{
"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"
}
错误码
访问错误码中心查看 API 相关错误码。