Restoring Databases to a Specified Point in Time
Function
This API is used to restore databases to a specified point in time.
- Before calling this API, learn how to authenticate it.
- Before calling this API, learn about the request header parameters.
Authorization Information
- If you are using role/policy-based authorization, see Permissions 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 |
|---|---|---|---|---|---|
|
rds:instance:tableRestore |
write |
- |
- |
- |
- |
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
Definition
Project ID of a tenant in a region.
Constraints
The value cannot be empty.
Range
To obtain the value, see Obtaining a Project ID.
Default Value
N/A
Request
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
instances |
Yes |
Array of objects |
Definition Instance information. For details, see Table 3. Constraints N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
restore_time |
Yes |
Long |
Definition Restoration time point. A timestamp in milliseconds is used. Constraints N/A Range N/A Default Value N/A |
|
instance_id |
Yes |
String |
Definition Instance ID. Constraints N/A Range You can obtain the value of this parameter from id in Table 4 by calling the API for querying databases that can be restored to a specified point in time. Default Value N/A |
|
databases |
Yes |
Array of objects |
Definition Database information. For details, see Table 4. Constraints N/A |
|
is_fast_restore |
No |
Boolean |
Definition Whether fast restoration is used. Constraints
Range
Default Value N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
old_name |
Yes |
String |
Definition Name of the database before restoration. Constraints N/A Range You can obtain the value of this parameter from name in Table 5 by calling the API for querying databases that can be restored to a specified point in time. Default Value N/A |
|
new_name |
Yes |
String |
Definition Name of the database after restoration. Constraints N/A Range 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. Default Value N/A |
Example Request
Restore databases of an RDS for MySQL instance to a specified point in time.
POST https://{endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/instances/batch/restore/databases
{
"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
Definition
Database-level PITR task details. For details, see Table 6.
- Example normal response
Restoring databases of an RDS for MySQL instance 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