Performs a failover between the primary node and a read-only node in a PolarDB cluster.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | No | FailoverDBCluster | The operation that you want to perform. Set the value to FailoverDBCluster. |
DBClusterId | String | Yes | pc-************** | The ID of the PolarDB cluster. |
TargetDBNodeId | String | No | pi-*********** | The ID of the read-only node that serves as the new primary node. If you leave this parameter empty, the system automatically selects a read-only node. You can call the DescribeDBClusters operation to query node information, such as node IDs. Note
|
ClientToken | String | No | 6000170000591aed949d0f54a343f1a4233c1e7d1c5****** | The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can only contain ASCII characters and cannot exceed 64 characters in length. The token is case-sensitive. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | D0CEC6AC-7760-409A-A0D5-E6CD86****** | The ID of the request. |
Examples
Sample requests
http(s)://polardb.aliyuncs.com/?Action=FailoverDBCluster
&DBClusterId=pc-**************
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<FailoverDBClusterResponse>
<RequestId>D0CEC6AC-7760-409A-A0D5-E6CD86******</RequestId>
</FailoverDBClusterResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "D0CEC6AC-7760-409A-A0D5-E6CD86******"
}
Error codes
For a list of error codes, visit the API Error Center.