Point-In-Time Recovery Endpoints
This section describes the usage and specifics of the available Point-in-Time recovery endpoints of the a9s Public API V1.
Before you can access any of the mentioned endpoints, you have to follow the steps mentioned in Accessing the a9s Public API.
These endpoints are only available for a9s PostgreSQL instances with the continuous archiving setting enabled.
Point-In-Time Recovery - Get Available Time Range
This request fetches the available time range from where a backup can be selected for the restore process of the instance.
Route
GET /v1/instances/:instance_id/pitr
cURL
curl --insecure --header "Content-Type: application/json" --header "Authorization: $(bearer_token)" \
"${url}/pitr"
Response
Body
For success responses, the following fields are defined:
| Response Field | Type | Description |
|---|---|---|
start_time | datetime | The start (oldest) date of the continuous archiving, from which a backup can be fetched, in ISO 8601 UTC time. |
end_time | datetime | The end (newest) date of the continuous archiving, from which a backup can be fetched, in ISO 8601 UTC time. |
Example
{
"start_time":"2022-02-01T20:53:20.000Z",
"end_time":"2022-02-02T11:45:37.601Z"
}
For error responses, the following fields are defined:
| Response Field | Type | Description |
|---|---|---|
error | string | A single word in camel case that uniquely identifies the error condition. |
description | string | A user-facing error message explaining why the request failed. |
Status
| Status Code | Description |
|---|---|
200 OK | If the request has been processed successfully. |
202 Accepted | The request has been accepted for processing, but the processing has not been completed. The request might or might not eventually be acted upon, as it might be disallowed when processing actually takes place. There is no facility for re-sending a status code from an asynchronous operation such as this. |
401 Unauthorized | The user does not have valid authentication credentials for the target resource. |
403 Forbidden | The user does not have the required right to do this request. |
404 Not Found | Entity not found. |
409 Conflict | There is already such action in progress. |
500 Internal Server Error | An unexpected error occurred while handling the request. |
502 Bad Gateway | An error occurred during upstream communication. |
504 Gateway Timeout | A timeout occurred during upstream communication. |
Point-In-Time Recovery - Restore to a Target Time
This request triggers the restore process of a Service Instance, which uses the backup closest to the target date.
Route
POST /v1/instances/:instance_id/pitr/restore
Body
The body must be sent in valid JSON format.
| Response Field | Type | Description |
|---|---|---|
target_time | datetime | The date (within range) from which the backup should be fetched, in ISO 8601 UTC time. |
cURL
curl -X POST --insecure --header "Content-Type: application/json" --header "Authorization: $(bearer_token)" \
--data '{"target_time":"<point_in_time>"}' "${url}/pitr/restore"
Response
Body
For success responses, the following fields are defined:
| Response Field | Type | Description |
|---|---|---|
status | string | The status of the task. The following statuses exist: queued, running, done, failed, deleted. |
Example
{
"status":"queued"
}
For error responses, the following fields are defined:
| Response Field | Type | Description |
|---|---|---|
error | string | A single word in camel case that uniquely identifies the error condition. |
description | string | A user-facing error message explaining why the request failed. |
Status
| Status Code | Description |
|---|---|
200 OK | If the request has been processed successfully. |
202 Accepted | The request has been accepted for processing, but the processing has not been completed. The request might or might not eventually be acted upon, as it might be disallowed when processing actually takes place. There is no facility for re-sending a status code from an asynchronous operation such as this. |
401 Unauthorized | The user does not have valid authentication credentials for the target resource. |
403 Forbidden | The user does not have the required right to do this request. |
404 Not Found | Entity not found. |
409 Conflict | There is already such action in progress. |
500 Internal Server Error | An unexpected error occurred while handling the request. |
502 Bad Gateway | An error occurred during upstream communication. |
504 Gateway Timeout | A timeout occurred during upstream communication. |