Comment on page
ClustersApi
All URIs are relative to https://api.ionos.com/databases/postgresql
Method | HTTP request | Description |
---|---|---|
GET /clusters/{clusterId}/postgresversions | List PostgreSQL versions | |
DELETE /clusters/{clusterId} | Delete a cluster | |
GET /clusters/{clusterId} | Fetch a cluster | |
GET /clusters | List clusters | |
PATCH /clusters/{clusterId} | Patch a cluster | |
POST /clusters | Create a cluster | |
GET /clusters/postgresversions | List PostgreSQL versions |
clusterPostgresVersionsGet(clusterId)
List PostgreSQL versions
Retrieves a list of all PostgreSQL versions available for this cluster including the current version.
const ionoscloud = require('@ionos-cloud/sdk-nodejs-dbaas-postgres');
// setup authorization
const config = new ionoscloud.Configuration({
username: 'YOUR_USERNAME',
password: 'YOUR_PASSWORD',
apiKey: 'YOUR_API_KEY'
});
const api_instance = new ionoscloud.ClustersApi(config);
// List PostgreSQL versions
api_instance
.clusterPostgresVersionsGet({
clusterId: 498ae72f-411f-11eb-9d07-046c59cc737e
})
.then((response) => console.log(response.data))
.catch((error) => console.log(error.response.data));
Name | Type | Description | Notes |
---|---|---|---|
clusterId | string | The unique ID of the cluster. | [default to undefined] |
basicAuth, tokenAuth
- Content-Type: Not defined
- Accept: application/json
clustersDelete(clusterId)
Delete a cluster
Delete a PostgreSQL cluster.
const ionoscloud = require('@ionos-cloud/sdk-nodejs-dbaas-postgres');
// setup authorization
const config = new ionoscloud.Configuration({
username: 'YOUR_USERNAME',
password: 'YOUR_PASSWORD',
apiKey: 'YOUR_API_KEY'
});
const api_instance = new ionoscloud.ClustersApi(config);
// Delete a cluster
api_instance
.clustersDelete({
clusterId: 498ae72f-411f-11eb-9d07-046c59cc737e
})
.then((response) => console.log(response.data))
.catch((error) => console.log(error.response.data));
Name | Type | Description | Notes |
---|---|---|---|
clusterId | string | The unique ID of the cluster. | [default to undefined] |
basicAuth, tokenAuth
- Content-Type: Not defined
- Accept: application/json
clustersFindById(clusterId)
Fetch a cluster
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.
const ionoscloud = require('@ionos-cloud/sdk-nodejs-dbaas-postgres');
// setup authorization
const config = new ionoscloud.Configuration({
username: 'YOUR_USERNAME',
password: 'YOUR_PASSWORD',
apiKey: 'YOUR_API_KEY'
});
const api_instance = new ionoscloud.ClustersApi(config);
// Fetch a cluster
api_instance
.clustersFindById({
clusterId: 498ae72f-411f-11eb-9d07-046c59cc737e
})
.then((response) => console.log(response.data))
.catch((error) => console.log(error.response.data));
Name | Type | Description | Notes |
---|---|---|---|
clusterId | string | The unique ID of the cluster. | [default to undefined] |
basicAuth, tokenAuth
- Content-Type: Not defined
- Accept: application/json
clustersGet(opts)
List clusters
Retrieves a list of PostgreSQL clusters.
const ionoscloud = require('@ionos-cloud/sdk-nodejs-dbaas-postgres');
// setup authorization
const config = new ionoscloud.Configuration({
username: 'YOUR_USERNAME',
password: 'YOUR_PASSWORD',
apiKey: 'YOUR_API_KEY'
});
const api_instance = new ionoscloud.ClustersApi(config);
// List clusters
api_instance
.clustersGet({
limit: 100,
offset: 200,
filterName: filterName_example
options: {}
})
.then((response) => console.log(response.data))
.catch((error) => console.log(error.response.data));
Name | Type | Description | Notes |
---|---|---|---|
limit | number | The maximum number of elements to return. Use together with 'offset' for pagination. | [optional][default to 100] |
offset | number | The first element to return. Use together with 'limit' for pagination. | [optional][default to 0] |
filterName | string | Response filter to list only the PostgreSQL clusters that contain the specified name. The value is case insensitive and matched on the 'displayName' field. | [optional][default to undefined] |
basicAuth, tokenAuth
- Content-Type: Not defined
- Accept: application/json
clustersPatch(clusterId, patchClusterRequest)
Patch a cluster
Patch attributes of a PostgreSQL cluster.
const ionoscloud = require('@ionos-cloud/sdk-nodejs-dbaas-postgres');
// setup authorization
const config = new ionoscloud.Configuration({
username: 'YOUR_USERNAME',
password: 'YOUR_PASSWORD',
apiKey: 'YOUR_API_KEY'
});
const api_instance = new ionoscloud.ClustersApi(config);
// Patch a cluster
api_instance
.clustersPatch({
clusterId: 498ae72f-411f-11eb-9d07-046c59cc737e,
patchClusterRequest: patchClusterRequest_example
})
.then((response) => console.log(response.data))
.catch((error) => console.log(error.response.data));
Name | Type | Description | Notes |
---|---|---|---|
clusterId | string | The unique ID of the cluster. | [default to undefined] |
patchClusterRequest | Part of the cluster which should be modified. | |
basicAuth, tokenAuth
- Content-Type: application/json
- Accept: application/json
clustersPost(createClusterRequest)
Create a cluster
Creates a new PostgreSQL cluster. If the
fromBackup
field is populated, the new cluster will be created based on the given backup.const ionoscloud = require('@ionos-cloud/sdk-nodejs-dbaas-postgres');
// setup authorization
const config = new ionoscloud.Configuration({
username: 'YOUR_USERNAME',
password: 'YOUR_PASSWORD',
apiKey: 'YOUR_API_KEY'
});
const api_instance = new ionoscloud.ClustersApi(config);
// Create a cluster
api_instance
.clustersPost({
createClusterRequest: createClusterRequest_example
})
.then((response) => console.log(response.data))
.catch((error) => console.log(error.response.data));
Name | Type | Description | Notes |
---|---|---|---|
createClusterRequest | The cluster to be created. | |
basicAuth, tokenAuth
- Content-Type: application/json
- Accept: application/json
postgresVersionsGet
List PostgreSQL versions
Retrieves a list of all available PostgreSQL versions.
const ionoscloud = require('@ionos-cloud/sdk-nodejs-dbaas-postgres');
// setup authorization
const config = new ionoscloud.Configuration({
username: 'YOUR_USERNAME',
password: 'YOUR_PASSWORD',
apiKey: 'YOUR_API_KEY'
});
const api_instance = new ionoscloud.ClustersApi(config);
// List PostgreSQL versions
api_instance
.postgresVersionsGet()
.then((response) => console.log(response.data))
.catch((error) => console.log(error.response.data));
This endpoint does not need any parameter.
basicAuth, tokenAuth
- Content-Type: Not defined
- Accept: application/json
Last modified 4mo ago