Updated on 2025-08-20 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.

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

    Project ID of a tenant in a region.

    To obtain the value, see Obtaining a Project ID.

    instance_id

    Yes

    Specifies the DB instance ID.

Request

Table 2 Parameters

Parameter

Mandatory

Type

Description

drreplica_to_master

Yes

Object

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

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

    Indicates the workflow ID.

  • 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.