通过 OpenAPI 删除指定代码库的指定分支。
|
适用版本 |
中心版、Region版 |
服务接入点与授权信息
|
产品 |
资源 |
所需权限 |
|
代码管理 |
分支 |
读写 |
请求语法
中心版
DELETE https://{domain}/oapi/v1/codeup/organizations/{organizationId}/repositories/{repositoryId}/branches/{branchName}
Region版
DELETE https://{domain}/oapi/v1/codeup/repositories/{repositoryId}/branches/{branchName}
请求头
|
参数 |
类型 |
是否必填 |
描述 |
示例值 |
|
x-yunxiao-token |
string |
是 |
个人访问令牌。 |
pt-0fh3****0fbG_35af****0484 |
请求参数
|
参数 |
类型 |
位置 |
是否必填 |
描述 |
示例值 |
|
organizationId |
string |
path |
|
组织 ID。 |
60d54f3daccf2bbd6659f3ad |
|
repositoryId |
string |
path |
是 |
代码库 ID 或者 URL-Encoder 编码的全路径。 |
2813489或者60de7a6852743a5162b5f957%2FDemoRepo |
|
branchName |
string |
path |
是 |
分支名称(若有特殊符号,可使用 URL-Encoder 进行编码处理)。 |
demo-branch 或者 feature%2Fdemo-branch |
请求示例
中心版
curl -X 'DELETE' \
'https://{domain}/oapi/v1/codeup/organizations/60d54f3daccf2bbd6659f3ad/repositories/2813489或者60de7a6852743a5162b5f957%2FDemoRepo/branches/demo-branch或者feature%2Fdemo-branch' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'
Region版
curl -X 'DELETE' \
'https://{domain}/oapi/v1/codeup/repositories/2813489或者60de7a6852743a5162b5f957%2FDemoRepo/branches/demo-branch或者feature%2Fdemo-branch' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'
返回参数
|
参数 |
类型 |
描述 |
示例值 |
| - |
object |
||
|
branchName |
string |
被删除的分支名称。 |
返回示例
{
"branchName": ""
}
错误码
访问错误码中心查看 API 相关错误码。
该文章对您有帮助吗?