Help Center/ GaussDB/ API Reference/ APIs (Recommended)/ DR Management/ Querying Instances That Have Established a DR Relationship
Updated on 2026-07-16 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:

Debugging

You can debug this API in API Explorer.

URI

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

Table 1 Parameter description

Parameter

Mandatory

Type

Description

project_id

Yes

String

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

No

String

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

No

String

Definition

Instance ID. This parameter can be used to query the local instance ID. For details about how to obtain the instance ID, see Querying DB Instances.

Constraints

N/A

Range

N/A

Default Value

N/A

limit

No

Integer

Definition

Number of records returned by a query.

Constraints

N/A

Range

1–100

Default Value

100

offset

No

Integer

Definition

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

Constraints

The value cannot be negative.

Range

N/A

Default Value

0: The query starts from the first data record.

dr_role

No

String

Definition

Instance role in the DR relationship.

Constraints

N/A

Range

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

Default Value

N/A

dr_type

No

String

Definition

DR type.

Constraints

N/A

Range

  • stream: streaming DR.

Default Value

N/A

dr_status

No

String

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

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token.

You can obtain the token by calling the IAM API used to obtain a user token.

After a response is returned, the value of X-Subject-Token in the response header is the token.

Constraints

N/A

Range

N/A

Default Value

N/A

X-Language

No

String

Definition

Language.

Constraints

N/A

Range

  • zh-cn: Chinese
  • en-us: English

Default Value

en-us

Response Parameters

Table 3 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 4.

Table 4 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

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

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

updated

String

Definition

Update time.

Range

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

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

slave_region_instance_info

Object

Definition

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

master_region_instance_info

Object

Definition

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

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

  • BUILD: The instance is being created.
  • BUILD_FAILED: The instance failed to be created.
  • ACTIVE: The instance is normal.
  • FAILED: The instance is abnormal.
  • FROZEN: The instance is frozen.
  • MODIFYING: The storage is being scaled up, or instance specifications are being changed.
  • EXPANDING: Read replicas, CNs, or DN shards are being added to the instance.
  • REBOOTING: The instance is being rebooted.
  • REDUCING: Read replicas are being deleted.
  • UPGRADING: The instance is being upgraded.
  • RESTORING: The instance is being restored.
  • SWITCHOVER: A primary/standby switchover is being performed.
  • MIGRATING: The instance is being migrated.
  • BACKING UP: The instance is being backed up.
  • UPGRADE TO BE OBSERVED: The instance upgrade is in the observation period.
  • MODIFYING DATABASE PORT: The database port is being changed.
  • STORAGE FULL: The instance storage is full.
  • REPAIRING: The instance is being repaired.
  • SHUTDOWN: The instance is stopped.

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 5 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 6 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.