Help Center> CodeArts Repo> API Reference> APIs> V2Project> Querying All Warehouses of a User
Updated on 2023-12-04 GMT+08:00

Querying All Warehouses of a User

Function

Obtains all warehouse information of a user.

URI

GET /v2/projects/repositories

Table 1 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 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Specifies the user token.

It can be obtained by calling the IAM API (value of X-Subject-Token in the response header).

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

error

Error object

Response error.

result

RepoListInfoV2 object

Result

status

String

Status code in a response

Table 4 Error

Parameter

Type

Description

code

String

Error Codes

message

String

Error message

Table 5 RepoListInfoV2

Parameter

Type

Description

repositories

Array of RepoInfoV2 objects

Repository list

total

Integer

Total number of repositories.

Table 6 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/repositories

Example Responses

Status code: 200

OK

{
  "result" : {
    "total" : 29,
    "repositories" : {
      "repository_uuid" : "0bf1e7ceb5b341318cb72b42901abe54",
      "repository_id" : 468564,
      "repository_name" : "test",
      "ssh_url" : "git@repo.alpha.devcloud.inhuawei.com:test_new00001/test.git",
      "https_url" : "https://repo.alpha.devcloud.inhuawei.com/test_new00001/test.git",
      "group_name" : "test_new00001",
      "web_url" : "https://alpha.devcloud.inhuawei.com/repo/468564/home",
      "visibility_level" : 0,
      "created_at" : "2019-10-15 11:00:11",
      "updated_at" : "2019-10-15 11:00:11",
      "repository_size" : "0.05M",
      "lfs_size" : "0.00M",
      "creator_name" : "repo",
      "domain_name" : "repo",
      "star" : true,
      "status" : 0,
      "is_owner" : 1,
      "iam_user_uuid" : "a618e34bd5704be3ae3395dfede06041",
      "project_uuid" : "dc19b3ca6f334ce894a1ec467689797d",
      "project_is_deleted" : "false",
      "userRole" : null
    }
  },
  "status" : "success"
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.