All Products
Search
Document Center

ApsaraDB RDS:ModifyHASwitchConfig

Last Updated:Nov 11, 2024

Enables or disables the automatic primary/secondary switchover feature for an instance.

Operation description

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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:ModifyHASwitchConfigupdate
  • DBInstance
    acs:rds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}
  • rds:ResourceTag
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBInstanceIdstringYes

The instance ID. You can call the DescribeDBInstances operation to query the instance ID.

rm-uf6wjk5xxxxxxxxxx
HAConfigstringNo

The mode 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.

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

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
RegionIdstringYes

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

cn-hangzhou

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

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.FormatInvalid format of ManualHATime.-
400ManualHATimeIsNullManualHATime 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 timeSummary of changesOperation
2023-09-08The Error code has changedView Change Details
2022-09-01The Error code has changedView Change Details