All Products
Search
Document Center

ApsaraDB RDS:ModifyHASwitchConfig

Last Updated:May 29, 2023

You can call the ModifyHASwitchConfig operation to enable or disable the automatic primary/secondary switchover feature for an ApsaraDB RDS instance.

Operation Description

After a switchover is complete, the original primary RDS instance runs as the secondary RDS instance. For more information, see Switch workloads over between primary and secondary ApsaraDB RDS for MySQL instances.

Before you call this operation, make sure that the instance does not run the RDS Basic Edition.

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.
OperationAccess levelResource typeCondition keyAssociated operation
rds:ModifyHASwitchConfigWRITE
  • RDS
    acs:rds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}
  • rds:ResourceTag
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBInstanceIdstringYes

The ID of the instance.

rm-uf6wjk5xxxxxxxxxx
HAConfigstringNo

The status of the automatic primary/secondary switchover feature. Valid values:

  • Auto: The automatic primary/secondary switchover feature is enabled. The system automatically switches your workloads over from the instance to its secondary instance in the event of a fault.
  • Manual: The automatic primary/secondary switchover feature is disabled. You must manually switch your workloads over from the instance to its secondary instance in the event of a fault.

Default value: Auto.

NoteIf you set this parameter to Manual, you must specify the ManualHATime parameter.
Manual
ManualHATimestringNo

The time after which the automatic primary/secondary switchover feature is enabled. At most, you can set this parameter to 23:59:59 seven days later. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

NoteThis parameter takes effect only when you set the HAConfig parameter to Manual.
2019-08-29T15:00:00Z
RegionIdstringYes

The region ID of the instance. You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

B6AE1448-D846-4831-B1C7-CFF3E99D5470

Examples

Sample success responses

JSONformat

{
  "RequestId": "B6AE1448-D846-4831-B1C7-CFF3E99D5470"
}

Error codes

HTTP status codeError codeError messageDescription
400HaConfig.FormatThe value of HaConfig must be auto or manualThe value of the HASwitchConfig parameter must be Auto or Manual.
400HaConfigIsNullHaConfig is null.The value of the HASwitchConfig parameter is null.
400ManualHATime.FormatThe format of ManualHATime is yyyy-MM-dd'T'HH:mm:ss'Z'.-

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2022-09-01The error codes of the API operation change.
Change itemChange content
Error CodesThe error codes of the API operation change.
    Error Codes 400 change