Cluster backup
List cluster backups and get pgBackRest configuration.
Backups are initiated automatically on a daily basis, and retained for about a week. New backups can be requested through the start backup endpoint.
Part of the API reference collection
This page is part of the Crunchy Bridge API reference, and primarily meant to act as an exhaustive guide for technical integrations which are already in progress. To understand the basics of using the API, see API concepts and getting started.
List backups
List available backups for a cluster.
This endpoint's pagination may be ordered through the order_field
parameter
by name
only.
GET /clusters/{cluster_id}/backups
Request
Path parameters
cluster_id
: ID of the cluster for which to get backups for.
Query parameters
Name | Required | Type | Description |
---|---|---|---|
cursor | string | Return only items starting after this cursor ID. When paginating, pass the value of Cursor values depend on the field in | |
limit | integer | The maximum number of items to return on the page. Defaults to | |
order | string | The order of pagination. Enum | |
order_field | string | The name of the field on which to paginate like |
cURL example
curl -X GET https://api.crunchybridge.com/clusters/{cluster_id}/backups
-H "Authorization: Bearer $CRUNCHY_API_KEY"
Response
Status: 200
Response for a list of cluster backups.
Content type: application/json
Name | Nullable | Type | Description |
---|---|---|---|
backups | array of array | The list of cluster backups. |
Example
{
"backups": [
{
"finished_at": "2022-05-07T01:00:02Z",
"lsn_start": "AE0/9E000028",
"lsn_stop": "AE0/A0051F10",
"name": "2020/20200913-195337F",
"size_bytes": 1852406161,
"started_at": "2022-05-07T01:02:36Z",
"type": ""
}
]
}
Create backup token
Create backup token for configuring pgBackRest to restore from a cluster backup.
The endpoint returns configuration for a cloud provider's blob store (e.g. like Amazon's S3) which is the location of a pgBackRest repository. Configuring pgBackRest with this information will allow it to restore from the cluster's backups which are generated periodically as part of normal operation.
POST /clusters/{cluster_id}/backup-tokens
Request
Path parameters
cluster_id
: ID of the cluster to create a backup token for.
cURL example
curl -X POST https://api.crunchybridge.com/clusters/{cluster_id}/backup-tokens
-H "Authorization: Bearer $CRUNCHY_API_KEY"
Response
Status: 201
Content type: application/json
Name | Nullable | Type | Description |
---|---|---|---|
id | string in EID format | The primary ID of the backup token. Note that backup tokens aren't persisted in Bridge, so this can be used as a convenient way to uniquely identify a backup token, but not for much else. | |
aws | object of type AWSBackupToken object | AWS pgBackRest credentials. Set for a cluster that's on the AWS provider, and omitted otherwise. | |
azure | object of type AzureBackupToken object | Azure pgBackRest credentials. Set for a cluster that's on the Azure provider, and omitted otherwise. | |
cluster_id | string in EID format | The ID of the associated cluster. | |
gcp | object of type GCPBackupToken object | GCP pgBackRest credentials. Set for a cluster that's on the GCP provider, and omitted otherwise. | |
repo_path | string | The pgBackRest repository path. | |
stanza | string | The name of the configuration section for the target cluster in pgBackRest (pgBackRest supports multiple stanzas, but in practice there will only be one for a Bridge cluster). This name could be inferred through the use of other configuration parameters, but putting its value here allows pgBackRest to be configured locally more easily. | |
team_id | string in EID format | The ID of the team which owns the associated cluster. | |
type | enum string | Type of storage used for the repository and which to be used for pgBackRest configuration. Enum |
Example
{
"aws": {
"s3_bucket": "the-bucket",
"s3_key": "key",
"s3_key_secret": "secret",
"s3_kms_key_id": null,
"s3_region": "us-west-1",
"s3_token": "token"
},
"cluster_id": "rvf73a77ozfsvcttryebfrnlem",
"id": "agaqf6fanse45vspjcctakuyky",
"repo_path": "/the-path",
"stanza": "2qc6yv2ztfcw7a7yoripu4zlsm",
"team_id": "eaevtjiudzeq7bsqbbpiscund4",
"type": "s3"
}
The AWSBackupToken
object
pgBackRest configuration relevant for a cluster hosted on AWS.
Name | Nullable | Type | Description |
---|---|---|---|
s3_bucket | string | S3 bucket used to store the repository. | |
s3_key | string | S3 repository access key. | |
s3_key_secret | string | S3 repository secret access key. | |
s3_kms_key_id | ✔ | string | AWS KMS (Key Management Service) key used for at-rest encryption of the S3 repository. |
s3_region | string | S3 repository region. | |
s3_token | string | S3 repository security token. |
The AzureBackupToken
object
pgBackRest configuration relevant for a cluster hosted on Azure.
Name | Nullable | Type | Description |
---|---|---|---|
azure_account | string | Azure account used to store the repository. | |
azure_container | string | Azure container used to store the repository. | |
azure_key | string | Azure repository key. | |
azure_key_type | enum string | Azure repository key type. The following types are supported for authorization: * Enum |
The GCPBackupToken
object
pgBackRest configuration relevant for a cluster hosted on GCP.
Name | Nullable | Type | Description |
---|---|---|---|
gcs_bucket | string | GCS bucket used to store the repository. |