Enables or disables the automatic primary/secondary switchover function of an ApsaraDB for RDS instance.
After a primary/secondary switchover, the primary instance is demoted to secondary while the secondary instance is promoted to primary. For more information, see Manually or automatically switch over services between the RDS MySQL master and slave instances.
Before you call this operation, make sure that the instance runs MySQL in the High-availability Edition.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | ModifyHASwitchConfig |
The operation that you want to perform. Set the value to ModifyHASwitchConfig. |
DBInstanceId | String | Yes | rm-uf6wjk5xxxxxxxxxx |
The ID of the instance. |
RegionId | String | Yes | cn-hangzhou |
The ID of the region to which the instance belongs. You can call the DescribeRegions operation to query the most recent region list. |
HAConfig | String | No | Manual |
The primary/secondary switchover mode of the instance. Valid values:
Default value: Auto. Note If you set this parameter to Manual, you must specify the ManualHATime parameter.
|
ManualHATime | String | No | 2019-08-29T15:00:00Z |
The time after when you want to enable automatic primary/secondary switchover. At most, you can set this parameter to 23:59:59 seven days later. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. Note This parameter only takes effect when the HAConfig parameter is set to Manual.
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | B6AE1448-D846-4831-B1C7-CFF3E99D5470 |
The ID of the request. |
Examples
Sample requests
http(s)://rds.aliyuncs.com/? Action=ModifyHASwitchConfig
&RegionId=cn-hangzhou
&DBInstanceId=rm-uf6wjk5xxxxxxxxxx
&HAConfig=Manual
&ManualHATime=2019-08-28T15:00:00
&<Common request parameters>
Sample success responses
XML
format
<ModifyHASwitchConfigResponse>
<RequestId>B6AE1448-D846-4831-B1C7-CFF3E99D5470</RequestId>
</ModifyHASwitchConfigResponse>
JSON
format
{
"RequestId": "B6AE1448-D846-4831-B1C7-CFF3E99D5470"
}
Error codes
For a list of error codes, visit the API Error Center.