Example 2: Querying Build Tasks by Project ID
Scenario
This section describes how to use an API to query build tasks by project ID.
For details about how to call APIs, see Calling APIs.
Constraints
The project already exists and build tasks have already been created in CodeArts Build.
Involved APIs
API for querying build tasks by user token and project ID.
Procedure
- Query the build tasks in a specified project.
- API information
URI: GET /v3/{project_id}/jobs
For details about the API, see Viewing the build task List of Users in a Project.
- Example request
GET https://cloudbuild-ext.ap-southeast-3.myhuaweicloud.com/v3/8391ec48637849f384dd3db5c8d61.../jobs?page_index=0&page_size=2
- Example response
{ "total": 35, "jobs": [{ "id": "d62d64d7782545c696ffaacc9ac9c69a", "job_name": "Build-Create_Images_and_Push_to_SWR", "job_creator": "b7066bfb50194e36b472a61f088bbf72", "user_name": "L0_codeci", "last_build_time": 1598438571000, "health_score": 100, "source_code": "codeci", "last_build_status": "blue", "is_finished": true, "disabled": false, "favorite": true, "is_modify": true, "is_delete": true, "is_execute": true, "is_copy": true, "is_forbidden": true, "is_view": true }, { "id": "4485de11a8e74ffdb9c9f85bafb85f83", "job_name": "Build-Use_SWR_Public_Images", "job_creator": "b7066bfb50194e36b472a61f088bbf72", "user_name": "L0_codeci", "last_build_time": 1598438567000, "health_score": 100, "source_code": "codeci", "last_build_status": "blue", "is_finished": true, "disabled": false, "favorite": true, "is_modify": true, "is_delete": true, "is_execute": true, "is_copy": true, "is_forbidden": true, "is_view": true }] }
- API information
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