Help Center/ GaussDB/ API Reference/ APIs (Recommended)/ Backup and Restoration/ Querying Instances That Can Be Used for Backups and Restorations
Updated on 2024-08-20 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 left blank.

URI

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

Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Explanation:

Project ID of a tenant in a region.

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

Restrictions:

None

Value range:

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

Default value:

None

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 blank, restore_time is used.

restore_time

No

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

source_instance_id

No

ID of the DB instance to be restored.

  • If backup_id is not left blank, source_instance_id is optional.
  • If backup_id is left blank and restore_time is not left blank, source_instance_id is mandatory.
  • source_instance_id and backup_id cannot be both left blank.

offset

No

Index offset. If offset is set to N, the resource query starts from the N+1 data entries. The default value is 0, indicating that the query starts from the first data entry. 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

String

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",
            "instance_id": "3ea6d6463c9a4baf9a47c5b74464307cin14",
            "volume_type": "ULTRAHIGH",
            "data_volume_size": 500,
            "version": "8.102",
            "mode": "Ha",
            "instance_mode": "enterprise"
        }
    ],
    "total_count": 1
}

Status Code

Error Code

For details, see Error Codes.