Help Center/ Relational Database Service/ API Reference/ API v3 (Recommended)/ Backup and Restoration/ Querying Databases That Can Be Restored to a Specified Point in Time
Updated on 2024-08-28 GMT+08:00

Querying Databases That Can Be Restored to a Specified Point in Time

Function

This API is used to query databases that can be restored to a specified point in time.

  • Before calling an API, you need to understand the API in Authentication.

Constraints

This API is only available to RDS for MySQL and RDS for PostgreSQL.

URI

  • URI format

    POST /v3/{project_id}/{engine}/instances/history/databases

  • Parameter description
    Table 1 Parameters

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Project ID of a tenant in a region.

    To obtain it, refer to Obtaining a Project ID.

    engine

    Yes

    DB engine.

    The value can be mysql (case-insensitive).

Request

Table 2 Parameters

Parameter

Mandatory

Type

Description

instance_ids

Yes

Array of strings

Instance IDs.

restore_time

Yes

Long

Restoration time point. A timestamp in milliseconds is used.

database_name_like

No

String

Database name, which can be used for fuzzy query. The database name cannot contain Chinese characters.

instance_name_like

No

String

Instance name, which can be used for fuzzy query.

Example Request

Query the databases that can be restored to a specified point in time of an RDS for MySQL instance.

 {
   "instance_ids" : [ "5d742eda6e574ff3a003191638ef8c51in01" ],  
   "restore_time" : 1688554422000,  
   "database_name_like" : "",  
   "instance_name_like" : ""  
}

Response

  • Normal response
    Table 3 Parameters

    Parameter

    Type

    Description

    database_limit

    Integer

    Maximum number of databases that can be restored for a single instance. If the number of databases queried exceeds this limit, only the databases within this limit are returned in the response.

    table_limit

    Integer

    Maximum number of tables in all databases that can be restored for a single instance. If the number of tables queried exceeds this limit, only the databases whose total number of tables is within this limit are returned in the response.

    instances

    Array of objects

    Instance information. For details, see Table 4.

    Table 4 Data structure of the instances field

    Parameter

    Type

    Description

    id

    String

    Instance ID.

    name

    String

    Instance name.

    total_tables

    Integer

    Total number of tables in all restorable databases of the instance. This value cannot exceed the value of table_limit.

    databases

    Array of objects

    Database information. For details, see Table 5.

    Table 5 Data structure of the databases field

    Parameter

    Type

    Description

    name

    String

    Database name. Databases whose names contain Chinese characters will be filtered out and cannot be restored.

    total_tables

    Integer

    Total number of tables in the database. This value cannot exceed the value of table_limit.

  • Example normal response

    Querying databases that can be restored to a specified point in time:

    {
        "instances": [
            {
                "id": "5d742eda6e574ff3a003191638ef8c51in01",
                "name": "AUTO-GENERATED-INSTANCE-57-HA-LOCALSSD",
                "databases": [
                    {
                        "name": "dbtest",
                        "total_tables": 1
                    },
                    {
                        "name": "dbtest_restore",
                        "total_tables": 1
                    }
                ],
                "total_tables": 2
            }
        ],
        "database_limit": 2000,
        "table_limit": 20000
    }
  • Abnormal response

    For details, see Abnormal Request Results.

Status Code

Error Code

For details, see Error Codes.