InitiatePITRRestore#

Description#

Request to start restoring a PostgreSQL service to a specified point in time. PostgreSQL services only, starting with environment version paas_v4_3, with backup configured using the wal-g method.

Request Parameters#

Required parameters#

  • backupName — The name of the base WAL-G backup from which the restore starts.

    • Type: String

    • Required: Yes

  • serviceId — The PaaS service ID.

    • Type: String

    • Required: Yes

Optional parameters#

  • time — The point in time to restore to, in Unix epoch format. If omitted, the service is restored to the latest available point in time.

    • Type: Integer

    • Required: No

  • timeline — The WAL timeline ID. If omitted, it is chosen from the backup.

    • Type: String

    • Required: No

Response Elements#

  • taskId — The restore task ID.

    • Type: String

Examples#

Managing PaaS services in K2 Cloud via API requires a customized version of the boto3 library:

import boto3

session = boto3.Session(
    aws_access_key_id="<AWS_ACCESS_KEY_ID>",
    aws_secret_access_key="<AWS_SECRET_ACCESS_KEY>",
    region_name="",
)

paas_client = session.client(
    'paas',
    endpoint_url='https://paas.ru-msk.k2.cloud/',
)

resp = paas_client.initiate_pitr_restore(
    serviceId='fm-cluster-1ACD3963',
    backupName='base_0000000100000000000000A1',
    time=1780315200,
)
task_id = resp['taskId']

Or c2-paas utility from K2 Cloud API Client software suite:

c2-paas InitiatePITRRestore serviceId fm-cluster-1ACD3963 backupName base_0000000100000000000000A1 time 1780315200