Querying All Repositories in a Project
Function
This API is used to obtain the list of repositories that you have permissions on in a project.
If you do not specify a project ID, you can perform fuzzy search by repository name or project name.
If you specify a project ID, only fuzzy search by repository name is supported.
URI
GET /v2/projects/{project_uuid}/repositories
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_uuid |
Yes |
String |
Explanation: Project ID. For details, see Obtaining a Project ID. Constraints: None. Range 32 characters. Default value None. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
page_index |
No |
Integer |
Explanation: Page index, starting from 1. Constraints: None. Range 1–2147483647 Default value 1 |
|
page_size |
No |
Integer |
Explanation: Number of queried repositories displayed on each page. Constraints: None. Range 1–100 Default value 20 |
|
search |
No |
String |
Explanation: You can search for repositories by repository creator name or repository name. Constraints: None. Range Character string. Default value None. |
Request 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 None. Range String length: 1–100,000 characters. Default value None. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
error |
Error object |
Explanation: Response error code. |
|
result |
RepoListInfoV2 object |
Explanation: Response result. |
|
status |
String |
Explanation: Response status. Range
|
|
Parameter |
Type |
Description |
|---|---|---|
|
code |
String |
Explanation Error code. Range Max. 100 characters in the error code format. |
|
message |
String |
Explanation Error message. Range None. |
|
Parameter |
Type |
Description |
|---|---|---|
|
repositories |
Array of RepoInfoV2 objects |
Explanation: Repository list. |
|
total |
Integer |
Explanation: Total number of repositories. Range 1–2147483647 |
|
Parameter |
Type |
Description |
|---|---|---|
|
created_at |
String |
Explanation: Creation time. Range None |
|
creator_name |
String |
Explanation: Name of the creator. If you are a tenant, the username is 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 git@repo.example.com:Demo00228/testword.git Range Character string. |
|
https_url |
String |
Explanation: URL for cloning a repository 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
|
|
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 has been 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–2147483647 |
|
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: Repo UUID, which is returned by the CreateRepository API. Range Character string. |
|
ssh_url |
String |
Explanation: URL for cloning a repository in SSH mode. Range Character string. |
|
star |
Boolean |
Explanation: Whether you have followed the repository. Range
|
|
status |
Integer |
Explanation: Repository status. Range
|
|
updated_at |
String |
Explanation: Update time. Range None. |
|
userRole |
Integer |
Explanation: Your permissions for the repository. Range
|
|
visibility_level |
Integer |
Explanation: Visibility. Range
|
|
web_url |
String |
Explanation: Web URL, which redirects you to the repository details page. Range None. |
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.example.com:Demo00228/CreatRepository_2qD5i.git",
"https_url" : "https://repo.example.com/Demo00228/CreatRepository_2qD5i.git",
"group_name" : "Demo00228",
"web_url" : "https://repo.example.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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot