Changes the primary zone of a PolarDB cluster.
Debugging
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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
polardb:ModifyDBClusterPrimaryZone | Write |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
DBClusterId | string | Yes | The ID of the cluster. Note
You can call the DescribeDBClusters operation to query information about all clusters that are deployed in a specified region, such as the cluster ID.
| pc-************** |
ZoneId | string | Yes | cn-hangzhou-g | |
ZoneType | string | Yes | The type of the zone. Valid values:
| Primary |
VSwitchId | string | No | The ID of the vSwitch in the destination primary zone. Note
| vsw-************** |
IsSwitchOverForDisaster | string | No | Specifies whether to switch back to the original primary zone.
| false |
PlannedStartTime | string | No | The start time to change the primary zone within the scheduled time period. Specify the time in the ISO 8601 standard in the Note
2021-01-14T09:00:00Z , you can specify a point in time from 2021-01-14T09:00:00Z to 2021-01-15T09:00:00Z . | 2021-01-14T09:00:00Z |
PlannedEndTime | string | No | The latest start time to switch the primary zone within the scheduled time period. Specify the time in the ISO 8601 standard in the Note
PlannedStartTime parameter but do not specify the PlannedEndTime parameter, the latest start time of the task is set to a value that is calculated by the value of the PlannedEndTime parameter + 30 minutes by default. For example, if you set the PlannedStartTime parameter to 2021-01-14T09:00:00Z and you do not specify the PlannedEndTime parameter, the latest start time of the task is set to 2021-01-14T09:30:00Z . | 2021-01-14T09:30:00Z |
FromTimeService | boolean | No | Specifies whether to change the primary zone immediately. Valid values:
| false |
VPCId | string | No | The virtual private cloud (VPC) ID of the destination primary zone. | vpc-********** |
Response parameters
Examples
Sample success responses
JSON
format
{
"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 specified cluster already has a scheduled task. |
400 | InvalidZoneId.Malformed | The specified parameter ZoneId is not valid. | The specified ZoneId parameter is invalid. |
400 | InvalidZoneId.Same | The specified parameter ZoneId is same with origin zoneId. | The specified ZoneId is the same as the original ZoneId. |
403 | ActionUnauthorized | The specified action is not available for you. | This operation cannot be performed. |
403 | OperationDenied.MutexLock | The operation is not permitted due to the mutex lock. | This operation cannot be performed because of a mutex. |
404 | InvalidDBCluster.NotFound | The DBClusterId provided does not exist in our records. | The specified DBClusterId parameter does not exist in the current record. |
404 | InvalidDBClusterId.Malformed | The specified parameter DBClusterId is not valid. | The specified DBClusterId parameter is invalid. |
404 | InsufficientResource | The specified target zone has insufficient resources. | The specified target zone has insufficient resources. |
500 | InternalError | The request processing has failed due to some unknown error, exception or failure. | The request failed to be processed because unknown errors, exceptions, or failures have occurred. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2024-02-27 | The Error code has changed. The request parameters of the API has changed | see changesets | ||||||||||||||
| ||||||||||||||||
2023-11-23 | The Error code has changed | see changesets | ||||||||||||||
| ||||||||||||||||
2023-09-12 | The Error code has changed | see changesets | ||||||||||||||
| ||||||||||||||||
2023-07-10 | The Error code has changed. The request parameters of the API has changed | see changesets | ||||||||||||||
| ||||||||||||||||
2023-06-28 | The Error code has changed. The request parameters of the API has changed | see changesets | ||||||||||||||
|