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
Test
RAM authorization
|
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 |
| 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 |
| 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 |
| 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:
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 |
| 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.