Help Center/ Relational Database Service/ API Reference/ API v3 (Recommended)/ Backup and Restoration/ Restoring Tables to a Specified Point in Time (RDS for PostgreSQL)
Updated on 2024-08-28 GMT+08:00

Restoring Tables to a Specified Point in Time (RDS for PostgreSQL)

Function

This API is used to restore tables of a DB instance to a point in time.

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

URI

  • URI format

    POST /v3/{project_id}/instances/batch/restore/tables

  • Parameter description
    Table 1 Parameters

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Project ID of a tenant in a region.

    For details about how to obtain the project ID, see Obtaining a Project ID.

Request

  • Parameter description
    Table 2 Parameters

    Parameter

    Mandatory

    Type

    Description

    instances

    No

    Array of objects

    Table information. For details, see Table 3.

    Table 3 Data structure of the instances field

    Parameter

    Mandatory

    Type

    Description

    restore_time

    No

    Long

    Point in time to which the tables are restored.

    instance_id

    No

    String

    Instance ID.

    databases

    No

    Array of objects

    Database information. For details, see Table 4.

    Table 4 Data structure of the databases field

    Parameter

    Mandatory

    Type

    Description

    database

    No

    String

    Database name.

    schemas

    No

    Array of objects

    Schema information For details, see Table 5.

    Table 5 Data structure of the schemas field

    Parameter

    Mandatory

    Type

    Description

    schema

    No

    String

    Schema information.

    tables

    No

    Array of objects

    Table information. For details, see Table 6.

    Table 6 Data structure of the tables field

    Parameter

    Mandatory

    Type

    Description

    old_name

    No

    String

    Original table name before the restoration.

    new_name

    No

    String

    Table name after the restoration.

  • Example request
    POST https://{endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/instances/batch/restore/tables 
    
    { 
            "instances": [{ 
                   "restore_time": 1688556737000, 
                   "instance_id": "df29b535eec64ee1b286bd2c62871a9cin03", 
                   "databases": [{ 
                          "database": "data1", 
                          "schemas": [{ 
                                 "schema": "schema1", 
                                 "tables": [{ 
                                        "old_name": "table1", 
                                        "new_name": "table1_1688556737000" 
                                 }] 
                          }], 
                   }] 
            }] 
     }

Response

  • Normal response
    Table 7 Parameters

    Parameter

    Type

    Description

    restore_result

    Array of objects

    Table information. For details, see Table 8.

    Table 8 Data structure of the restore_result field

    Parameter

    Type

    Description

    instance_id

    String

    Instance ID.

    job_id

    String

    Workflow ID.

  • Example normal response
    {
      "restore_result" : [ { 
        "instance_id" : "df29b535eec64ee1b286bd2c62871a9cin03", 
        "job_id" : "749d6254-f4f0-4f72-aa32-876e220d2496" 
      } ] 
    }
  • Abnormal response

    For details, see Abnormal Request Results.

Status Code

Error Code

For details, see Error Codes.