Skip to main content
Version: 72.0.0

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.

info

Before you can access any of the mentioned endpoints, you have to follow the steps mentioned in Accessing the a9s Public API.

caution

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 FieldTypeDescription
start_timedatetimeThe start (oldest) date of the continuous archiving, from which a backup can be fetched, in ISO 8601 UTC time.
end_timedatetimeThe 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 FieldTypeDescription
errorstringA single word in camel case that uniquely identifies the error condition.
descriptionstringA user-facing error message explaining why the request failed.

Status

Status CodeDescription
200 OKIf the request has been processed successfully.
202 AcceptedThe 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 UnauthorizedThe user does not have valid authentication credentials for the target resource.
403 ForbiddenThe user does not have the required right to do this request.
404 Not FoundEntity not found.
409 ConflictThere is already such action in progress.
500 Internal Server ErrorAn unexpected error occurred while handling the request.
502 Bad GatewayAn error occurred during upstream communication.
504 Gateway TimeoutA 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 FieldTypeDescription
target_timedatetimeThe 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 FieldTypeDescription
statusstringThe 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 FieldTypeDescription
errorstringA single word in camel case that uniquely identifies the error condition.
descriptionstringA user-facing error message explaining why the request failed.

Status

Status CodeDescription
200 OKIf the request has been processed successfully.
202 AcceptedThe 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 UnauthorizedThe user does not have valid authentication credentials for the target resource.
403 ForbiddenThe user does not have the required right to do this request.
404 Not FoundEntity not found.
409 ConflictThere is already such action in progress.
500 Internal Server ErrorAn unexpected error occurred while handling the request.
502 Bad GatewayAn error occurred during upstream communication.
504 Gateway TimeoutA timeout occurred during upstream communication.