Restoring Databases to a Specified Point in Time
Function
This API is used to restore databases to a specified point in time.
- Before calling an API, you need to understand the API in Authentication.
Constraints
- This API is available to RDS for MySQL and RDS for PostgreSQL only.
- Database-level restoration is not supported for databases that contain tables with JSON virtual columns.
- Database-level restoration is not supported for databases whose names contain Chinese characters.
- Fast restoration is not supported for XA transactions.
URI
- URI format
- 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.
Request
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
instances |
Yes |
Array of objects |
Instance information. For details, see Table 3. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
restore_time |
Yes |
Long |
Restoration time point. A timestamp in milliseconds is used. |
instance_id |
Yes |
String |
Instance ID. Only RDS for MySQL instances are supported. |
databases |
Yes |
Array of objects |
Database information. For details, see Table 4. |
is_fast_restore |
No |
Boolean |
Whether to use fast restoration. The value can be true or false.
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
old_name |
Yes |
String |
Name of the database before restoration. The database name cannot contain Chinese characters. |
new_name |
Yes |
String |
Name of the database after restoration. The database name can contain letters, digits, hyphens (-), underscores (_), and dollar signs ($). The new database name cannot be the same as the original database name. |
Example Request
Restore databases of an RDS for MySQL instance to a specified point in time.
{ "instances" : [ { "instance_id" : "5d742eda6e574ff3a003191638ef8c51in01", "restore_time" : 1699323939000, "databases" : [ { "old_name" : "dbtest", "new_name" : "dbtest_restore" } ] } ] }
Response
- Normal response
Table 5 Parameters Parameter
Type
Description
restore_result
Array of objects
Database-level PITR task details. For details, see Table 6.
- Example normal response
Restoring databases to a specified point in time:
{ "restore_result" : [ { "instance_id" : " 5d742eda6e574ff3a003191638ef8c51in01", "job_id" : "749d6254-f4f0-4f72-aa32-876e220d2496" } ] }
- Abnormal response
For details, see Abnormal Request Results.
Status Code
- Normal
- Abnormal
For details, see Status Codes.
Error Code
For details, see Error Codes.
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