Help Center/ GaussDB/ API Reference/ APIs (Recommended)/ DR Management/ Querying Instances That Have Established a DR Relationship
Updated on 2025-08-19 GMT+08:00

Querying Instances That Have Established a DR Relationship

Function

This API is used to query instances that have established a DR relationship. Before calling this API:

URI

GET /v3.5/{project_id}/disaster-recovery/relations

Table 1 Parameter description

Parameter

Type

Mandatory

Description

project_id

String

Yes

Definition

Project ID of a tenant in a region.

To obtain the value, see Obtaining a Project ID.

Constraints

N/A

Range

The value can contain 32 characters. Only letters and digits are allowed.

Default Value

N/A

instance_name

String

No

Definition

Instance name. This parameter can be used to query the local instance.

Constraints

N/A

Range

N/A

Default Value

N/A

instance_id

String

No

Definition

Instance ID. This parameter can be used to query the local instance ID.

Constraints

N/A

Range

N/A

Default Value

N/A

limit

Integer

No

Definition

Number of records returned by a query.

Constraints

N/A

Range

1–100

Default Value

100

offset

Integer

No

Definition

Index offset. The query starts from the next piece of data indexed by this parameter.

Constraints

The value must be a non-negative integer.

Range

N/A

Default Value

0: The query starts from the first data record.

dr_role

String

No

Definition

Instance role in the DR relationship.

Constraints

N/A

Range

  • master: primary instance.
  • disaster: DR instance.

Default Value

N/A

dr_type

String

No

Definition

DR type.

Constraints

N/A

Range

  • stream: streaming DR.

Default Value

N/A

dr_status

String

No

Definition

DR status.

Constraints

N/A

Range

  • normal: The DR relationship is normal.
  • failover: The DR instance has been promoted to primary.
  • pending: The task is being processed.
  • pre_check_failed: The DR precheck failed.
  • pre_checking: DR precheck is in progress.

Default Value

N/A

Request Parameters

None

Response Parameters

Table 2 Response body parameters

Parameter

Type

Description

total

Integer

Definition

Total number of records.

Range

N/A

relations

Array of objects

Definition

DR relationship details. For details, see Table 3.

Table 3 relations field data structure description

Parameter

Type

Description

disaster_type

String

Definition

DR type.

Range

  • stream: streaming DR.

name

String

Definition

DR task name.

Range

N/A

disaster_role

String

Definition

Instance role in the DR relationship.

Range

  • master: primary instance.
  • disaster: DR instance.

created

String

Definition

Creation time.

Range

N/A

The value is in the yyyy-mm-ddThh:mm:ssZ format.

T is the separator between calendar and hourly notation of time. Z indicates the time zone offset. For example, in the Beijing time zone, the offset is +0800.

updated

String

Definition

Update time.

Range

N/A

The value is in the yyyy-mm-ddThh:mm:ssZ format.

T is the separator between calendar and hourly notation of time. Z indicates the time zone offset. For example, in the Beijing time zone, the offset is +0800.

slave_region_instance_info

Object

Definition

Instance information in the DR region. For details, see Table 4.

master_region_instance_info

Object

Definition

Instance information in the primary region. For details, see Table 5.

synchronization_id

String

Definition

Unique ID of the DR relationship.

Range

N/A

id

String

Definition

DR ID.

Range

N/A

instance_id

String

Definition

DB instance ID in the current region.

Range

N/A

instance_name

String

Definition

Instance name in the current region.

Range

N/A

instance_status

String

Definition

Instance status in the current region.

Range

N/A

precheck_failed_reason

String

Definition

Pre-verification failure cause.

Range

N/A

status

String

Definition

DR status.

Range

  • pending: The task is being processed.
  • normal: The DR relationship is normal.
  • failed: The DR relationship creation failed
  • completed: The DR relationship has been removed.
  • failover: The DR instance has been promoted to primary.
  • simulation: A DR drill is in progress.
  • dr_log_keep: Log cache is enabled.
  • pre_checking: DR precheck is in progress.
  • pre_check_failed: The DR precheck failed.

actions

Array of strings

Definition

List of actions that are being executed by the instance.

Table 4 Data structure description for the slave_region_instance_info field

Parameter

Type

Description

instance_id

String

Definition

Instance ID.

Range

N/A

project_id

String

Definition

Instance project ID.

Range

N/A

project_name

String

Definition

Instance project name.

Range

N/A

region_code

String

Definition

Region code.

Range

N/A

ip_address

String

Definition

Data IP addresses, which are separated by commas (,).

Range

N/A

Table 5 Data structure description for the master_region_instance_info field

Parameter

Type

Description

instance_id

String

Definition

Instance ID.

Range

N/A

project_id

String

Definition

Instance project ID.

Range

N/A

project_name

String

Definition

Instance project name.

Range

N/A

region_code

String

Definition

Region code.

Range

N/A

ip_address

String

Definition

Data IP addresses, which are separated by commas (,).

Range

N/A

Example Request

https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/v3.5/0483b6b16e954cb88930a360d2c4e663/disaster-recovery/relations?limit=&offset=0&instance_name=test

Example Response

{ 
   "total" : 1, 
   "relations" : [ { 
     "name" : "DR-task-0962", 
     "created" : "2022-06-16 09:39:51", 
     "updated" : "2022-06-16 09:44:55", 
     "id" : "30b74120-4b50-495d-8174-7eeddf7feac5", 
     "synchronization_id" : "9446f822-ccd2-43dc-929c-0b78ba7fdf64", 
     "status" : "normal", 
     "precheck_failed_reason" : "", 
     "disaster_type" : "stream", 
     "disaster_role" : "disaster", 
     "slave_region_instance_info" : { 
       "region_code" : "sa-fb-1", 
       "instance_id" : "d1060faf0d3743dd8830b39e7423bc9ain14", 
       "project_id" : "4a52a8a8f63d4c6d966dff0e20b69738", 
       "project_name" : "sa-fb-1_GaussDB", 
       "ip_address" : "172.166.1.192,172.166.0.6,172.166.1.135" 
     }, 
     "master_region_instance_info" : { 
       "region_code" : "sa-fb-1", 
       "instance_id" : "54d4b9fb131745fcba32cb90a05cabb8in14", 
       "project_id" : "4a52a8a8f63d4c6d966dff0e20b69738", 
       "project_name" : "sa-fb-1_GaussDB", 
       "ip_address" : "172.167.1.86,172.167.0.89,172.167.1.229" 
     }, 
     "instance_id" : "d1060faf0d3743dd8830b39e7423bc9ain14", 
     "instance_name" : "hly-0609-02", 
     "instance_status" : "normal", 
     "actions" : [ "STREAM_DISASTER_RELATION_MASTER_TAG" ] 
   } ] 
 }

Status Codes

Error Codes

For details, see Error Codes.