All Products
Search
Document Center

Database Autonomy Service:CreateCloudBenchTasks

Last Updated:Jul 29, 2025

You can call the CreateCloudBenchTasks operation to create a stress testing task.

Operation description

Database Autonomy Service (DAS) provides intelligent stress testing to help you verify whether your instance type needs to be scaled out to effectively handle service traffic peaks. For more information, see Intelligent stress testing. The database must meet the following prerequisites:

  • The source database only supports RDS MySQL High Availability Edition or RDS Enterprise Edition, and PolarDB MySQL cluster edition.

  • The target database instance is RDS MySQL or PolarDB MySQL.

  • The instance is connected to DAS. For more information, see Connect to Alibaba Cloud database instances.

  • DAS Enterprise Edition must be enabled. For more information, see DAS Enterprise Edition.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that support authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

hdm:CreateCloudBenchTasks

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

TaskType

string

Yes

The type of stress testing task. Valid values:

  • pressure test (default): Intelligent stress testing, which replays the traffic captured from the source instance on the target instance at the maximum speed supported by the target instance type.

  • smart pressure test: Generated stress testing, which analyzes and learns from the traffic captured from the source instance in a short period of time, generates traffic that is consistent with the business model and traffic distribution of the original traffic for continuous stress testing, reduces the time for collecting data from the source instance, and reduces storage costs and performance overhead.

pressure test

SrcInstanceId

string

Yes

The ID of the source instance. Only RDS MySQL and PolarDB MySQL instances are supported. You can call the GetInstanceInspections operation to obtain the ID.

Note

This parameter is required when DstType is set to Instance.

rm-2ze1jdv45i7l6****

Description

string

Yes

The description of the stress testing task.

test-das-bench-0501

SrcPublicIp

string

No

Reserved parameter.

None

DstInstanceId

string

No

The ID of the target instance. Only RDS MySQL and PolarDB MySQL instances are supported. You can call the GetInstanceInspections operation to obtain the ID.

Note

This parameter is required when DstType is set to Instance.

rm-2ze1jdv45i7l6****

GatewayVpcId

string

No

The virtual private cloud (VPC) ID of the Database Gateway.

Note

This parameter is required when ClientType is set to ECS.

vpc-t4nsnwvpbc1h76ja4****

GatewayVpcIp

string

No

The IP address or domain name of the Database Gateway.

Note

This parameter is required when ClientType is set to ECS.

172.30.XX.XX

ClientType

string

Yes

The type of stress testing machine. Valid values:

  • ECS: You need to prepare a Database Gateway yourself.

  • DAS_ECS: An ECS instance that is automatically purchased and deployed by DAS.

ECS

RequestStartTime

string

No

The start time of the stress testing task. The time is in the UNIX timestamp format. Unit: milliseconds.

1608888296000

RequestEndTime

string

No

The end time of the stress testing task. The time is in the UNIX timestamp format. Unit: milliseconds.

1608888296001

RequestDuration

string

No

The duration of the stress testing task. Unit: milliseconds.

86400000

Rate

string

No

The replay speed of the source instance traffic on the target instance. The replay speed must be a positive integer. Valid values: 1 to 30. Default value: 1.

1

SmartPressureTime

string

No

The duration of the generated stress testing. Unit: milliseconds.

Note

This parameter is required when TaskType is set to smart pressure test.

86400000

DtsJobClass

string

No

The specification of the DTS migration task. You can call the DescribeCloudbenchTask operation to obtain the specification.

Note

The stress testing task needs to migrate the baseline data from the source instance to the target instance. This parameter is required when you create a new DTS task.

medium

DtsJobId

string

No

The ID of the DTS migration task. You can call the ConfigureDtsJob operation to obtain the ID.

Note

This parameter is required when a DTS task has been created in the DTS console.

23127

SrcSuperAccount

string

No

The privileged account of the source instance. Value: admin.

Note

This parameter is required when DstType is set to Instance.

admin

SrcSuperPassword

string

No

The password of the privileged account of the source instance.

Note

This parameter is required when DstType is set to Instance.

test123

DstSuperAccount

string

No

The privileged account of the target instance.

root

DstSuperPassword

string

No

The password of the privileged account of the target instance.

test123

DstType

string

No

The type of the target instance. Valid values:

  • Instance (default): instance ID.

  • ConnectionString: connection address of the instance.

Instance

DstConnectionString

string

No

The connection address of the target instance. Only RDS MySQL and PolarDB MySQL instances are supported.

Note

This parameter takes effect when DstType is set to ConnectionString.

rm-de21209****.mysql.rds.aliyuncs.com

DstPort

string

No

The port of the target instance.

Note

This parameter takes effect when DstType is set to ConnectionString.

3306

WorkDir

string

No

The temporary directory generated by the stress testing.

/tmp/bench/

BackupId

string

No

The ID of the backup set. You can call the DescribeBackups operation to query the backup list and obtain the ID.

229132

BackupTime

string

No

The time of the backup. Format: yyyy-MM-ddTHH:mm:ssZ (UTC time).

2021-04-23T13:22:14Z

Amount

string

No

The total number of stress testing tasks to create. Valid values: 0 to 30. Default value: 1.

1

EndState

string

No

The status after the stress testing task ends. Valid values:

  • WAIT_TARGET: Prepare the target instance for stress testing.

  • WAIT_DBGATEWAY: Prepare the stress testing deployment.

  • WAIT_SQL: Prepare the full SQL statements.

  • WAIT_LOGIC: Prepare to start replaying the traffic.

Note

When the stress testing task completes the status set by EndState, the task directly reaches the completed status.

WAIT_TARGET

Response parameters

Parameter

Type

Description

Example

object

Code

string

The returned status code.

200

Message

string

The returned message.

Note

When the request is successful, Successful is returned. When the request fails, exception information such as an error code is returned.

Successful

RequestId

string

The request ID.

B6D17591-B48B-4D31-9CD6-9B9796B2****

Success

string

Indicates whether the request was successful:

  • true: The request was successful.

  • false: The request failed.

true

Data

object

taskIds

array

The list of details.

string

The list of details, including the total number of information items, error codes, and other information.

"Data": { "total": 1, "list":[...] }, "Code": 200, "Success": true }

Examples

Success response

JSON format

{
  "Code": "200",
  "Message": "Successful",
  "RequestId": "B6D17591-B48B-4D31-9CD6-9B9796B2****",
  "Success": "true",
  "Data": {
    "taskIds": [
      "\"Data\": { \"total\": 1, \"list\":[...] }, \"Code\": 200, \"Success\": true }"
    ]
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParams The request parameters are invalid.
403 NoPermission You are not authorized to do this action.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.