All Products
Search
Document Center

PolarDB:ModifyDBClusterPrimaryZone

Last Updated:Jun 19, 2024

Changes the primary zone of a PolarDB cluster.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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
ZoneTypestringYes

The type of the zone. Valid values:

  • Primary: primary zone
  • Standby: secondary zone
Primary
VSwitchIdstringNo

The ID of the vSwitch in the destination primary zone.

Note
  • For a PolarDB for PostgreSQL (Compatible with Oracle) cluster or a PolarDB for PostgreSQL cluster, this parameter is required.
  • For a PolarDB for MySQL cluster, the default vSwitch is used if no vSwitches are created in the destination zone. If a vSwitch is in the destination zone, this parameter is required.
  • vsw-**************
    IsSwitchOverForDisasterstringNo

    Specifies whether to switch back to the original primary zone.

    • true: switches back to the original primary zone.
    • false: does not switch back to the original primary zone.
    false
    PlannedStartTimestringNo

    The start time to change 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 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 from 2021-01-14T09:00:00Z to 2021-01-15T09:00:00Z.
  • If you leave this parameter empty, the primary zone is immediately changed.
  • 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 whether to change the primary zone immediately. Valid values:

    • false (default): changes the primary zone as scheduled.
    • true: changes the primary zone immediately.
    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
    2024-02-27The Error code has changed. The request parameters of the API has changedsee changesets
    Change itemChange content
    Error CodesThe Error code has changed.
      delete Error Codes: 400
      delete Error Codes: 403
      delete Error Codes: 404
      delete Error Codes: 500
    Input ParametersThe request parameters of the API has changed.
      Added Input Parameters: ZoneType
    2023-11-23The Error code has changedsee changesets
    Change itemChange content
    Error CodesThe Error code has changed.
      Error Codes 404 change
      delete Error Codes: 400
      delete Error Codes: 403
      delete Error Codes: 500
    2023-09-12The Error code has changedsee changesets
    Change itemChange content
    Error CodesThe Error code has changed.
      Error Codes 400 change
      Error Codes 404 change
      Added Error Codes: 403
      Added Error Codes: 500
    2023-07-10The Error code has changed. The request parameters of the API has changedsee changesets
    Change itemChange content
    Error CodesThe Error code has changed.
      delete Error Codes: 400
      delete Error Codes: 404
    Input ParametersThe request parameters of the API has changed.
      Added Input Parameters: IsSwitchOverForDisaster
    2023-06-28The Error code has changed. The request parameters of the API has changedsee changesets
    Change itemChange content
    Error CodesThe Error code has changed.
      delete Error Codes: 400
      delete Error Codes: 404
    Input ParametersThe request parameters of the API has changed.
      Added Input Parameters: VPCId