Help Center> GeminiDB> API Reference> APIs v3 (Recommended)> Disaster Recovery> Promoting a DR Instance from Standby to Primary
Updated on 2023-11-21 GMT+08:00

Promoting a DR Instance from Standby to Primary

Function

This API is used to promote a DR instance from standby to primary.

Constraints

This API supports GeminiDB Redis instances.

To promote a DR instance from standby to primary normally, you need to call the API for switching a DR instance from primary to standby and then deliver the command for promoting the standby to a primary.

Promoting a DR instance from standby to primary forcibly is used to quickly restore services when the primary instance is abnormal. You do not need to perform operations on the original primary instance.

URI

POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/switchover-master

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID of a tenant in a region. To obtain this value, see Obtaining a Project ID.

instance_id

Yes

String

Instance ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

force

No

Boolean

Whether the standby instance is forced to stay primary. The value can be:

true, indicating that the standby instance is forcibly promoted to a special primary instance for handling reads and writes independently when the primary instance becomes abnormal.

false, indicating that the standby instance is slowly promoted to primary when the primary instance is normal.

Response Parameters

Status code: 202

Table 4 Response body parameters

Parameter

Type

Description

job_id

String

ID of the job of promoting a DR instance from standby to primary.

Example Requests

  • URI example
    POST https://gaussdb-nosql.ap-southeast-1.myhuaweicloud.com/v3/054e292c9880d4992f02c0196d3ea468/instances/054e292c9880d4992f02c0196d3ein12/switchover-master 
    {
        "force": true
    }
    

Example Responses

Status code: 202

Accepted

{
  "job_id" : "20f793fd-2703-4339-bfb5-f1c9065b15c8"
}

Status Codes

For details, see Status Codes.

Error Codes

For details, see Error Codes.