Clusters

Everything about PostgreSQL clusters.

List clusters

get

Retrieves a list of PostgreSQL clusters.

Authorizations
Query parameters
limitinteger · min: 1 · max: 1000Optional

The maximum number of elements to return. Use together with 'offset' for pagination.

Default: 100Example: 100
offsetintegerOptional

The first element to return. Use together with 'limit' for pagination.

Default: 0Example: 200
filter.namestringOptional

Response filter to list only the PostgreSQL clusters that contain the specified name. The value is case insensitive and matched on the 'displayName' field.

Responses
200
Successful operation.
application/json
Responseall of

List of clusters.

and
get
GET /databases/postgresql/clusters HTTP/1.1
Host: api.ionos.com
Authorization: Basic username:password
Accept: */*
{
  "type": "collection",
  "id": "498ae72f-411f-11eb-9d07-046c59cc737e",
  "items": [
    {
      "type": "cluster",
      "id": "498ae72f-411f-11eb-9d07-046c59cc737e",
      "metadata": {
        "createdDate": "2020-12-10T13:37:50+01:00",
        "createdBy": "[email protected]",
        "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
        "lastModifiedDate": "2020-12-11T13:37:50+01:00",
        "lastModifiedBy": "[email protected]",
        "lastModifiedByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
        "state": "AVAILABLE"
      },
      "properties": {
        "displayName": "PostgreSQL cluster",
        "postgresVersion": "13",
        "location": "de/fra",
        "dnsName": "pg.example.com",
        "backupLocation": "de",
        "instances": 2,
        "ram": 2048,
        "cores": 4,
        "storageSize": 15000,
        "storageType": "HDD",
        "connections": [
          {
            "datacenterId": "5a029f4a-72e5-11ec-90d6-0242ac120003",
            "lanId": "2",
            "cidr": "192.168.1.100/24"
          }
        ],
        "maintenanceWindow": {
          "time": "16:30:59",
          "dayOfTheWeek": "Monday"
        },
        "synchronizationMode": "ASYNCHRONOUS",
        "connectionPooler": {
          "enabled": true,
          "poolMode": "transaction"
        }
      }
    }
  ],
  "offset": 200,
  "limit": 100,
  "links": {
    "prev": "<PREVIOUS-PAGE-URI>",
    "self": "<THIS-PAGE-URI>",
    "next": "<NEXT-PAGE-URI>"
  }
}

Create a cluster

post

Creates a new PostgreSQL cluster. If the fromBackup field is populated, the new cluster will be created based on the given backup.

Authorizations
Body

Request payload with all data needed to create a new PostgreSQL cluster.

Responses
200
The created cluster is returned with `metadata.state` set to "BUSY".
application/json
post
POST /databases/postgresql/clusters HTTP/1.1
Host: api.ionos.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 956

{
  "metadata": {
    "createdDate": "2020-12-10T13:37:50+01:00",
    "createdBy": "[email protected]",
    "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "lastModifiedDate": "2020-12-11T13:37:50+01:00",
    "lastModifiedBy": "[email protected]",
    "lastModifiedByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "state": "AVAILABLE"
  },
  "properties": {
    "postgresVersion": "13",
    "instances": 2,
    "cores": 4,
    "ram": 2048,
    "storageSize": 15000,
    "storageType": "HDD",
    "connections": [
      {
        "datacenterId": "5a029f4a-72e5-11ec-90d6-0242ac120003",
        "lanId": "2",
        "cidr": "192.168.1.100/24"
      }
    ],
    "location": "de/fra",
    "backupLocation": "de",
    "displayName": "PostgreSQL cluster",
    "maintenanceWindow": {
      "time": "16:30:59",
      "dayOfTheWeek": "Monday"
    },
    "credentials": {
      "username": "db-admin",
      "password": "password123"
    },
    "synchronizationMode": "ASYNCHRONOUS",
    "fromBackup": {
      "backupId": "dcd31531-3ac8-11eb-9feb-046c59cc737e",
      "recoveryTargetTime": "2020-12-10T13:37:50+01:00"
    },
    "connectionPooler": {
      "enabled": true,
      "poolMode": "transaction"
    }
  }
}
{
  "type": "cluster",
  "id": "498ae72f-411f-11eb-9d07-046c59cc737e",
  "metadata": {
    "createdDate": "2020-12-10T13:37:50+01:00",
    "createdBy": "[email protected]",
    "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "lastModifiedDate": "2020-12-11T13:37:50+01:00",
    "lastModifiedBy": "[email protected]",
    "lastModifiedByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "state": "AVAILABLE"
  },
  "properties": {
    "displayName": "PostgreSQL cluster",
    "postgresVersion": "13",
    "location": "de/fra",
    "dnsName": "pg.example.com",
    "backupLocation": "de",
    "instances": 2,
    "ram": 2048,
    "cores": 4,
    "storageSize": 15000,
    "storageType": "HDD",
    "connections": [
      {
        "datacenterId": "5a029f4a-72e5-11ec-90d6-0242ac120003",
        "lanId": "2",
        "cidr": "192.168.1.100/24"
      }
    ],
    "maintenanceWindow": {
      "time": "16:30:59",
      "dayOfTheWeek": "Monday"
    },
    "synchronizationMode": "ASYNCHRONOUS",
    "connectionPooler": {
      "enabled": true,
      "poolMode": "transaction"
    }
  }
}

Fetch a cluster

get

You can retrieve a PostgreSQL cluster by using its ID. This value can be found in the response body when a PostgreSQL cluster is created or when you GET a list of PostgreSQL clusters.

Authorizations
Path parameters
clusterIdstringRequired

The unique ID of the cluster.

Example: 498ae72f-411f-11eb-9d07-046c59cc737e
Responses
200
Successful operation.
application/json
get
GET /databases/postgresql/clusters/{clusterId} HTTP/1.1
Host: api.ionos.com
Authorization: Basic username:password
Accept: */*
{
  "type": "cluster",
  "id": "498ae72f-411f-11eb-9d07-046c59cc737e",
  "metadata": {
    "createdDate": "2020-12-10T13:37:50+01:00",
    "createdBy": "[email protected]",
    "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "lastModifiedDate": "2020-12-11T13:37:50+01:00",
    "lastModifiedBy": "[email protected]",
    "lastModifiedByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "state": "AVAILABLE"
  },
  "properties": {
    "displayName": "PostgreSQL cluster",
    "postgresVersion": "13",
    "location": "de/fra",
    "dnsName": "pg.example.com",
    "backupLocation": "de",
    "instances": 2,
    "ram": 2048,
    "cores": 4,
    "storageSize": 15000,
    "storageType": "HDD",
    "connections": [
      {
        "datacenterId": "5a029f4a-72e5-11ec-90d6-0242ac120003",
        "lanId": "2",
        "cidr": "192.168.1.100/24"
      }
    ],
    "maintenanceWindow": {
      "time": "16:30:59",
      "dayOfTheWeek": "Monday"
    },
    "synchronizationMode": "ASYNCHRONOUS",
    "connectionPooler": {
      "enabled": true,
      "poolMode": "transaction"
    }
  }
}

