Updated on 2022-02-22 GMT+08:00

Querying the Backup List

Function

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

URI

  • URI format

    GET /v3/{project_id}/backups?instance_id={instance_id}&backup_id={backup_id}&backup_type={backup_type}&offset={offset}&limit={limit}&begin_time={begin_time}&end_time={end_time}&mode={mode}

  • Parameter description
    Table 1 Parameter description

    Name

    Mandatory

    Description

    project_id

    Yes

    Specifies the project ID of a tenant in a region.

    instance_id

    No

    Specifies the DB instance ID.

    backup_id

    No

    Specifies the backup ID.

    backup_type

    No

    Specifies the backup type.

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

    offset

    No

    Specifies the index position. The query starts from the next instance 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, offset is set to 0 by default, indicating that the query starts from the latest created DB instance.

    limit

    No

    Specifies the maximum allowed number of backups to be queried.

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

    begin_time

    No

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

    NOTE:

    When end_time is not empty, begin_time is mandatory.

    end_time

    No

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

    NOTE:

    When begin_time is not empty, end_time is mandatory.

    mode

    No

    Specifies the DB instance mode.

    Valid value:

    • Sharding
    • ReplicaSet

Requests

  • Request header
    GET https://DDS endpoint/v3/97b026aa9cc4417888c14c84a1ad9860/backups?instance_id=c0c9f155c7b7423a9d30f0175998b63bin01&offset=0&limit=10&begin_time=2018-08-06 10:41:14&end_time=2018-08-16 10:41:14
  • Request body

    N/A

Responses

  • Parameter description
    Table 2 Parameter description

    Name

    Type

    Description

    backups

    Array of objects

    Indicates the backup list. For more information, see Table 3.

    total_count

    Integer

    Indicates the total number of queried records.

    Table 3 backups field data structure description

    Name

    Type

    Description

    id

    String

    Indicates the backup ID.

    name

    String

    Indicates the backup name.

    instance_id

    String

    Indicates the ID of the DB instance for which the backup is created.

    instance_name

    String

    Indicates the name of the DB instance for which the backup is created.

    datastore

    Object

    Indicates the database version. For more information, see Table 4.

    type

    String

    Indicates the backup type.

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

    begin_time

    String

    Indicates the 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

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

    status

    String

    Indicates the backup status. Valid value:

    • BUILDING: Backup in progress
    • COMPLETED: Backup completed
    • FAILED: Backup failed
    • DISABLED: Backup being deleted

    size

    Long

    Indicates the backup size in KB.

    description

    String

    Indicates the backup description.

    Table 4 datastore field data structure description

    Name

    Type

    Description

    type

    String

    Indicates the DB engine.

    Valid value: DDS-Community.

    version

    String

    Indicates the database of version 3.2 or 3.4. Its value is 3.2 or 3.4.

  • Response example
    { 
     "backups": [ 
        { 
            "id": "43e4feaab48f11e89039fa163ebaa7e4br01", 
            "name": "backup-test", 
            "instance_id": "43e4feaab48f11e89039fa163ebaa7e4br01", 
            "instance_name": "cluster-test",
            "datastore" : {  
                   "type" : "DDS-Community",  
                   "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"
         } 
       ], 
       "total_count":1 
    }

Status Code

For more information, see Status Code.

Error Code

For more information, see Error Code.