Help Center> Relational Database Service> API Reference> API v3 (Recommended)> DR Instances> Promoting a DR Instance to Be the Primary DB Instance

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 the cross-cloud DR relationship between the DB instances is abnormal.

Constraints

  • The primary DB instance and DR instance are available and are deployed in different clouds. The DR instance is deployed in standalone mode.
  • The DR relationship between the primary DB instance and DR instance has been established.
  • Only PostgreSQL 11, PostgreSQL 12, and PostgreSQL Enhanced Edition support the DR instance promotion to be a primary DB instance.

URI

  • URI format

    POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/action

  • Example

    https://rds.cn-north-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/action

  • Parameter description
    Table 1 Parameter description

    Name

    Mandatory

    Description

    project_id

    Yes

    Specifies the project ID of a tenant in a region.

    For details about how to obtain the project ID, see Obtaining a Project ID.

    instance_id

    Yes

    Specifies the DB instance ID.

Request

  • Parameter description
    Table 2 Parameter description

    Name

    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.

  • Request example
    {
    	"drreplica_to_master": {}
    }

Response

  • Normal response
    Table 3 Parameter description

    Name

    Type

    Description

    workFlowId

    String

    Indicates the task ID.

  • Example normal response
    {
    	"workFlowId": "184f29cd-be1a-43f1-5b6bc5500e73"
    }
  • Abnormal response

    For details, see Abnormal Request Results.