Querying Tasks
Function
This API is used to query tasks of a project based on project_id.
Calling Method
For details, see Calling APIs.
URI
GET /v2/{project_id}/tasks
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Definition Unique 32-character UUID of a project. Obtain a UUID by calling the API forquerying projects. Constraints N/A Range 32-character project ID. Default Value N/A |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
offset |
No |
Integer |
Definition Page number. It is similar to page_num. Constraints N/A Range 0–999,999 |
limit |
No |
Integer |
Definition Number of records on each page. It is similar to page_size. Constraints N/A Range 1–100 |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
Definition User token. Obtain a token by calling the IAM API forobtaining a user token. The value of X-Subject-Token in the response header is the user token. Constraints N/A Range 1–100,000 characters Default Value N/A |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
tasks |
Array of SimpleTaskInfoV2 objects |
Definition Task information. Range N/A |
total |
Integer |
Definition Total number of tasks in a project. Range N/A |
Parameter |
Type |
Description |
---|---|---|
task_id |
String |
Definition ID of the default branch task of a task. Range N/A |
task_name |
String |
Definition Task name. Range N/A |
creator_id |
String |
Definition User ID of the task creator. Range N/A |
git_url |
String |
Definition Code repository address. Range N/A |
git_branch |
String |
Definition Default branch of the task, not the default branch of a repository. Range N/A |
created_at |
String |
Definition Task creation time. Range UTC time. |
last_check_time |
String |
Definition The time when all branch and incremental tasks of a task were last checked. Range UTC time. |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 401
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Example Requests
GET https://{endpoint}/v2/{task_id}/tasks
Example Responses
Status code: 200
Request succeeded!
{ "tasks" : [ { "task_id" : "435b58e********d01c94a6", "task_name" : "CSharp_02201119", "creator_id" : "ecadebb5041***9780f3d905e20", "git_url" : "git@********_02201119.git", "git_branch" : "master", "created_at" : "2020-02-20 11:21:11", "last_check_time" : "2020-02-20 11:37:46" }, { "task_id" : "435b58343tg5g36907c1384d01c94a6", "task_name" : "CSharp_066", "creator_id" : "ecadebb3664*****", "git_url" : "git@****_02201119.git", "git_branch" : "master", "created_at" : "2020-02-20 11:21:11", "last_check_time" : "2020-02-20 11:37:46" } ], "total" : 2 }
Status code: 400
Bad Request
{ "error_code" : "CC.00000000", "error_msg" : "Network busy. Try again later." }
Status code: 401
Unauthorized
{ "error_code" : "CC.00000003", "error_msg" : "Authentication information expired." }
Status Codes
Status Code |
Description |
---|---|
200 |
Request succeeded! |
400 |
Bad Request |
401 |
Unauthorized |
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