Enables or disables the master/slave switchover function of an RDS instance.

After the switchover, the master instance becomes the slave instance. For more information, see Manually or automatically switch over services between the RDS for MySQL master and slave instances.

The RDS instance on which you call this API action must use the MySQL High-availability Edition.


Use OpenAPI Explorer to perform debug operations and generate SDK code examples.

Request parameters

ID Type Required Example value Description
Action String Yes ModifyHASwitchConfig

The name of this API action. Value: ModifyHASwitchConfig.

RegionId String Yes cn-hangzhou

The ID of the region to which the RDS instance belongs. You can call the DescribeRegions API action to obtain this region ID.

DBInstanceId String Yes rm-uf6wjk5xxxxxxxxxx

The ID of the RDS instance.

HAConfig String No Manual

The master/slave switchover settings. Values:

  • Auto: The system automatically switches services over from the master instance to the slave instance in the event of a fault.
  • Manual: The system temporarily disables the automatic switchover function.

Default value: Auto.

Note When you set this parameter to Auto, you must also set the ManualHATime parameter.
ManualHATime String No 2019-08-29T15:00:00Z

The time when the period during which the automatic switchover function is temporarily disabled elapses. You can set the time point to 23:59:59 in seven days at most. Format: yyyy-MM-ddTHH:mm:ssZ (UTC time).

Note This parameter is valid only when the HAConfig parameter is set to Manual.
AccessKeyId String No LTAIfCxxxxxxx

The AccessKey ID that Alibaba Cloud issues to a user for service access.

Response elements

ID Type Example value Description
RequestId String B6AE1448-D846-4831-B1C7-CFF3E99D5470

The ID of the request.


Request example:

http(s)://rds.aliyuncs.com/? Action=ModifyHASwitchConfig
&<Public request parameters>

Response example:

XML format:


JSON format:



For a list of error codes, visit the API Error Center.