Creates stress testing tasks.
Operation description
Database Autonomy Service (DAS) provides the intelligent stress testing feature. This feature helps you check whether your instance needs to be scaled up to effectively handle traffic spikes. For more information, see Intelligent stress testing. Before you call this API operation, make sure that your database instances meet the following requirements:
- The source database instance is an ApsaraDB RDS for MySQL High-availability Edition or Enterprise Edition instance, or a PolarDB for MySQL Cluster Edition cluster.
- The destination database instance is an ApsaraDB RDS for MySQL instance or a PolarDB for MySQL cluster.
- The source and destination database instances are connected to DAS. For information about how to connect database instances to DAS, see Connect an Alibaba Cloud database instance to DAS.
- DAS Enterprise Edition is enabled for the source and destination database instances. For more information, see Overview .
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
hdm:CreateCloudBenchTasks | create | *All Resources * |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
TaskType | string | Yes | The type of the stress testing task. Valid values:
| pressure test |
SrcInstanceId | string | Yes | The ID of the source instance. The instance must be an ApsaraDB RDS for MySQL instance or a PolarDB for MySQL instance. You can call the GetInstanceInspections operation to query the ID. Note
This parameter must be specified if you set DstType to Instance.
| rm-2ze1jdv45i7l6**** |
Description | string | Yes | The description of the stress testing task. | test-das-bench-0501 |
SrcPublicIp | string | No | The reserved parameter. | None |
DstInstanceId | string | No | The ID of the destination instance. The instance must be an ApsaraDB RDS for MySQL instance or a PolarDB for MySQL instance. You can call the GetInstanceInspections operation to query the ID. Note
This parameter must be specified if you set DstType to Instance.
| rm-2ze1jdv45i7l6**** |
GatewayVpcId | string | No | The ID of the virtual private cloud (VPC) in which the database gateway (DBGateway) is deployed. Note
This parameter must be specified if you set ClientType to ECS.
| vpc-t4nsnwvpbc1h76ja4**** |
GatewayVpcIp | string | No | The IP address or domain name of the DBGateway. Note
This parameter must be specified if you set ClientType to ECS.
| 172.30.XX.XX |
ClientType | string | Yes | The type of the stress testing client. Valid values:
| ECS |
RequestStartTime | string | No | The time when the stress testing task starts. Set this parameter to a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. | 1608888296000 |
RequestEndTime | string | No | The time when the stress testing task ends. Set this parameter to a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. | 1608888296001 |
RequestDuration | string | No | The duration of the stress testing task for which the traffic is captured from the source instance. Unit: milliseconds. | 86400000 |
Rate | string | No | The rate at which the traffic captured from the source instance is replayed on the destination instance. The value must be a positive integer. Valid values: 1 to 30. Default value: 1. | 1 |
SmartPressureTime | string | No | The duration within which the traffic generation stressing test takes effect. Unit: milliseconds. Note
This parameter must be specified if you set TaskType to smart pressure test.
| 86400000 |
DtsJobClass | string | No | The specification of the Data Transmission Service (DTS) migration task. You can call the DescribeCloudbenchTask operation to query the specification. Note
You must migrate the basic data in the source instance to the destination instance before you start a stress testing task. When you create a DTS migration task, you must specify this parameter.
| medium |
DtsJobId | string | No | The ID of the DTS migration task. You can call the ConfigureDtsJob operation to query the ID. Note
After a DTS migration task is created in the DTS console, you must specify this parameter.
| 23127 |
SrcSuperAccount | string | No | The name of the privileged account for the source instance. Set the value to admin. Note
This parameter must be specified if you set DstType to Instance.
| admin |
SrcSuperPassword | string | No | The password of the privileged account for the source instance. Note
This parameter must be specified if you set DstType to Instance.
| test123 |
DstSuperAccount | string | No | The name of the privileged account for the destination instance. | root |
DstSuperPassword | string | No | The password of the privileged account for the destination instance. | test123 |
DstType | string | No | The type of the identifier that is used to indicate the destination instance. Valid values:
| Instance |
DstConnectionString | string | No | The endpoint of the destination instance. The specified endpoint must be the endpoint of an ApsaraDB RDS for MySQL instance or a PolarDB for MySQL instance. Note
This parameter takes effect only if you set DstType to ConnectionString.
| rm-de21209****.mysql.rds.aliyuncs.com |
DstPort | string | No | The port number of the instance that you want to access. Note
This parameter takes effect only if you set DstType to ConnectionString.
| 3306 |
WorkDir | string | No | The temporary directory generated for stress testing. | /tmp/bench/ |
BackupId | string | No | The ID of the backup set. You can call the DescribeBackups operation to query the ID of the backup set. | 229132 |
BackupTime | string | No | The time when the backup starts. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. | 2021-04-23T13:22:14Z |
Amount | string | No | The total number of stress testing tasks that you want to create. Valid values: 0 to 30. Default value: 1. | 1 |
EndState | string | No | The state that specifies the last operation that is performed for the stress testing task. Valid values:
Note
When the state of a stress testing task changes to the state that is specified by the EndState parameter, the stress testing task becomes completed.
| WAIT_TARGET |
Response parameters
Examples
Sample success responses
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 |
---|---|---|
400 | InvalidParams | The request parameters are invalid. |
403 | NoPermission | You are not authorized to do this action. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|