Help Center/ CodeArts Repo/ API Reference/ APIs/ Repository/ Querying Details About a Repository
Updated on 2025-03-28 GMT+08:00

Querying Details About a Repository

Function

This API is used to obtain details about a repository by UUID (returned by the CreateRepository API). The returned information contains the ID, name, repo group name, and repository access URL.

URI

GET /v2/repositories/{repository_uuid}

Table 1 Path parameters

Parameter

Mandatory

Type

Description

repository_uuid

Yes

String

Explanation:

Repository UUID.

Constraints:

Mandatory

Range:

32 characters.

Default value:

None

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Explanation:

User token. It can be obtained by calling the corresponding IAM API. The value of X-Subject-Token in the response header is the user token.

Constraints:

Mandatory

Range:

1–100,000 characters.

Default value:

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

error

Error object

Explanation:

Response error.

result

RepoInfoV2 object

Explanation:

Response result.

status

String

Explanation:

Response status.

Range:

  • success
  • fail
Table 4 Error

Parameter

Type

Description

code

String

Explanation:

Error code.

Range:

See Error Codes.

message

String

Explanation:

Error message.

Range:

Character string

Table 5 RepoInfoV2

Parameter

Type

Description

created_at

String

Explanation:

Creation time.

Range:

Character string

creator_name

String

Explanation:

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

Range:

Character string

domain_name

String

Explanation:

Tenant name of the creator.

Range:

Character string

group_name

String

Explanation:

Repository group name (the segment between the domain name and repository name in a clone address. Example: Demo00228 in [email protected]:Demo00228/testword.git).

Range:

Character string

https_url

String

Explanation:

URL for cloning repositories using HTTPS.

Range:

Character string

iam_user_uuid

String

Explanation:

IAM user UUID.

Range:

Character string

is_owner

Integer

Explanation:

Whether the current user is the repository creator.

Range:

  • 1: Yes
  • 0: No

lfs_size

String

Explanation:

Repository LFS capacity in MB. If the capacity is greater than 1,024 MB, the unit is GB.

Range:

Character string

project_is_deleted

String

Explanation:

Whether the project is deleted.

Range:

Character string

project_uuid

String

Explanation:

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

Range:

Character string

repository_id

Integer

Explanation:

Repository primary key ID.

Range:

1-2,147,483,647

repository_name

String

Explanation:

Repository name.

Range:

Character string

repository_size

String

Explanation:

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

Range:

Character string

repository_uuid

String

Explanation:

Repository UUID returned by the CreateRepository API.

Range:

Character string

ssh_url

String

Explanation:

URL for cloning repositories using SSH.

Range:

Character string

star

Boolean

Explanation:

Whether you have followed the repository.

Range:

  • true: Followed
  • false: Not followed

status

Integer

Explanation:

Repository status.

Range:

  • 0: The repository has been created.
  • 1: The repository is being created.
  • 2: The creation failed.
  • 3: The repository is frozen.
  • 4: The repository is closed.

updated_at

String

Explanation:

Update time.

Range:

Character string

userRole

Integer

Explanation:

Your permissions for the repository.

Range:

  • 20: Read-only member
  • 30: Common member
  • 40: Administrator

visibility_level

Integer

Explanation:

Visibility.

Range:

  • 0: Private repository
  • 20: Public repository

web_url

String

Explanation:

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

Range:

Character string

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" : "[email protected]: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.