Help Center/ CodeArts Repo/ API Reference/ APIs/ Repository/ Querying the Details of a Warehouse
Updated on 2023-09-12 GMT+08:00

Querying the Details of a Warehouse

Function

This interface is used to obtain warehouse information based on the warehouse UUID (returned by the CreateRepository interface). The returned information contains the ID, name, group name, and repository access URL.

URI

GET /v2/repositories/{repository_uuid}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

repository_uuid

Yes

String

UUID of the repository.

Request Parameters

Table 2 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 3 Response body parameters

Parameter

Type

Description

error

Error object

Response error.

result

RepoInfoV2 object

Result

status

String

Response status.

Table 4 Error

Parameter

Type

Description

code

String

Error Codes

message

String

Error message

Table 5 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/repositories/{repository_uuid}

Example Responses

Status code: 200

OK

{
  "result" : {
    "repository_uuid" : "045ceabb9aea40579d5a759e84fa7f0a",
    "repository_id" : 468485,
    "repository_name" : "CreatRepository_MI9Af",
    "ssh_url" : "git@repo.alpha.devcloud.inhuawei.com:Demo00228/CreatRepository_MI9Af.git",
    "https_url" : "https://repo.alpha.devcloud.inhuawei.com/Demo00228/CreatRepository_MI9Af.git",
    "group_name" : "Demo00228",
    "web_url" : "https://alpha.devcloud.inhuawei.com/repo/468485/home",
    "visibility_level" : 0,
    "created_at" : "2019-10-15 09:40:27",
    "updated_at" : null,
    "repository_size" : null,
    "lfs_size" : null,
    "creator_name" : null,
    "domain_name" : null,
    "star" : null,
    "status" : null,
    "is_owner" : null,
    "iam_user_uuid" : null,
    "project_uuid" : "4838955a48e2492bbe44b31bc4c272f6",
    "project_is_deleted" : "false",
    "userRole" : null
  },
  "status" : "success"
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.