Updated on 2023-11-21 GMT+08:00

Querying Backups

Function

This API is used to query backups based on specified conditions.

GeminiDB Cassandra only allows you to view incremental backups and differential backups and their sizes.

URI

GET https://{Endpoint}/v3/{project_id}/backups

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID of a user in a region. To obtain this value, see Obtaining a Project ID.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

offset

Yes

Integer

Page number.

Minimum value: 1

limit

Yes

Integer

Number of records on each page.

Minimum value: 1

Maximum value: 100

datastore_type

No

String

DB API type. If this parameter is not specified, all DB API will be queried.

Value options:

  • cassandra
  • redis
  • influxdb

type

No

String

Backup policy type. The value can be:

  • Instance, indicating that an instance backup is queried.
  • DatabaseTable, indicating that a table-level backup is queried. This feature is available to only GeminiDB Cassandra.
  • The default value is Instance.

instance_id

No

String

Instance ID. If this parameter is not transferred, all backups are queried.

backup_id

No

String

Backup ID.

backup_type

No

String

Backup type.

Value options:

  • Auto: indicates that the backup is an automated full backup.
  • Manual: indicates that the backup is a manual full backup.
  • Incremental: indicates that the backup is an incremental backup.
  • Differential: indicates that the backup is a differential backup.

begin_time

No

String

Start time of the query. The format is yyyy-mm-dd hh:mm:ss. The value is in UTC format.

end_time

No

String

End time of the query. The format is yyyy-mm-dd hh:mm:ss. The value is in UTC format.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

total_count

Long

Total number of records.

backups

Array of objects

Backup list. For details, see Table 5.

Table 5 backups

Parameter

Type

Description

id

String

Backup ID.

name

String

Backup name.

description

String

Backup description.

begin_time

String

Backup start time. The format of the start time is yyyy-mm-dd hh:mm:ss. The value is in UTC format.

end_time

String

Backup end time. The format of the end time is yyyy-mm-dd hh:mm:ss. The value is in UTC format.

status

String

Backup status.

Value options:

  • BUILDING: indicates that the backup is in progress.
  • COMPLETED: indicates that the backup is completed.
  • FAILED: indicates that the backup failed.

size

Double

Backup size, in KB.

type

String

Backup type.

Value options:

  • Auto: indicates that the backup is an automated full backup.
  • Manual: indicates that the backup is a manual full backup.

instance_id

String

Instance ID.

instance_name

String

Instance name.

datastore

object

Database information. For details, see Table 6.

Table 6 datastore

Parameter

Type

Description

type

String

Database type.

version

String

Database version.

Example Requests

  • URI example
    GET https://gaussdb-nosql.eu-west-101.myhuaweicloud.eu/v3/054b61972980d4552f0bc00ac8d3f5cd/backups?instance_id=c0c9f155c7b7423a9d30f0175998b63bin01&offset=2&limit=2&begin_time=2018-07-06 10:41:14&end_time=2018-08-16 10:41:14&type=DatabaseTable
  • Incremental backups and their sizes
    GET https://{Endpoint}/v3/2900b7b8d03e4619b8db8d43bc6234ee/backups?offset=1&limit=5&backup_type=Incremental&instance_id=3149aee486d748f68db1ee81e95b9f56in06
  • Differential backups and their sizes
    GET https://{Endpoint}/v3/2900b7b8d03e4619b8db8d43bc6234ee/backups?offset=1&limit=5&backup_type=Differential&instance_id=3149aee486d748f68db1ee81e95b9f56in06
  • Example request body

    None

Example Responses

Status code: 200

Success

{
   "total_count" : 4, 
   "backups" : [ { 
     "id" : "43e4feaab48f11e89039fa163ebaa7e4br01", 
     "name" : "backup-test", 
     "instance_id" : "43e4feaab48f11e89039fa163ebaa7e4br01", 
     "instance_name" : "cluster-test", 
     "datastore" : { 
       "type" : "cassandra", 
       "version" : "3.4" 
     }, 
     "type" : "Auto", 
     "begin_time" : "2018-08-06 12:41:14", 
     "end_time" : "2018-08-06 12:43:14", 
     "status" : "COMPLETED", 
     "size" : 2803, 
     "description" : "backup description", 
   }, { 
     "id" : "43e4feaab48f11e89039fa163ebaa7e4br02", 
     "name" : "backup-test-2", 
     "instance_id" : "43e4feaab48f11e89039fa163ebaa7e4br02", 
     "instance_name" : "cluster-test", 
     "datastore" : { 
       "type" : "cassandra", 
       "version" : "3.4" 
     }, 
     "type" : "Manual", 
     "begin_time" : "2018-08-06 12:41:14", 
     "end_time" : "2018-08-06 12:43:14", 
     "status" : "COMPLETED", 
     "size" : 2803, 
     "description" : "backup description", 
   } ] 
 }

Status Codes

For details, see Status Codes.

Error Codes

For details, see Error Codes.