Example 1: Executing a Build Task and Checking Its Status
Scenario
This section describes how to use APIs to execute a build task and check whether the task is running.
For details about how to call APIs, see Calling APIs.
Constraints
The build task to execute has already been created in CodeArts Build.
Involved APIs
Execute the build task using a user token and task ID, and then check the task status based on the task ID. The procedure is as follows:
Procedure
- Execute a build task.
- API information
For details about the API, see Execute the Build Task.
- Example request
POST https://cloudbuild-ext.ap-southeast-3.myhuaweicloud.com/v3/jobs/build
- Example request body
{ "job_id": "3341eaf0de6844669f07baa1ddfc9..." }
- Example response
{ "octopus_job_name": "j_WfRE6eOY", "actual_build_number": "55", "daily_build_number": "20200825.1" }
- API information
- Check whether the task is running.
- API information
URI: GET /v3/jobs/{job_id}/status
For details about the API, see Viewing the Running Status of a Task.
- Example request
GET https://cloudbuild-ext.ap-southeast-3.myhuaweicloud.com/v3/jobs/3341eaf0de6844669f07bdfc9.../status
- Example response
{ "result": false }
- 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