Cluster upgrade

Cluster upgrades are an asynchronous operation that can change a cluster’s disk size, high availability configuration, or Postgres major version. In most cases a cluster upgrade involves spinning up a new server with new configuration, waiting for it to catch up to the original, then failing over so that the replacement takes the place of the original.

The standard upgrade process involves POSTing to a cluster’s /upgrade endpoint, observing the upgrade’s process using the GET endpoint, and optionally cancelling the operation using upgrade DELETE.

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.

The ClusterUpgrade API resource

Response for the status of a cluster upgrade.

Content type: application/json

Name Nullable Type Description
operations array of object of type ClusterUpgradeOperation

Contains ongoing upgrade operations. Empty if there are no ongoing upgrade operations.

Example

{
    "operations": [
        {
            "flavor": "ha_change",
            "state": "waiting_for_ha_standby"
        },
        {
            "flavor": "resize",
            "state": "in_progress"
        }
    ]
}

The ClusterUpgradeOperation object

An ongoing upgrade operation (like a version upgrade or resize) within a database cluster.

Name Nullable Type Description
flavor enum string

The kind of upgrade.

Enum ha_change, major_version_upgrade, or resize.

state enum string

The state of the ongoing resize.

One of ready, scheduled, in_progress, or failing_over for a major version upgrade or resize.

One of enabling_ha, waiting_for_ha_standby or disabling_ha for an HA change.

Enum disabling_ha, enabling_ha, failing_over, in_progress, ready, scheduled, or waiting_for_ha_standby.

Get upgrade status

Get the status of an ongoing cluster resize.

GET /clusters/{cluster_id}/upgrade

Request

Path parameters

  • cluster_id: The ID of the cluster.

cURL example

curl -X GET https://api.crunchybridge.com/clusters/{cluster_id}/upgrade
    -H "Authorization: Bearer $CRUNCHY_ACCESS_TOKEN"

Response

Status: 200

Responds with the standard ClusterUpgrade API resource.

Upgrade cluster

Start a cluster upgrade which may include changing its plan, upgrading its major version, increasing its storage size, or changing its high availability status.

POST /clusters/{cluster_id}/upgrade

Request

Path parameters

  • cluster_id: The ID of the cluster.

Request body schema

Content type: application/json

Name Required Type Description
is_ha boolean

Changes the high availability status of the cluster.

plan_id string

The new ID of the plan to change the cluster to.

postgres_­version_­id integer, or string

An identifier for the Postgres version to retrieve. May be either the primary ID of a Postgres version or a major version number like “14”.

storage integer

The new storage size for the cluster in GB.

major_version integer

The Postgres major version number to upgrade the cluster to.

Deprecated Prefer sending a value to postgres_version_id instead which will also accept a major version number value.

Example request body

{
    "plan_id": "standard-64",
    "postgres_version_id": null,
    "storage": 100
}

cURL example

curl -X POST https://api.crunchybridge.com/clusters/{cluster_id}/upgrade
    -H "Authorization: Bearer $CRUNCHY_ACCESS_TOKEN"
    -H "Content-Type: application/json"
    -d '{"plan_id":"standard-64","postgres_version_id":null,"storage":100}'

Response

Status: 201

Responds with the standard ClusterUpgrade API resource.

Cancel upgrade

Cancel a cluster resize.

DELETE /clusters/{cluster_id}/upgrade

Request

Path parameters

  • cluster_id: The ID of the cluster.

cURL example

curl -X DELETE https://api.crunchybridge.com/clusters/{cluster_id}/upgrade
    -H "Authorization: Bearer $CRUNCHY_ACCESS_TOKEN"

Response

Status: 204