Updated on 2026-02-09 GMT+08:00

Starting or Stopping Tasks

Function

This API is used to start or stop tasks.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    codeartsperftest:cpts:executePerfTestTask

    Write

    cpts *

    g:ResourceTag/<tag-key>

    -

    -

URI

POST /v1/{project_id}/test-suites/{test_suit_id}/tasks/batch-update-task-status

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

test_suit_id

Yes

Integer

Project ID.

project_id

Yes

String

Project ID. For details, see Method of obtaining instructions.

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

type

No

Integer

Type. (0: old edition task; 1: new edition task)

project_id

Yes

Integer

Project ID.

task_id_list

Yes

Array of integers

Task ID list.

cluster_id

Yes

Integer

Resource group ID.

cluster_type

Yes

String

Resource group type (shared-cluster-internet: shared resource group; private-cluster: private resource group).

without_package

No

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.

network_info

No

NetworkInfo object

Network information.

status

Yes

Integer

Status (9: task started; 2: task stopped).

enterprise_project_id

No

String

Enterprise project ID.

Table 3 NetworkInfo

Parameter

Mandatory

Type

Description

network_type

Yes

String

Network type (fixed value: internet).

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

code

String

Status code.

message

String

Response.

extend

Object

Extended field.

result

Array of result objects

Response object for starting or stopping tasks.

Table 5 result

Parameter

Type

Description

task_id

Integer

Task ID.

task_run_id

Integer

Report ID.

Example Requests

Starting tasks in batches and using the shared resource group. The task ID set can be 1 or 2.

/v1/{project_id}/test-suites/{test_suit_id}/tasks/batch-update-task-status

{
  "enterprise_project_id" : "0",
  "type" : 1,
  "status" : 9,
  "without_package" : 0,
  "project_id" : 1,
  "cluster_id" : 0,
  "cluster_type" : "shared-cluster-internet",
  "network_info" : {
    "network_type" : "internet"
  },
  "task_id_list" : [ 1, 2 ]
}

Example Responses

None

Status Codes

Status Code

Description

200

Response object for starting or stopping tasks.

Error Codes

See Error Codes.