Help Center/ CodeArts Repo/ API Reference/ APIs/ Project/ Obtaining Information About All Repositories in a Project

Obtaining Information About All Repositories in a Project

Updated on 2025-05-15 GMT+08:00

Function

This API is used to obtain the repository list. Fuzzy query is supported: If the project_id is not specified, fuzzy search by repository name or project name is supported. Otherwise, only fuzzy search by repository name is supported.

URI

GET /v1/projects/{project_uuid}/repositories

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_uuid

Yes

String

Project ID. For details, see Obtaining a Project ID.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

page_index

No

Integer

Page index, starting from 1.

page_size

No

Integer

Record number on each page.

search

No

String

Search keyword.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

error

Error object

Response error.

result

RepoListInfo object

Response result.

status

String

Response status.

Table 5 Error

Parameter

Type

Description

code

String

Error code.

message

String

Error message.

Table 6 RepoListInfo

Parameter

Type

Description

repositorys

Array of RepoInfo objects

Repository list.

total

Integer

Total number of repositories.

Table 7 RepoInfo

Parameter

Type

Description

createAt

String

Creation time.

groupName

String

Repository group name (the segment between the domain name and repository name in a clone address. Example: Demo00228 in git@repo.alpha.devcloud.inhuawei.com:Demo00228/testword.git).

httpUrl

String

HTTPS URL.

id

String

Repository UUID returned by the CreateRepository API.

Minimum length: 32

Maximum length: 32

name

String

Repository name.

Minimum length: 2

Maximum length: 128

projectId

String

Project ID. For details, see Obtaining a Project ID.

Minimum length: 32

Maximum length: 32

projectIsDelete

String

Whether the project is deleted.

repoId

String

Repository primary key ID.

Minimum length: 1

Maximum length: 40

sshUrl

String

SSH URL.

visibilityLevel

Integer

Visibility. 0: Private. 20: Public.

webUrl

String

Web URL access path.

Example Requests

GET https://{endpoint}/v1/projects/{project_uuid}/repositories

Example Responses

Status code: 200

OK

{
  "result" : {
    "total" : 1,
    "repositorys" : [ {
      "id" : "d0457f74cc5b43d989ded7248f71b4e5",
      "repoId" : "468480",
      "name" : "CreatRepository_2qD5i",
      "sshUrl" : "git@repo.alpha.devcloud.inhuawei.com:Demo00228/CreatRepository_2qD5i.git",
      "httpUrl" : "https://repo.alpha.devcloud.inhuawei.com/Demo00228/CreatRepository_2qD5i.git",
      "groupName" : "Demo00228",
      "webUrl" : "https://alpha.devcloud.inhuawei.com/repo/468480/home",
      "visibilityLevel" : 0,
      "createAt" : "2019-10-15 09:40:26",
      "projectId" : "4838955a48e2492bbe44b31bc4c272f6",
      "projectIsDelete" : "false"
    } ],
    "status" : "success"
  }
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback