Updated on 2025-12-09 GMT+08:00

Promoting a DR Instance to Be the Primary DB Instance

Function

This API is used to promote a DR instance to be the primary DB instance when a cross-cloud or cross-region DR relationship between DB instances has become abnormal.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
  • If you are using role/policy-based authorization, see Permissions and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, no identity policy-based permissions are required for calling this API.

Constraints

  • Before using this function, ensure that the network between the VPC CIDR blocks of the DB instances across clouds or regions is connected, and configure security group rules to allow access from database ports in the VPC CIDR blocks. The DR relationship cannot be established if only the network is connected but security group rules are not configured.
  • The primary DB instance and DR instance are available and are deployed in different clouds or regions. The DR instance is deployed in standalone mode.
  • The DR relationship between the primary DB instance and DR instance has been established.
  • RDS for PostgreSQL 12 and later versions support DR instance promotion to the primary instance.

URI

  • URI format

    POST /v3/{project_id}/instances/{instance_id}/action

  • Parameter description
    Table 1 Parameters

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Definition

    Project ID of a tenant in a region.

    To obtain the value, see Obtaining a Project ID.

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

    instance_id

    Yes

    Definition

    Instance ID.

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

Request

Table 2 Parameters

Parameter

Mandatory

Type

Description

drreplica_to_master

Yes

Object

Definition

Specifies whether the DR instance is promoted to be the primary instance. No other parameters are required.

Constraints

N/A

Range

N/A

Default Value

N/A

Example Request

Promote a DR instance to the primary DB instance.
POST https://{endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/instances/24c6678f474241fe89ee9c42f768022ein03/action 

{
	"drreplica_to_master": {}
}

Response

  • Normal response
    Table 3 Parameters

    Parameter

    Type

    Description

    job_id

    String

    Definition

    Indicates the workflow ID.

    Range

    N/A

  • Example normal response
    {
    	"job_id": "04efe8e2-9255-44ae-a98b-d87cae411890"
    }
  • Abnormal response

    For details, see Abnormal Request Results.

Status Code

Error Code

For details, see Error Codes.