Restoring Data to the Original or Existing Instance
Function
This API is used to restore data to the original DB instance or an existing DB instance. Before calling this API:
- Learn how to authenticate this API.
URI
POST https://{endpoint}/v3/{project_id}/instances/recovery
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Explanation: Project ID of a tenant in a region. For details about how to obtain the project ID, see Obtaining a Project ID. Restrictions: None Value range: The value can contain 32 characters. Only letters and digits are allowed. Default value: None |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| source | Yes | Object | Instance from which the backup was created. For details, see Table 3. |
| target | Yes | Object | The instance to which the backup is restored. For details, see Table 4. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| instance_id | Yes | String | DB instance ID. |
| type | Yes | String | Restoration type. The available values are as follows:
|
| backup_id | No | String | Backup ID used for restoration. It indicates the ID of the full backup corresponding to schema_type. This parameter must be specified when backups are used for restoration. |
| restore_time | No | String | Timestamp to which data is restored to using point-in-time recovery. You can query the available time range by calling the Querying the Restoration Time Range API. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| instance_id | Yes | String | ID of the DB instance which the backup will be restored to.
|
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| job_id | String | Task ID. |
Example Request
Restoring data to the original or existing instance
POST https://gaussdb-opengauss.eu-west-101.myhuaweicloud.eu/v3/0c8243400d37468bb4aed3cc94c2911d/instances/recovery
{
"source" : {
"instance_id" : "5362449138da4e408dbae5152ca26640in14",
"type" : "backup",
"backup_id" : "cc94568cb5a54e4a8ab5dff95e64a5e0br14"
},
"target" : {
"instance_id" : "5362449138da4e408dbae5152ca26640in14"
}
} Example Response
Data restored to the original or existing instance.
{
"job_id" : "a03b1b8a-b756-467c-8a49-38720c3d23ec"
} Status Code
- Normal
- Abnormal
For details, see Status Codes.
Error Code
For details, see Error Codes.