Files
doc-exports/docs/geminidb/api-ref/nosql_05_0211.html
wangdengke2 8d0926f0e5 geminidb_api
Reviewed-by: Gladkov, Maksim <mgladkov@noreply.gitea.eco.tsi-dev.otc-service.com>
Co-authored-by: wangdengke2 <wangdengke2@huawei.com>
Co-committed-by: wangdengke2 <wangdengke2@huawei.com>
2025-09-04 07:22:35 +00:00

38 KiB

Querying Backups (Recommended)

Function

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

You can view incremental and differential backups and their sizes on GeminiDB Cassandra instances.

URI

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

Table 1 URI parameter

Parameter

Mandatory

Type

Description

project_id

Yes

String

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

Table 2 Query parameters

Parameter

Mandatory

Type

Description

instance_id

No

String

Instance ID, which can be obtained by calling the API for querying instances. If there are no instances available, create one by calling the API used for creating an instance.

datastore_type

No

String

Database type.

  • cassandra

backup_id

No

String

Backup ID.

backup_type

No

String

Backup type, which is case sensitive. The value can be:

  • Auto: automated full backup
  • Manual: manual full backup
  • If this parameter is not transferred, automated and manual full backups, including table-level backups, are both queried by default.

type

No

String

Backup policy type. The value can be:

  • Instance, indicating that an instance backup is queried.
  • DatabaseTable, indicating that a database or table backup is queried.
  • The default value is Instance.

limit

No

Integer

Maximum backups to be queried. The value ranges from 1 to 100. If this parameter is not transferred, the first 100 instances are queried by default.

Minimum value: 1

Maximum value: 100

offset

No

Integer

Index offset. The query starts from the next backup creation time indexed by this parameter in a specified project. If offset is set to N, the query starts from the N+1 piece of data. The value must be no less than 0. If this parameter is not transferred, offset is set to 0 by default, which indicates that the query starts from the latest created backup.

Minimum value: 0

begin_time

No

String

Start time of the backup query. The time point is in the yyyy-mm-ddThh:mm:ssZ format. T indicates the start time. Z indicates the time zone offset and the default value is left blank by default.

  • When end_time is not empty, begin_time is mandatory.

end_time

No

String

End time of the backup query. The time point is in the yyyy-mm-ddThh:mm:ssZ format. T indicates the start time. Z indicates the time zone offset and the default value is left blank by default.

  • When begin_time is not empty, end_time is mandatory.

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

Integer

Total backups.

backups

Array of objects

Backup details. For details, see Table 5.

Table 5 Backup

Parameter

Type

Description

id

String

Backup ID.

description

String

Backup description.

instance_id

String

ID of the instance that the backup is created for.

instance_name

String

Name of the instance that the backup is created for.

datastore

object

DB version information. For details, see Table 6.

name

String

Backup name.

type

String

  • Auto: automated full backup
  • Manual: manual full backup

size

Double

Backup size, in KB.

status

String

Backup status. The value can be:

  • BUILDING, indicating that the backup is in progress.
  • COMPLETED, indicating that the backup is completed.
  • FAILED, indicating that the backup failed.

begin_time

String

Backup start time. The time point is in the yyyy-mm-ddThh:mm:ssZ format. T indicates the start time, and Z indicates the time zone offset.

end_time

String

Backup end time. The time point is in the yyyy-mm-ddThh:mm:ssZ format. T indicates the start time, and Z indicates the time zone offset.

database_tables

Array of objects

Database and table information in the backup. For details, see Table 7.

  • Keep this parameter empty or ignore it when you query an instance backup.
  • Specify this parameter when you query a database or table backup (if any).

deletable

Boolean

Whether a table can be deleted.

Table 6 Datastore

Parameter

Type

Description

type

String

Database type.

version

String

Database version.

Table 7 QueryDatabaseTableInfo

Parameter

Type

Description

database_name

String

Database name.

table_names

Array of strings

Table names.

  • If this parameter is empty, database names are queried.
  • If this parameter is not empty, table names are queried.

Example Request

  • URI example
    GET https://{Endpoint}/v3.1/
    054b61972980d4552f0bc00ac8d3f5cd/backups?instance_id=c0c9f155c7b7423a9d30f0175998b63bin01&offset=2&limit=2&begin_time=2019-05-27T03:38:51+0000&end_time=2019-05-28T03:38:51+0000&type=DatabaseTable
  • Example request body

    None

Example Response

Status code: 200

Successful request
{ 
  "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" : "2019-05-27T03:38:51+0000", 
    "end_time" : "2019-05-27T03:39:51+0000", 
    "status" : "COMPLETED", 
    "size" : 2803, 
    "description" : "backup description", 
    "database_tables" : [ { 
      "database_name" : "DATABASE_X", 
      "table_names" : [ "TABLE_A", "TABLE_B", "TABLE_C" ] 
    }, { 
      "database_name" : "DATABASE_Y", 
      "table_names" : null 
    } ] 
    "deletable": null
  }, { 
    "id" : "43e4feaab48f11e89039fa163ebaa7e4br02", 
    "name" : "backup-test-2", 
    "instance_id" : "43e4feaab48f11e89039fa163ebaa7e4br02", 
    "instance_name" : "cluster-test", 
    "datastore" : { 
      "type" : "cassandra", 
      "version" : "3.4" 
    }, 
    "type" : "Manual", 
    "begin_time" : "2019-05-27T03:38:51+0000", 
    "end_time" : "2019-05-27T03:39:51+0000", 
    "status" : "COMPLETED", 
    "size" : 2803, 
    "description" : "backup description", 
    "database_tables" : [ { 
      "database_name" : "DATABASE_X", 
      "table_names" : [ "TABLE_A", "TABLE_B", "TABLE_C" ] 
    }, { 
      "database_name" : "DATABASE_Y", 
      "table_names" : null 
    } ] 
    "deletable": null
  } ] 
}

Status Codes

See Status Codes.

Error Codes

See Error Codes.