Querying the Backup List

Function

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

URI

  • URI format

    GET https://{Endpoint}/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 instance ID, which can be obtained by calling the API for querying instances. If you do not have an instance, you can call the API used for creating an instance.

    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

    • Single

Requests

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 from which the backup was created. You can obtain the ID by calling the API for querying DB instances. If you do not have an instance, you can call the API used for creating an instance.

    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, 3.4, 4.0, 4.2, or 4.4. The value is 3.2, 3.4, 4.0, 4.2, or 4.4.

  • Response example

    {
     "backups": [
        {
            "id": "43e4feaab48f11e89039fa163ebaa7e4br01",
            "name": "backup-test",
            "instance_id": "43e4feaab48f11e89039fa163ebaa7e4br01",
            "instance_name": "cluster-test",
            "datastore" : {
                   "type" : "DDS-Community",
                   "version" : "4.0"
            },
            "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

Status Code:200.

For more information, see Status Code.

Error Code

For more information, see Error Code.