Updated on 2024-03-05 GMT+08:00

Querying DCS Instance Backup Records

Function

This API is used to query the backup records of a specified DCS instance.

URI

GET /v1.0/{project_id}/instances/{instance_id}/backups?start={start}&limit={limit}&beginTime={beginTime}&endTime={endTime}

Table 1 describes the parameters.
Table 1 Parameter description

Parameter

Type

Mandatory

Description

project_id

String

Yes

Project ID.

instance_id

String

Yes

DCS instance ID.

start

Integer

No

Start sequence number of the backup record that is to be queried. By default, this parameter is set to 1.

limit

Integer

No

Number of backup records displayed on each page. The minimum value of this parameter is 1. If this parameter is not set, 10 backup records are displayed on each page by default.

beginTime

String

No

Start time of the period to be queried. Format: yyyyMMddHHmmss, for example, 20170718235959.

endTime

String

No

End time of the period to be queried. Format: yyyyMMddHHmmss, for example, 20170718235959.

Request

Request parameters

None.

Example request

GET https://{dcs_endpoint}/v1.0/{project_id}/instances/{instance_id}/backups?start={start}&limit={limit}&beginTime={beginTime}&endTime={endTime}

Response

Response parameters

Table 2 describes the response parameters.
Table 2 Parameter description

Parameter

Type

Description

backup_record_response

Array

Array of the backup records. For details about backup_record_response, see Table 3.

total_num

Integer

Number of obtained backup records.

Table 3 backup_record_response parameter description

Parameter

Type

Description

status

String

Backup status. Options:

  • waiting: DCS instance restoration is waiting to begin.
  • backuping: DCS instance backup is in progress.
  • succeed: DCS instance backup succeeded.
  • failed: DCS instance backup failed.
  • expired: The backup file expires.
  • deleted: The backup file has been deleted manually.

remark

String

Description of DCS instance backup

period

String

Time segment in which DCS instance backup was performed

progress

String

Backup progress

size

Long

Size of the backup file. Unit: byte.

instance_id

String

DCS instance ID

backup_id

String

ID of the backup record

created_at

String

Time at which the backup task is created

updated_at

String

Time at which DCS instance backup is completed

execution_at

String

Time at which the backup starts.

backup_type

String

Backup type. Options:

  • manual: manual backup
  • auto: automatic backup

backup_name

String

Name of the backup record

error_code

String

Error code returned if DCS instance backup fails. For details about error codes, see Table 4.

is_support_restore

String

An indicator of whether restoration is supported. Options: TRUE or FALSE.

Table 4 Error codes returned in case of a backup or restoration failure

Error Code

Description

dcs.08.0001

Failed to start the backup and restore tool.

dcs.08.0002

Operation timed out.

dcs.08.0003

Failed to delete bucket.

dcs.08.0004

Failed to obtain AK/SK.

dcs.08.0005

Failed to create bucket.

dcs.08.0006

Failed to obtain backup file size.

dcs.08.0007

Data synchronization failed during instance restoration.

dcs.08.0008

Automatic backup of the instance cannot start because the instance is running other jobs.

Example response

{
    "backup_record_response": [
        {
            "status": "succeed",
            "remark": "001",
            "period": null,
            "progress": "100.00",
            "size": 880232,
            "instance_id": "5560df16-cebf-4473-95c4-d1b573c16e79",
            "backup_id": "4631832a-14c6-45b0-a0b3-3abd8f591ad1",
            "created_at": "2019-05-10T08:31:16.166Z",
            "updated_at": "2019-05-10T08:32:30.546Z",
            "execution_at": "2019-05-10T08:31:21.461Z",
            "backup_type": "manual",
            "backup_name": "backup_20190510163116",
            "error_code": null,
            "is_support_restore": "TRUE"
        }
    ],
    "total_num": 1
}

Status Code

Table 5 describes the status code of successful operations. For details about other status codes, see Table 1.

Table 5 Status code

Status Code

Description

200

DCS instance backup records queried successfully.