Executing a Check Task
Function
This API is used to execute a check task.
Calling Method
For details, see Calling APIs.
URI
POST /v2/tasks/{task_id}/run
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
task_id |
Yes |
String |
Definition Task ID, returned by the API for creating a check task. Each CodeArts Check task, branch task, or incremental task generated through an API has a unique ID. Constraints N/A Range N/A Default Value N/A |
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 |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
username |
No |
String |
This parameter is deprecated. |
access_token |
No |
String |
This parameter is deprecated. |
git_url |
No |
String |
This parameter is deprecated. |
git_branch |
No |
String |
This parameter is deprecated. |
ref |
No |
String |
Definition The method of pulling MR code from a repository. Set this parameter if MR code fails to be pulled in the check stage. Constraints N/A Range
Default Value If this parameter is not passed, the backend automatically identifies the repository type, pulling MR code from a Gitee repository using pull/xx/xx or from a non-Gitee repository using merge_request/xx/xx. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
exec_id |
String |
Definition Execution record ID of a check task. Range 32-character UUID. |
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
Execute a check task. Pass the ref parameter if you want to specify the incremental code downloading mode.
POST https://{endpoint}/v2/tasks/{task_id}/run { "ref" : "merge_request" }
Example Responses
Status code: 200
Request succeeded!
{ "exec_id" : "d163535d0*******81d6a7654443e" }
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