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>
38 KiB
Querying Backups
Function
This API is used to query backups based on specified conditions.
URI
GET https://{Endpoint}/v4/{project_id}/backups
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. |
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
instance_id |
No |
String |
Instance ID, which can be obtained by calling the API for querying instances. If no instance is available, call the API for creating an instance. |
datastore_type |
No |
String |
Database type. The value can be:
|
backup_id |
No |
String |
Backup ID |
backup_type |
No |
String |
Backup type, which is case sensitive. The value can be:
|
type |
No |
String |
Backup policy type. The value can be:
|
limit |
No |
Integer |
Maximum backup records 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 position. The query starts from the next backup creation time indexed by this parameter under a specified project. If offset is set to N, the resource query starts from the N+1 piece of data. The value must be greater than or equal to 0. If this parameter is not transferred, the index offset is 0 by default, indicating that the query starts from the latest created instance. 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. The default value is left blank by default.
|
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. The default value is left blank by default.
|
Request Parameters
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
X-Auth-Token |
Yes |
String |
User token |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
|---|---|---|
total_count |
Integer |
Total backups |
backups |
Array of objects |
Backup details. For details, see Table 5. |
Parameter |
Type |
Description |
|---|---|---|
id |
String |
Backup ID |
description |
String |
Backup description |
instance_id |
String |
ID of an instance that a backup is created for |
instance_name |
String |
Name of an instance that a backup is created for |
datastore |
object |
Database version. For details, see Table 6. |
name |
String |
Backup name |
type |
String |
|
size |
Double |
Backup size, in KB |
status |
String |
Backup status. The value can be:
|
begin_time |
String |
Backup start time. The time point is in the yyyy-mm-ddThh:mm:ssZ format. T indicates the start time. 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. Z indicates the time zone offset. |
database_tables |
Array of objects |
Database and table information in a backup. For details, see Table 7.
|
Example Request
Example Response
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" : "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
} ]
}, {
"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
} ]
} ]
}
Status Codes
See Status Codes.
Error Codes
See Error Codes.