Obtaining the Code Repository List from CodeArts Repo
Function
This API is used to query CodeArts Repo repositories in a project with pagination based on the project ID and code repository name. Information such as the code repository address, repository name, and Repo ID is returned.
Calling Method
For details, see Calling APIs.
Authorization Information
Each account root user has all the permissions required to call all APIs, but IAM users must be assigned the following required identity policy-based permissions. For details about the required permissions, see Permissions Policies and Supported Actions.
| Action | Access Level | Resource Type (*: required) | Condition Key | Alias | Dependencies |
|---|---|---|---|---|---|
| codeartscheck:task:list | List | task * | - | - | - |
| - | codeartscheck:ProjectId |
URI
GET /v4/codehub/repo-list
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| page | No | Integer | Definition Page number, starting from 0. Constraints N/A Range 0–2147483647 Default Value 0 |
| page_size | No | Integer | Definition: Page size. Constraints: N/A Value range: 1–200 Default value: 100 |
| project_id | Yes | String | Definition 32-character project UUID. Obtain it by calling the API used to query the project list. Constraints: N/A Range 1 to 32 characters. Default Value N/A |
| search | No | String | Definition: Search for a code repository by name. Constraints: N/A Value range: N/A Default value: N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | Definition User token. Obtain one by calling the IAM API Obtaining a User Token. The value of X-Subject-Token in the response header is a token. Constraints N/A Range The length is the value of [1-100000]. Default Value N/A |
| Referer | No | String | Definition: Forwarding host information. Constraints: N/A Value range: N/A Default value: N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| total | Integer | Definition: Total number of records. Value range: ≥0 |
| data | Array of CodeHubRepoInfo objects | Definition: Response data. Range: N/A |
| Parameter | Type | Description |
|---|---|---|
| repoId | String | Definition: Code repository ID. Value range: N/A |
| repoName | String | Definition: Code repository name. Range: N/A |
| codeHubName | String | Definition: Repository address. Range: N/A |
| language | String | Definition: Code repository language type. Range: N/A |
| isLanguageSupported | Boolean | Definition: Whether the language type is supported. Value range: |
| developMode | String | Definition: Development mode. Range: N/A |
| taskList | Array of CodeHubTask objects | Definition: CodeArts Repo task list. Range: N/A |
| Parameter | Type | Description |
|---|---|---|
| id | String | Definition: Task ID. Value range: N/A |
| name | String | Definition: Task name. Range: N/A |
| branch | String | Definition: Branch name. Range: N/A |
| gitUrl | String | Definition: Repository address. Range: N/A |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition: Error code. Value range: N/A |
| error_msg | String | Definition: Error message. Value range: N/A |
Status code: 401
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition: Error code. Value range: N/A |
| error_msg | String | Definition: Error message. Value range: N/A |
Example Requests
This API is used to query the CodeArts Repo repository list.
GET https://{endpoint}/v4/codehub/repo-list?project_id=cebdbff4535f4c1f8c790d53xxxxxxxx&page=1&page_size=10&search=& Example Responses
Status code: 200
CodeHub repository information list.
{
"total" : 10,
"data" : [ {
"repoId" : "2112041445",
"repoName" : "test",
"codeHubName" : "git@codehub.devcloud.example.com/test.git",
"language" : "",
"isLanguageSupported" : false,
"developMode" : "normal",
"taskList" : [ {
"id" : "53f7055bedc44a3086bbc005xxxxxxxx",
"name" : "testxxxxx",
"branch" : "master",
"gitUrl" : "git@codehub.devcloud.example.com/test.git"
} ]
}, {
"repoId" : "2112041446",
"repoName" : "test2",
"codeHubName" : "git@codehub.devcloud.example.com/test2.git",
"language" : "",
"isLanguageSupported" : false,
"developMode" : "normal",
"taskList" : [ ]
} ]
} Status code: 400
A request error occurred.
{
"error_code" : "CC.xxxxxxxx.400",
"error_msg" : "Verify request parameter failed. Check whether the request parameters are correct."
} Status code: 401
The permission is insufficient.
{
"error_code" : "CC.00000003",
"error_msg" : "Authentication information expired."
} Status Codes
| Status Code | Description |
|---|---|
| 200 | CodeHub repository information list. |
| 400 | A request error occurred. |
| 401 | The permission is insufficient. |
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