DatabasesApi
All URIs are relative to https://api.ionos.com/databases/postgresql
Method HTTP request Description
databasesDelete
databasesDelete(clusterId, databasename)
Delete database
Deletes a single database
Example
Copy // 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 . DatabasesApi ;
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" );
DatabasesApi apiInstance = new DatabasesApi(defaultClient) ;
String clusterId = "498ae72f-411f-11eb-9d07-046c59cc737e" ; // String | The unique ID of the cluster.
String databasename = "benjamindb" ; // String | The database name.
try {
apiInstance . databasesDelete (clusterId , databasename);
} catch ( ApiException e) {
System . err . println ( "Exception when calling DatabasesApi#databasesDelete" );
System . err . println ( "Status code: " + e . getCode ());
System . err . println ( "Reason: " + e . getResponseBody ());
System . err . println ( "Response headers: " + e . getResponseHeaders ());
e . printStackTrace ();
}
}
}
⚠️ Note : for the example above, you need to provide all parameters to the method call. Null values will resolve to the API defaults.
Parameters
Return type
null (empty response body)
Content-Type : Not defined
databasesGet
DatabaseResource databasesGet(clusterId, databasename)
Get database
Retrieves a single database
Example
Copy // 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 . DatabasesApi ;
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" );
DatabasesApi apiInstance = new DatabasesApi(defaultClient) ;
String clusterId = "498ae72f-411f-11eb-9d07-046c59cc737e" ; // String | The unique ID of the cluster.
String databasename = "benjamindb" ; // String | The database name.
try {
DatabaseResource result = apiInstance . databasesGet (clusterId , databasename);
System . out . println (result);
} catch ( ApiException e) {
System . err . println ( "Exception when calling DatabasesApi#databasesGet" );
System . err . println ( "Status code: " + e . getCode ());
System . err . println ( "Reason: " + e . getResponseBody ());
System . err . println ( "Response headers: " + e . getResponseHeaders ());
e . printStackTrace ();
}
}
}
⚠️ Note : for the example above, you need to provide all parameters to the method call. Null values will resolve to the API defaults.
Parameters
Return type
DatabaseResource
Content-Type : Not defined
databasesList
DatabaseList databasesList(clusterId, limit, offset)
List databases
Retrieves a list of databases
Example
Copy // 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 . DatabasesApi ;
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" );
DatabasesApi apiInstance = new DatabasesApi(defaultClient) ;
String clusterId = "498ae72f-411f-11eb-9d07-046c59cc737e" ; // String | The unique ID of the cluster.
Integer limit = 100; // Integer | The maximum number of elements to return. Use together with 'offset' for pagination.
Integer offset = 0 ; // Integer | The first element to return. Use together with 'limit' for pagination.
try {
DatabaseList result = apiInstance . databasesList (clusterId , limit , offset);
System . out . println (result);
} catch ( ApiException e) {
System . err . println ( "Exception when calling DatabasesApi#databasesList" );
System . err . println ( "Status code: " + e . getCode ());
System . err . println ( "Reason: " + e . getResponseBody ());
System . err . println ( "Response headers: " + e . getResponseHeaders ());
e . printStackTrace ();
}
}
}
⚠️ Note : for the example above, you need to provide all parameters to the method call. Null values will resolve to the API defaults.
Parameters
Return type
DatabaseList
Content-Type : Not defined
databasesPost
DatabaseResource databasesPost(clusterId, database)
Create a database
Create a new database
Example
Copy // 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 . DatabasesApi ;
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" );
DatabasesApi apiInstance = new DatabasesApi(defaultClient) ;
String clusterId = "498ae72f-411f-11eb-9d07-046c59cc737e" ; // String | The unique ID of the cluster.
Database database = new Database() ; // Database | a database to create
try {
DatabaseResource result = apiInstance . databasesPost (clusterId , database);
System . out . println (result);
} catch ( ApiException e) {
System . err . println ( "Exception when calling DatabasesApi#databasesPost" );
System . err . println ( "Status code: " + e . getCode ());
System . err . println ( "Reason: " + e . getResponseBody ());
System . err . println ( "Response headers: " + e . getResponseHeaders ());
e . printStackTrace ();
}
}
}
⚠️ Note : for the example above, you need to provide all parameters to the method call. Null values will resolve to the API defaults.
Parameters
Return type
DatabaseResource
Content-Type : application/json