Enables or disables the automatic primary/secondary switchover feature for an instance.
Operation description
Supported database engines
- MySQL
- PostgreSQL
- SQL Server
- MariaDB
References
- 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
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 |
---|---|---|---|---|
rds:ModifyHASwitchConfig | update |
|
| none |
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 |