This API is used to restore databases and tables at a point in time.
This API applies only to replica sets.
POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/restore/collections
Name |
Mandatory |
Description |
---|---|---|
project_id |
Yes |
Specifies the project ID of a tenant in a region. |
instance_id |
Yes |
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. |
Name |
Mandatory |
Type |
Description |
---|---|---|---|
restore_collections |
Yes |
Array of objects |
Specifies the database information. For details, see Table 3. |
Name |
Mandatory |
Type |
Description |
---|---|---|---|
database |
Yes |
String |
Specifies the database name. |
collections |
No |
Array of objects |
Specifies the collection information. For details, see Table 4. |
restore_database_time |
No |
String |
Specifies the database restoration time point. This parameter is mandatory for database-level restoration, The value is a UNIX timestamp, in milliseconds. The time zone is UTC. |
Name |
Mandatory |
Type |
Description |
---|---|---|---|
old_name |
Yes |
String |
Specifies the original table name before the restoration. |
new_name |
No |
String |
Specifies the table name after the restoration. |
restore_collection_time |
Yes |
String |
Specifies the collection restoration time point. The value is a UNIX timestamp, in milliseconds. The time zone is UTC. |
{ "restore_collections": [ { "database": "test", "restore_database_time": 1607762955000 } ] }
{ "restore_collections": [ { "database": "test", "collections": [ { "old_name": "test", "restore_collection_time": 1607762955000 } ] } ] }
Name |
Type |
Description |
---|---|---|
job_id |
String |
ID of the asynchronous task for the restore operation. |
{ "job_id": "a03b1b8a-b756-467c-8a49-38720c3d23ec" }
For details, see Abnormal Request Results.
For more information, see Error Code.