文档

ListRepositoryBranches - 查询代码库分支列表

查询代码库分支列表。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

当前API暂无授权信息透出。

请求语法

GET /repository/{repositoryId}/branches

请求参数

名称类型必填描述示例值
organizationIdstring

企业标识,也称企业 id,字符串形式,可在云效访问链接中获取,如 https://devops.aliyun.com/organization/【OrganizationId】

60de7a6852743a5162b5f957
accessTokenstring

个人访问令牌。 使用阿里云 AK+SK 或使用 STS 临时授权方式不需要传该字段

f0b1e61db5961df5975a93f9129d2513
repositoryIdlong

代码库 ID

2709413
pagelong

页码,默认值为 1,从第 1 页开始。

1
pageSizelong

每页大小,默认值为 20,取值范围【1,100】

20
searchstring

搜索关键字

Demo
sortstring

排序方式,默认为 updated_desc

  • updated_desc:按更新时间降序排序
  • updated_asc:按更新时间升序排序
updated_desc

返回参数

名称类型描述示例值
object

Schema of Response

requestIdstring

请求 ID

1F4F342D-493A-5B2C-B133-BA78B30FF834
errorMessagestring

错误信息

""
errorCodestring

错误码

Openapi.RequestError
successboolean

调用是否成功

true
totallong

总记录数

100
resultobject []

返回结果列表

namestring

分支名称

testBranch
protectedstring

是否是保护分支

false
commitobject

分支最近一次提交信息

idstring

提交 ID

de02b625ba8488f92eb204bcb3773a40c1b4ddac
shortIdstring

简短的提交 ID

e0297d8f
titlestring

提交标题,提交的第一行内容

提交标题
authorNamestring

作者姓名

test-codeup
authorEmailstring

作者邮箱

username@example.com
createdAtstring

创建时间

2022-03-18 10:00:00
messagestring

提交内容

具体的提交内容
authoredDatestring

作者提交时间

2022-03-18 10:00:00
committedDatestring

提交人的提交时间

2022-03-18 11:00:00
committerEmailstring

提交人的邮箱

username@example.com
committerNamestring

提交人的姓名

commit-codeup
parentIdsarray

父提交 ID 列表

string

父提交 ID

de02b625ba8488f92eb204bcb3773a40c1b4ddac

示例

正常返回示例

JSON格式

{
  "requestId": "1F4F342D-493A-5B2C-B133-BA78B30FF834",
  "errorMessage": "\"\"",
  "errorCode": "Openapi.RequestError",
  "success": true,
  "total": 100,
  "result": [
    {
      "name": "testBranch",
      "protected": "false",
      "commit": {
        "id": "de02b625ba8488f92eb204bcb3773a40c1b4ddac",
        "shortId": "e0297d8f",
        "title": "提交标题",
        "authorName": "test-codeup",
        "authorEmail": "username@example.com",
        "createdAt": "2022-03-18 10:00:00",
        "message": "具体的提交内容",
        "authoredDate": "2022-03-18 10:00:00",
        "committedDate": "2022-03-18 11:00:00",
        "committerEmail": "username@example.com",
        "committerName": "commit-codeup",
        "parentIds": [
          "de02b625ba8488f92eb204bcb3773a40c1b4ddac"
        ]
      }
    }
  ]
}

错误码

HTTP status code错误码错误信息描述
403Forbidden.AccessDeniedThe user is not authorized to perform the operation.用户无权限执行相关操作
403Forbidden.UserNotInCurrentOrganizationThe user is not in the organization and is not authorized to perform the operation.当前用户不在该企业中,无权进行操作。

访问错误中心查看更多错误码。

变更历史

变更时间变更内容概要操作
2022-11-21OpenAPI 错误码发生变更、OpenAPI 返回结构发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    删除错误码:403
出参OpenAPI 返回结构发生变更
  • 本页导读 (0)
文档反馈