Help Center/ GeminiDB/ API Reference/ APIs v3/ Disaster Recovery/ Checking Whether a DR Relationship Can Be Created with or Deleted from a Specified Instance
Updated on 2023-11-21 GMT+08:00

Checking Whether a DR Relationship Can Be Created with or Deleted from a Specified Instance

Function

This API is used to check whether a DR relationship can be created with or deleted from a specified instance. If a success status code is returned, a DR relationship can be created with or deleted from a specified instance.

A DR relationship can be created between or deleted from two instances only when this API is successfully called for both of the instances.

Constraints

This API supports GeminiDB Redis instances.

URI

POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/disaster-recovery/precheck

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

operation

Yes

String

Specific DR operation during the pre-check. The options are as follows:

  • construction: indicates that a DR relationship is created between two instances.
  • deconstruction: indicates that a DR relationship is deleted from two instances.

disaster_recovery_instance

No

object

Information about the DR instance. For details, see Table 4.

NOTE:
  • When operation is set to construction, this parameter must be passed.
  • When operation is set to deconstruction, transferring this parameter is not required.
Table 4 TargetDisasterRecoveryInstance

Parameter

Mandatory

Type

Description

node_ips

Yes

Array of strings

IP addresses of all nodes of the DR instance.

spec_code

Yes

String

Specification code of the DR instance.

vpc_cidr

Yes

String

VPC CIDR block of the DR instance.

Response Parameters

Status code: 204

No response parameters

Example Requests

  • URI example
    POST https://gaussdb-nosql.eu-west-101.myhuaweicloud.eu/v3/054e292c9880d4992f02c0196d3ea468/instances/054e292c9880d4992f02c0196d3ein12/disaster-recovery/precheck
  • Creating a DR relationship with a specified instance
    {
        "operation" : "construction",
        "disaster_recovery_instance" :{
          "node_ips" : [ "10.0.1.2", "10.0.1.3", "10.0.1.4" ],
          "spec_code" : "geminidb.redis.xlarge.4",
          "vpc_cidr" : "10.0.0.0/16"
        } 
    }
  • Deleting a DR relationship from a specific instance
    {
        "operation" : "deconstruction"
    }

Example Responses

None

Status Codes

For details, see Status Codes.

Error Codes

For details, see Error Codes.