Help Center/ CodeArts Repo/ API Reference/ APIs/ V2Project/ Querying All Warehouses in a Project
Updated on 2023-05-06 GMT+08:00

Querying All Warehouses in a Project

Function

This interface is used to obtain the repository list. Fuzzy query is supported. If the project UUID is not specified, fuzzy query by repository name or project name is supported. Otherwise, fuzzy query by repository name is supported.

URI

GET /v2/projects/{project_uuid}/repositories

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_uuid

Yes

String

Project UUID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

page_index

No

Integer

Pagination index, starting from 1.

page_size

No

Integer

Specifies the number of records on each page.

search

No

String

Keyword entered for search

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Specifies a user token.

It can be obtained by calling an IAM API. 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

RepoListInfoV2 object

Result

status

String

Status code in a response

Table 5 Error

Parameter

Type

Description

code

String

Error Codes

message

String

Error message

Table 6 RepoListInfoV2

Parameter

Type

Description

repositories

Array of RepoInfoV2 objects

Repository list

total

Integer

Total number of repositories.

Table 7 RepoInfoV2

Parameter

Type

Description

created_at

String

Created

creator_name

String

User name of the creator. If the user is a tenant, the user name is the same as the tenant name.

domain_name

String

Tenant name of the creator.

group_name

String

Repository group name (Example: git@repo.alpha.devcloud.inhuawei.com:Demo00228/testword.git Group name: Demo00228)

https_url

String

URL used when HTTPS is used to clone the repository.

iam_user_uuid

String

IAM user UUID of the user.

is_owner

Integer

Indicates whether the current user is the creator of the warehouse. 1: yes; 0: no

lfs_size

String

LFS capacity of the warehouse, in MB. If the capacity is greater than 1024 MB, the unit is GB.

project_is_deleted

String

Whether the project is deleted

project_uuid

String

Project UUID.

repository_id

Integer

Warehouse Primary Key ID

repository_name

String

Repository name

repository_size

String

Total repository capacity = Repository LFS capacity + Git repository capacity. The unit is MB. If the value is greater than 1024 MB, the unit is GB.

repository_uuid

String

Repository UUID, which is returned by the CreateRepository API.

ssh_url

String

URL used for cloning the repository in SSH mode.

star

Boolean

Indicates whether the current user adds the warehouse to favorites.

status

Integer

Warehouse status. 0: The warehouse is successfully created. 1: The repository is being created. 2: creation failed 3: The warehouse is frozen. 4: The warehouse has been closed.

updated_at

String

Update time.

userRole

Integer

User permission in the repository. The options are as follows: 20: read-only member 30: common member 40: administrator

visibility_level

Integer

Indicates whether the repository is visible. The options are 0 (private repository) and 20 (public repository).

web_url

String

Web URL. If you access the URL, the repository details page is displayed.

Example Requests

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

Example Responses

Status code: 200

OK

{
  "result" : {
    "total" : 14,
    "repositories" : {
      "repository_uuid" : "d0457f74cc5b43d989ded7248f71b4e5",
      "repository_id" : 468480,
      "repository_name" : "CreatRepository_2qD5i",
      "ssh_url" : "git@repo.alpha.devcloud.inhuawei.com:Demo00228/CreatRepository_2qD5i.git",
      "https_url" : "https://repo.alpha.devcloud.inhuawei.com/Demo00228/CreatRepository_2qD5i.git",
      "group_name" : "Demo00228",
      "web_url" : "https://alpha.devcloud.inhuawei.com/repo/468480/home",
      "visibility_level" : 0,
      "created_at" : "2019-10-15 09:40:26",
      "updated_at" : "2019-10-15 09:40:26",
      "repository_size" : "0.06M",
      "lfs_size" : "0.00M",
      "creator_name" : "repo",
      "domain_name" : "repo",
      "star" : false,
      "status" : 0,
      "is_owner" : 1,
      "iam_user_uuid" : "a618e34bd5704be3ae3395dfede06041",
      "project_uuid" : "4838955a48e2492bbe44b31bc4c272f6",
      "project_is_deleted" : "false",
      "userRole" : null
    }
  },
  "status" : "success"
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.