Restoring Databases and Tables to a Point in Time
Description
This API is used to restore databases and tables at a point in time.
Constraints
This API applies only to replica sets.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
dds:instance:restore
write
-
-
dds:backup:refreshInstanceFromBackup
-
URI
|
Name |
Type |
IN |
Mandatory |
Description |
|---|---|---|---|---|
|
X-Auth-Token |
string |
header |
Yes |
User token obtained from IAM. For details, see Authentication. |
|
X-Language |
string |
header |
No |
Language |
|
project_id |
string |
path |
Yes |
Project ID. To obtain the project ID, see Obtaining a Project ID. |
|
instance_id |
string |
path |
Yes |
Instance ID, which can be obtained by calling the API described in Querying Instances and Details. If you do not have an instance, call the API described in Creating a DB Instance to create one. |
Request
- Parameter description
Table 2 Parameter description Name
Type
Mandatory
Description
restore_collections
Array of objects
Yes
The database information.
For details, see Table 3.
Table 3 restore_collections data structure description Name
Type
Mandatory
Description
database
String
Yes
Database name.
collections
Array of objects
No
The collection information.
For details, see Table 4.
restore_database_time
String
No
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.
Table 4 collections data structure description Name
Type
Mandatory
Description
old_name
String
Yes
The table name before the restoration.
new_name
String
No
The table name after the restoration.
restore_collection_time
String
Yes
The collection restoration time point.
The value is a UNIX timestamp, in milliseconds. The time zone is UTC.
Example Request
- Restoring a database-level backup (The database name is test.)
{ "restore_collections": [ { "database": "test", "restore_database_time": 1607762955000 } ] } - Restoring a collection-level backup (The table name before the restoration is test.)
{ "restore_collections": [ { "database": "test", "collections": [ { "old_name": "test", "restore_collection_time": 1607762955000 } ] } ] }
Response
- Parameter description
Table 5 Parameter description Name
Type
Mandatory
Description
job_id
String
Yes
ID of the asynchronous task for the restore operation.
- Example Response
{ "job_id": "a03b1b8a-b756-467c-8a49-38720c3d23ec" }
SDK
Click Document Database Service DDS SDK to download the SDK or view the SDK document. To learn how to install and authenticate an SDK, read the Usage section.
Status Code
For more information, see Status Code.
Error Code
For more information, see Error Code.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot