All Products
Search
Document Center

PolarDB:ModifyDBClusterPrimaryZone

Last Updated:Dec 06, 2023

Modifies the primary zone of a PolarDB cluster.

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.

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.
OperationAccess levelResource typeCondition keyAssociated operation
polardb:ModifyDBClusterPrimaryZoneWRITE
  • dbcluster
    acs:polardb:{#regionId}:{#accountId}:dbcluster/{#dbclusterId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBClusterIdstringYes

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-**************
ZoneIdstringYes

The ID of the destination primary zone.

Note You can call the DescribeRegions operation to query available zones.
cn-hangzhou-g
VSwitchIdstringNo

The ID of vSwitch in the destination primary zone.

Note
  • For a PolarDB for Oracle or PolarDB for PostgreSQL cluster, this parameter is required.

  • For a PolarDB for MySQL cluster: - This parameter is optional if no vSwitches have been created in the destination zone. The default vSwitch is used. - This parameter is required if a vSwitch has been created in the destination zone.

vsw-**************
IsSwitchOverForDisasterstringNo

Specifies whether to switch back over to the original primary zone. Valid values: true: Switch over back to the original primary zone. false: Do not switch back over to the original primary zone. If this parameter is set to false, the primary zone of the cluster is changed to the specified destination zone.

false
PlannedStartTimestringNo

The earliest start time to switch the primary zone within the scheduled time period. Specify the time in the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. The time must be in UTC.

Note
  • The earliest start time of the task can be a point in time within the next 24 hours. For example, if the current time is 2021-01-14T09:00:00Z, you can specify a point in time that ranges from 2021-01-14T09:00:00Z to 2021-01-15T09:00:00Z.

  • If you left this parameter empty, the primary zone is immediately switched.

2021-01-14T09:00:00Z
PlannedEndTimestringNo

The latest start time to switch the primary zone within the scheduled time period. Specify the time in the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. The time must be in UTC.

Note
  • The latest start time must be at least 30 minutes later than the earliest start time.

  • If you specify the 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
FromTimeServicebooleanNo

Specifies an immediate or scheduled task to switch the primary zone. Valid values:

  • false: scheduled task
  • true: immediate task
false
VPCIdstringNo

The virtual private cloud (VPC) ID of the destination primary zone.

vpc-**********

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

ED12C6FF-3261-4571-AB57-3570F6******

Examples

Sample success responses

JSONformat

{
  "RequestId": "ED12C6FF-3261-4571-AB57-3570F6******"
}

Error codes

HTTP status codeError codeError messageDescription
400ScheduleTaskExistThe specified cluster already has a scheduled task.The specified cluster already has a scheduled task.
400InvalidZoneId.MalformedThe specified parameter ZoneId is not valid.The specified ZoneId parameter is invalid.
400InvalidZoneId.SameThe specified parameter ZoneId is same with origin zoneId.The specified ZoneId is the same as the original ZoneId.
403ActionUnauthorizedThe specified action is not available for you.This operation cannot be performed.
403OperationDenied.MutexLockThe operation is not permitted due to the mutex lock.This operation cannot be performed because of a mutex.
404InvalidDBCluster.NotFoundThe DBClusterId provided does not exist in our records.The specified DBClusterId parameter does not exist in the current record.
404InvalidDBClusterId.MalformedThe specified parameter DBClusterId is not valid.The specified DBClusterId parameter is invalid.
404InsufficientResourceThe specified target zone has insufficient resources.The specified target zone has insufficient resources.
500InternalErrorThe 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 timeSummary of changesOperation
2023-11-23The error codes of the API operation change.see changesets
Change itemChange content
Error CodesThe error codes of the API operation change.
    Error Codes 404 change
    delete Error Codes: 400
    delete Error Codes: 403
    delete Error Codes: 500
2023-09-12The error codes of the API operation change.see changesets
Change itemChange content
Error CodesThe error codes of the API operation change.
    Error Codes 400 change
    Error Codes 404 change
    Added Error Codes: 403
    Added Error Codes: 500
2023-07-10The error codes of the API operation change.,The input parameters of the API operation change.see changesets
Change itemChange content
Error CodesThe error codes of the API operation change.
    delete Error Codes: 400
    delete Error Codes: 404
Input ParametersThe input parameters of the API operation change.
    Added Input Parameters: IsSwitchOverForDisaster
2023-06-28The error codes of the API operation change.,The input parameters of the API operation change.see changesets
Change itemChange content
Error CodesThe error codes of the API operation change.
    delete Error Codes: 400
    delete Error Codes: 404
Input ParametersThe input parameters of the API operation change.
    Added Input Parameters: VPCId