Links

ClustersApi

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

PostgresVersionList clusterPostgresVersionsGet(clusterId)
List PostgreSQL versions
Retrieves a list of all PostgreSQL versions available for this cluster including the current version.

Example

// Import classes:
import com.ionoscloud.dbaaspostgres.ApiClient;
import com.ionoscloud.dbaaspostgres.ApiException;
import com.ionoscloud.dbaaspostgres.Configuration;
import com.ionoscloud.dbaaspostgres.auth.*;
import com.ionoscloud.dbaaspostgres.model.*;
import com.ionoscloud.dbaaspostgres.api.ClustersApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuthentication.setUsername("YOUR USERNAME");
basicAuthentication.setPassword("YOUR PASSWORD");
ClustersApi apiInstance = new ClustersApi(defaultClient);
String clusterId = "clusterId_example"; // String | The unique ID of the cluster.
try {
PostgresVersionList result = apiInstance.clusterPostgresVersionsGet(clusterId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ClustersApi#clusterPostgresVersionsGet");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

Name
Type
Description
Notes
clusterId
String
The unique ID of the cluster.

Return type

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

clustersDelete

ClusterResponse clustersDelete(clusterId)
Delete a cluster
Delete a PostgreSQL cluster.

Example

// Import classes:
import com.ionoscloud.dbaaspostgres.ApiClient;
import com.ionoscloud.dbaaspostgres.ApiException;
import com.ionoscloud.dbaaspostgres.Configuration;
import com.ionoscloud.dbaaspostgres.auth.*;
import com.ionoscloud.dbaaspostgres.model.*;
import com.ionoscloud.dbaaspostgres.api.ClustersApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuthentication.setUsername("YOUR USERNAME");
basicAuthentication.setPassword("YOUR PASSWORD");
ClustersApi apiInstance = new ClustersApi(defaultClient);
String clusterId = "clusterId_example"; // String | The unique ID of the cluster.
try {
ClusterResponse result = apiInstance.clustersDelete(clusterId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ClustersApi#clustersDelete");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

Name
Type
Description
Notes
clusterId
String
The unique ID of the cluster.

Return type

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

clustersFindById

ClusterResponse 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.

Example

// Import classes:
import com.ionoscloud.dbaaspostgres.ApiClient;
import com.ionoscloud.dbaaspostgres.ApiException;
import com.ionoscloud.dbaaspostgres.Configuration;
import com.ionoscloud.dbaaspostgres.auth.*;
import com.ionoscloud.dbaaspostgres.model.*;
import com.ionoscloud.dbaaspostgres.api.ClustersApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuthentication.setUsername("YOUR USERNAME");
basicAuthentication.setPassword("YOUR PASSWORD");
ClustersApi apiInstance = new ClustersApi(defaultClient);
String clusterId = "clusterId_example"; // String | The unique ID of the cluster.
try {
ClusterResponse result = apiInstance.clustersFindById(clusterId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ClustersApi#clustersFindById");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

Name
Type
Description
Notes
clusterId
String
The unique ID of the cluster.

Return type

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

clustersGet

ClusterList clustersGet(filterName)
List clusters
Retrieves a list of PostgreSQL clusters.

Example

// Import classes:
import com.ionoscloud.dbaaspostgres.ApiClient;
import com.ionoscloud.dbaaspostgres.ApiException;
import com.ionoscloud.dbaaspostgres.Configuration;
import com.ionoscloud.dbaaspostgres.auth.*;
import com.ionoscloud.dbaaspostgres.model.*;
import com.ionoscloud.dbaaspostgres.api.ClustersApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuthentication.setUsername("YOUR USERNAME");
basicAuthentication.setPassword("YOUR PASSWORD");
ClustersApi apiInstance = new ClustersApi(defaultClient);
String filterName = "filterName_example"; // 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.
try {
ClusterList result = apiInstance.clustersGet(filterName);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ClustersApi#clustersGet");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

Name
Type
Description
Notes
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]

Return type

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

clustersPatch

ClusterResponse clustersPatch(clusterId, patchClusterRequest)
Patch a cluster
Patch attributes of a PostgreSQL cluster.

Example

// Import classes:
import com.ionoscloud.dbaaspostgres.ApiClient;
import com.ionoscloud.dbaaspostgres.ApiException;
import com.ionoscloud.dbaaspostgres.Configuration;
import com.ionoscloud.dbaaspostgres.auth.*;
import com.ionoscloud.dbaaspostgres.model.*;
import com.ionoscloud.dbaaspostgres.api.ClustersApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuthentication.setUsername("YOUR USERNAME");
basicAuthentication.setPassword("YOUR PASSWORD");
ClustersApi apiInstance = new ClustersApi(defaultClient);
String clusterId = "clusterId_example"; // String | The unique ID of the cluster.
PatchClusterRequest patchClusterRequest = new PatchClusterRequest(); // PatchClusterRequest | The modified cluster.
try {
ClusterResponse result = apiInstance.clustersPatch(clusterId, patchClusterRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ClustersApi#clustersPatch");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

Name
Type
Description
Notes
clusterId
String
The unique ID of the cluster.
patchClusterRequest
The modified cluster.

Return type

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

clustersPost

ClusterResponse 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.

Example

// Import classes:
import com.ionoscloud.dbaaspostgres.ApiClient;
import com.ionoscloud.dbaaspostgres.ApiException;
import com.ionoscloud.dbaaspostgres.Configuration;
import com.ionoscloud.dbaaspostgres.auth.*;
import com.ionoscloud.dbaaspostgres.model.*;
import com.ionoscloud.dbaaspostgres.api.ClustersApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuthentication.setUsername("YOUR USERNAME");
basicAuthentication.setPassword("YOUR PASSWORD");
ClustersApi apiInstance = new ClustersApi(defaultClient);
CreateClusterRequest createClusterRequest = new CreateClusterRequest(); // CreateClusterRequest | The cluster to be created.
try {
ClusterResponse result = apiInstance.clustersPost(createClusterRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ClustersApi#clustersPost");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

Name
Type
Description
Notes
createClusterRequest
The cluster to be created.

Return type

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

postgresVersionsGet

PostgresVersionList postgresVersionsGet()
List PostgreSQL versions
Retrieves a list of all available PostgreSQL versions.

Example

// Import classes:
import com.ionoscloud.dbaaspostgres.ApiClient;
import com.ionoscloud.dbaaspostgres.ApiException;
import com.ionoscloud.dbaaspostgres.Configuration;
import com.ionoscloud.dbaaspostgres.auth.*;
import com.ionoscloud.dbaaspostgres.model.*;
import com.ionoscloud.dbaaspostgres.api.ClustersApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuthentication.setUsername("YOUR USERNAME");
basicAuthentication.setPassword("YOUR PASSWORD");
ClustersApi apiInstance = new ClustersApi(defaultClient);
try {
PostgresVersionList result = apiInstance.postgresVersionsGet();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ClustersApi#postgresVersionsGet");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Parameters

This endpoint does not need any parameter.

Return type

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json