Switches services between a primary ApsaraDB for RDS instance and its secondary instance.
This operation switches services between the RDS primary and secondary instances that are not in the Basic Edition. After the switching, the secondary instance becomes primary and carries all business traffic.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | SwitchDBInstanceHA |
The operation that you want to perform. Set the value to SwitchDBInstanceHA. |
DBInstanceId | String | Yes | rm-uf6wjk5xxxxxxxxxx |
The ID of the primary instance. |
NodeId | String | Yes | 349054 |
The unique ID of the secondary instance. You can call DescribeDBInstanceHAConfig to query the secondary instance ID. |
Force | String | No | No |
Specifies whether to enable forcible switching. Valid values:
Default value: No. |
EffectiveTime | String | No | Immediate |
The time when the switching takes effect. Valid values:
Default value: Immediate. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 1E43AAE0-BEE8-43DA-860D-EAF2AA0724DC |
The ID of the request. |
Examples
Sample requests
http(s)://rds.aliyuncs.com/? Action=SwitchDBInstanceHA
&DBInstanceId=rm-uf6wjk5xxxxxxxxxx
&NodeId=349054
&<Common request parameters>
Sample success responses
XML
format
<SwitchDBInstanceHAResponse>
<RequestId>1E43AAE0-BEE8-43DA-860D-EAF2AA0724DC</RequestId>
</SwitchDBInstanceHAResponse>
JSON
format
{
"RequestId": "1E43AAE0-BEE8-43DA-860D-EAF2AA0724DC"
}
Error codes
For a list of error codes, visit the API Error Center.