Restoring a Database from a Read Replica to the Primary DB Instance
Function
This API is used to restore a database from a read replica to the primary DB instance.
- Before calling this API, learn how to authenticate it.
- Before calling this API, learn about request header parameters.
Constraints
- To use this function, contact customer service.
- This API is available only to read replicas of RDS for PostgreSQL 12 or later.
URI
- Parameter description
Table 1 Parameters Parameter
Mandatory
Description
project_id
Yes
Definition
Project ID of a tenant in a region.
To obtain the value, see Obtaining a Project ID.
Constraints
N/A
Range
N/A
Default Value
N/A
instance_id
Yes
Definition
ID of the instance to be queried.
Constraints
N/A
Range
N/A
Default Value
N/A
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
databases |
Yes |
Array of objects |
Definition Databases to be restored. For details, see Table 3. Constraints N/A Range N/A Default Value N/A |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
old_name |
Yes |
String |
Definition Name of the original database to be restored. Constraints N/A Range N/A Default Value N/A |
new_name |
Yes |
String |
Definition Name of the new database after the restoration. Constraints N/A Range N/A Default Value N/A |
Example Request
Restore a database from a read replica to the primary DB instance.
POST https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/794c38e5309344818f4b33b86ebce9b4in03/log-replay/database { "databases" : [ { "old_name" : "old", "new_name" : "new" } ] }
Response
- Normal response
Table 4 Parameters Parameter
Type
Description
job_id
String
Definition
Task flow ID.
Range
N/A
- Example normal response
{ "job_id" : "8465d1fb-20a8-48e6-9c9b-3d1958ecbb9e" }
- 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