Help Center> GaussDB> API Reference> APIs (Recommended)> Backup and Restoration> Querying Instances That Can Be Used for Backups and Restorations
Updated on 2024-05-21 GMT+08:00

Querying Instances That Can Be Used for Backups and Restorations

Function

This API is used to query the instances that can be used for backups and restorations. Before calling this API:

Constraints

The restore_time and backup_id parameters cannot be both empty.

URI

GET https://{Endpoint}/v3/{project_id}/restorable-instances

Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Project ID of a tenant in a region.

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

source_instance_id

Yes

ID of the DB instance to be restored.

backup_id

No

Instance backup ID. You can use the backup ID to query the instance topology information and filter the queried instances (including the number of nodes and replicas of instances). If this parameter is left empty, restore_time is used.

restore_time

No

Specific point of time. If the backup ID is empty, this parameter is used to query the instance topology information and filter the queried instances.

offset

No

Index offset. If offset is set to N, the resource query starts from the N+1 piece of data. The value is 0 by default, indicating that the query starts from the first piece of data. The value cannot be a negative number.

limit

No

Number of records to be queried. The default value is 100. The value cannot be a negative number. The minimum value is 1 and the maximum value is 100.

Request Parameters

None

Response Parameters

Table 2 Parameter description

Parameter

Type

Description

instances

Array of Objects

Instances that can be used for backups and restorations.

For details, see Table 3.

total_count

Integer

Total number of queried instances.

Table 3 instances parameter data structure description

Parameter

Type

Description

instance_name

String

DB instance name.

instance_id

String

Instance ID.

volume_type

String

Storage type.

data_volume_size

Number

Storage space, in GB

version

Number

Instance version

mode

String

Deployment model.

  • Ha: primary/standby deployment
  • Independent: independent deployment

instance_mode

String

Instance model.

  • enterprise: enterprise edition
  • standard: standard edition
  • basic: basic edition

Example Request

Querying instances that can be used for backups and restorations

GET https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/v3/0611f1bd8b00d5d32f17c017f15b599f/restorable-instances?source_instance_id=88efb3753dc844829c380edff7798eecin14&backup_id=d3f223e9c35d450ea0692bdbff686e45br14

Example Response

Instances that can be used for backups and restorations queried.

{ 
  "instances" : [ { 
    "instance_name" : "gaussdb_hzx", 
    "instance_id" : "3ea6d6463c9a4baf9a47c5b74464307cin14", 
    "volume_type" : "ULTRAHIGH", 
    "data_volume_size" : 500, 
    "version" : 1.3, 
    "mode" : "Ha", 
    "instance_mode" : "enterprise" 
  } ], 
  "total_count" : 1 
}

Status Code

Error Code

For details, see Error Codes.