Updating the Status of a Task
Function
This API is used to update the status of a task.
URI
POST /v1/{project_id}/test-suites/{test_suite_id}/tasks/{task_id}
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details, see Obtaining a Project ID. Minimum: 0 Maximum: 64 |
test_suite_id |
Yes |
Integer |
Test project ID. Minimum: 0 Maximum: 2147483647 |
task_id |
Yes |
Integer |
Task ID. Minimum: 0 Maximum: 2147483647 |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
cluster_id |
Yes |
Integer |
Resource group ID. Minimum: -1 Maximum: 2147483647 |
cluster_type |
Yes |
String |
Resource group type (shared-cluster-internet: shared resource group; private-cluster: private resource group). Minimum: 0 Maximum: 1024 |
without_package |
Yes |
Integer |
Whether to use the pay-per-use billing mode when the VUM of the package is insufficient. The value is fixed at 0 in the current edition. Minimum: 0 Maximum: 2147483647 |
network_info |
Yes |
NetworkInfo object |
Network information. |
status |
Yes |
Integer |
Status (9: task started; 2: task stopped). Minimum: 0 Maximum: 2147483647 |
enterprise_project_id |
No |
String |
Enterprise project ID. Minimum: 0 Maximum: 64 |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
code |
String |
Response code. Minimum: 0 Maximum: 1024 |
message |
String |
Response message. Minimum: 0 Maximum: 1024 |
extend |
String |
Extension information. Minimum: 0 Maximum: 1024 |
result |
UpdateTaskStatusResult object |
Status update result. |
Example Requests
-
Starting a task whose ID is 1. The ID of the project to which the task belongs is 1. Use the shared resource group to start the task.
/v1/{project_id}/test-suites/1/tasks/1 { "cluster_id" : 0, "enterprise_project_id" : "0", "cluster_type" : "shared-cluster-internet", "without_package" : 0, "network_info" : { "network_type" : "internet" }, "status" : 9 }
-
Starting a task whose ID is 1. The ID of the project to which the task belongs is 1.
/v1/{project_id}/test-suites/1/tasks/1 { "cluster_id" : -1, "enterprise_project_id" : "0", "cluster_type" : "shared-cluster-internet", "network_info" : { "network_type" : "internet" }, "status" : 2, "without_package" : 0 }
Example Responses
Status code: 200
success
{ "code" : "SVCSTG.CPTS.0000000", "message" : "success", "extend" : null, "result" : { "task_run_id" : 32517 } }
Status Codes
Status Code |
Description |
---|---|
200 |
success |
501 |
unknown error |
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