Switches the primary zone of a PolarDB cluster.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | ModifyDBClusterPrimaryZone | The operation that you want to perform. Set the value to ModifyDBClusterPrimaryZone. |
DBClusterId | String | Yes | pc-************** | The ID of the cluster. Note You can call the DescribeDBClusters operation to query information about all your PolarDB clusters that are deployed in a specified region. The returned information includes the ID of each cluster. |
ZoneId | String | Yes | cn-hangzhou-g | The ID of the destination primary zone. Note You can call the DescribeRegions operation to query available zones. |
VSwitchId | String | No | vsw-************** | The vSwitch ID of in the destination primary zone. Note
|
PlannedStartTime | String | No | 2021-01-14T09:00:00Z | The earliest time to switch the primary zone within the scheduled time period. Specify the parameter in the Note
|
PlannedEndTime | String | No | 2021-01-14T09:30:00Z | The latest start time to run the task. Specify the time in the Note
|
FromTimeService | Boolean | No | false | Specify an immediate or scheduled task to switch the primary zone. Default value: false. Valid values:
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | ED12C6FF-3261-4571-AB57-3570F6****** | The ID of the request. |
Examples
Sample requests
http(s)://polardb.aliyuncs.com/?Action=ModifyDBClusterPrimaryZone
&DBClusterId=pc-**************
&ZoneId=cn-hangzhou-g
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<ModifyDBClusterPrimaryZoneResponse>
<RequestId>ED12C6FF-3261-4571-AB57-3570F6******</RequestId>
</ModifyDBClusterPrimaryZoneResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "ED12C6FF-3261-4571-AB57-3570F6******"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | ScheduleTaskExist | The specified cluster already has a scheduled task. | The error code returned because a different task is scheduled to run on the specified cluster. |
404 | InvalidDBCluster.NotFound | The DBClusterId provided does not exist in our records. | The error message returned because the specified DBClusterId does not exist in the current record. |
For a list of error codes, visit the API Error Center.