Help Center/ CodeArts Pipeline/ API Reference/ API/ Pipeline Management/ Querying a Code Repository Branch
Updated on 2025-12-04 GMT+08:00

Querying a Code Repository Branch

Function

This API is used to query branches of a code repository based on filter criteria.

Calling Method

For details, see Calling APIs.

URI

GET /v2/{cloud_project_id}/code/branches

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

cloud_project_id

Yes

String

Definition:

32-character UUID of a CodeArts project, which must be unique.

Constraints:

N/A

Value range:

The value contains 32 characters.

Default value:

N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

repoUrl

Yes

String

Definition:

Code repository URL, which can be obtained from the code repository configured in the pipeline.

Constraints:

N/A

Range:

N/A

Default value:

N/A

authEndpoint

No

String

Definition:

Authentication endpoint.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

repoId

No

String

Definition:

Repository ID, which can be obtained from the code repository configured in the pipeline.

Constraints:

N/A

Range:

N/A

Default value:

N/A

pipelineId

No

String

Definition:

Pipeline ID. Obtain the ID by calling the API for querying pipelines. pipelines.pipelineId indicates the pipeline ID.

Constraints:

N/A

Value range:

The value consists of 32 characters, including only digits and letters.

Default value:

N/A

search

No

String

Definition:

Keyword used for the query.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

[items]

Array of strings

Definition:

Branch name list.

Range:

N/A

Example Requests

GET https://{endpoint}/v2/532f1abd15fe42ce8fbc66e89a469b3e/code/branches?repoUrl=https%3A%2F%2Fcodehub.devcloud.cn-north-7.ulanqab.huawei.com%2F532f1abd15fe42ce8fbc66e89a469b3e%2Ftujian_test.git&authEndpoint=&limit=30&offset=0&search=&repoId=2111929952&_=1763890872862

Example Responses

Status code: 200

OK

[ {
  "name" : "asdfsadfasf"
}, {
  "name" : "codearts-pipeline"
}, {
  "name" : "dfgsdf"
}, {
  "name" : "test"
}, {
  "name" : "master"
}, {
  "name" : "tesat"
}, {
  "name" : "test_code_check"
} ]

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.