Enables or disables the automatic primary/secondary switchover feature for an instance.
Operation description
Supported database engines
- MySQL
- PostgreSQL
- SQL Server
- MariaDB
References
Note
Before you call this operation, read the following documentation and make sure that you fully understand the prerequisites and impacts of this operation.
- Use the automatic primary/secondary switchover feature for an ApsaraDB RDS for MySQL instance
- Use the automatic primary/secondary switchover feature for an ApsaraDB RDS for PostgreSQL instance
- Use the automatic primary/secondary switchover feature for an ApsaraDB RDS for SQL Server instance
- Use the automatic primary/secondary switchover feature for an ApsaraDB RDS for MariaDB instance
Debugging
Authorization information
There is currently no authorization information disclosed in the API.
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
DBInstanceId | string | Yes | The instance ID. You can call the DescribeDBInstances operation to query the instance ID. | rm-uf6wjk5xxxxxxxxxx |
HAConfig | string | No | The mode of the automatic primary/secondary switchover feature. Valid values:
Default value: Auto. Note
If you set this parameter to Manual, you must specify the ManualHATime parameter.
| Manual |
ManualHATime | string | No | The time to disable the automatic primary/secondary switchover feature. The time can range from the current time 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 takes effect only when you set the HAConfig parameter to Manual.
| 2019-08-29T15:00:00Z |
RegionId | string | Yes | The region ID. You can call the DescribeRegions operation to query the most recent region list. | cn-hangzhou |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "B6AE1448-D846-4831-B1C7-CFF3E99D5470"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | HaConfig.Format | The value of HaConfig must be auto or manual | The value of the HASwitchConfig parameter must be Auto or Manual. |
400 | HaConfigIsNull | HaConfig is null. | The value of the HASwitchConfig parameter is null. |
400 | ManualHATime.Format | Invalid format of ManualHATime. | - |
400 | ManualHATimeIsNull | ManualHATime can not be null when the value of haConfig is Manual. | - |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-09-08 | The Error code has changed | View Change Details |
2022-09-01 | The Error code has changed | View Change Details |