Delete a cluster

delete

Delete a PostgreSQL cluster.

Authorizations
Path parameters
clusterIdstringRequired

The unique ID of the cluster.

Example: 498ae72f-411f-11eb-9d07-046c59cc737e
Responses
200
The deleted cluster with `metadata.state` set to "DESTROYING".
application/json
delete
DELETE /databases/postgresql/clusters/{clusterId} HTTP/1.1
Host: api.ionos.com
Authorization: Basic username:password
Accept: */*
{
  "type": "cluster",
  "id": "498ae72f-411f-11eb-9d07-046c59cc737e",
  "metadata": {
    "createdDate": "2020-12-10T13:37:50+01:00",
    "createdBy": "[email protected]",
    "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "lastModifiedDate": "2020-12-11T13:37:50+01:00",
    "lastModifiedBy": "[email protected]",
    "lastModifiedByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "state": "AVAILABLE"
  },
  "properties": {
    "displayName": "PostgreSQL cluster",
    "postgresVersion": "13",
    "location": "de/fra",
    "dnsName": "pg.example.com",
    "backupLocation": "de",
    "instances": 2,
    "ram": 2048,
    "cores": 4,
    "storageSize": 15000,
    "storageType": "HDD",
    "connections": [
      {
        "datacenterId": "5a029f4a-72e5-11ec-90d6-0242ac120003",
        "lanId": "2",
        "cidr": "192.168.1.100/24"
      }
    ],
    "maintenanceWindow": {
      "time": "16:30:59",
      "dayOfTheWeek": "Monday"
    },
    "synchronizationMode": "ASYNCHRONOUS",
    "connectionPooler": {
      "enabled": true,
      "poolMode": "transaction"
    }
  }
}

Patch a cluster

patch

Patch attributes of a PostgreSQL cluster.

Authorizations
Path parameters
clusterIdstringRequired

The unique ID of the cluster.

Example: 498ae72f-411f-11eb-9d07-046c59cc737e
Body

Request payload to change a cluster.

Responses
200
Successful operation.
application/json
patch
PATCH /databases/postgresql/clusters/{clusterId} HTTP/1.1
Host: api.ionos.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 680

{
  "metadata": {
    "createdDate": "2020-12-10T13:37:50+01:00",
    "createdBy": "[email protected]",
    "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "lastModifiedDate": "2020-12-11T13:37:50+01:00",
    "lastModifiedBy": "[email protected]",
    "lastModifiedByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "state": "AVAILABLE"
  },
  "properties": {
    "cores": 4,
    "ram": 2048,
    "storageSize": 15000,
    "connections": [
      {
        "datacenterId": "5a029f4a-72e5-11ec-90d6-0242ac120003",
        "lanId": "2",
        "cidr": "192.168.1.100/24"
      }
    ],
    "displayName": "PostgreSQL cluster",
    "maintenanceWindow": {
      "time": "16:30:59",
      "dayOfTheWeek": "Monday"
    },
    "postgresVersion": "13",
    "instances": 2,
    "connectionPooler": {
      "enabled": true,
      "poolMode": "transaction"
    }
  }
}
{
  "type": "cluster",
  "id": "498ae72f-411f-11eb-9d07-046c59cc737e",
  "metadata": {
    "createdDate": "2020-12-10T13:37:50+01:00",
    "createdBy": "[email protected]",
    "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "lastModifiedDate": "2020-12-11T13:37:50+01:00",
    "lastModifiedBy": "[email protected]",
    "lastModifiedByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "state": "AVAILABLE"
  },
  "properties": {
    "displayName": "PostgreSQL cluster",
    "postgresVersion": "13",
    "location": "de/fra",
    "dnsName": "pg.example.com",
    "backupLocation": "de",
    "instances": 2,
    "ram": 2048,
    "cores": 4,
    "storageSize": 15000,
    "storageType": "HDD",
    "connections": [
      {
        "datacenterId": "5a029f4a-72e5-11ec-90d6-0242ac120003",
        "lanId": "2",
        "cidr": "192.168.1.100/24"
      }
    ],
    "maintenanceWindow": {
      "time": "16:30:59",
      "dayOfTheWeek": "Monday"
    },
    "synchronizationMode": "ASYNCHRONOUS",
    "connectionPooler": {
      "enabled": true,
      "poolMode": "transaction"
    }
  }
}
Deprecated

List all PostgreSQL versions

get

Retrieves a list of all available PostgreSQL versions.

Authorizations
Responses
200
Successful operation.
application/json
get
GET /databases/postgresql/clusters/postgresversions HTTP/1.1
Host: api.ionos.com
Authorization: Basic username:password
Accept: */*
{
  "data": [
    {
      "name": "14"
    }
  ]
}

Supported PostgreSQL versions of cluster

get

Retrieves a list of all PostgreSQL versions available for this cluster.

Authorizations
Path parameters
clusterIdstringRequired

The unique ID of the cluster.

Example: 498ae72f-411f-11eb-9d07-046c59cc737e
Responses
200
Successful operation.
application/json
get
GET /databases/postgresql/clusters/{clusterId}/versions HTTP/1.1
Host: api.ionos.com
Authorization: Basic username:password
Accept: */*
{
  "data": [
    {
      "name": "14"
    }
  ]
}
Deprecated

List PostgreSQL versions

get

Retrieves a list of all PostgreSQL versions available for this cluster including the current version.

Authorizations
Path parameters
clusterIdstringRequired

The unique ID of the cluster.

Example: 498ae72f-411f-11eb-9d07-046c59cc737e
Responses
200
Successful operation.
application/json
get
GET /databases/postgresql/clusters/{clusterId}/postgresversions HTTP/1.1
Host: api.ionos.com
Authorization: Basic username:password
Accept: */*
{
  "data": [
    {
      "name": "14"
    }
  ]
}

Was this helpful?