ClustersApi
All URIs are relative to https://api.ionos.com/databases/mongodb
Method
HTTP request
Description
DELETE /clusters/{clusterId}
GET /clusters/{clusterId}
PATCH /clusters/{clusterId}
clustersDelete
ClusterResponse clustersDelete(clusterId)
Delete a Cluster
Deletes a MongoDB cluster.
Example
Copy // Import classes:
import com . ionoscloud . dbaasmongo . ApiClient ;
import com . ionoscloud . dbaasmongo . ApiException ;
import com . ionoscloud . dbaasmongo . Configuration ;
import com . ionoscloud . dbaasmongo . auth . * ;
import com . ionoscloud . dbaasmongo . model . * ;
import com . ionoscloud . dbaasmongo . 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 ();
}
}
}
⚠️ Note : for the example above, you need to provide all parameters to the method call. Null values will resolve to the API defaults.
Parameters
The unique ID of the cluster.
Return type
ClusterResponse
Content-Type : Not defined
clustersFindById
ClusterResponse clustersFindById(clusterId)
Get a cluster by id
Get a cluster by id.
Example
Copy // Import classes:
import com . ionoscloud . dbaasmongo . ApiClient ;
import com . ionoscloud . dbaasmongo . ApiException ;
import com . ionoscloud . dbaasmongo . Configuration ;
import com . ionoscloud . dbaasmongo . auth . * ;
import com . ionoscloud . dbaasmongo . model . * ;
import com . ionoscloud . dbaasmongo . 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 ();
}
}
}
⚠️ Note : for the example above, you need to provide all parameters to the method call. Null values will resolve to the API defaults.
Parameters
The unique ID of the cluster.
Return type
ClusterResponse
Content-Type : Not defined
clustersGet
ClusterList clustersGet(limit, offset, filterName)
Get Clusters
Retrieves a list of MongoDB clusters.
Example
Copy // Import classes:
import com . ionoscloud . dbaasmongo . ApiClient ;
import com . ionoscloud . dbaasmongo . ApiException ;
import com . ionoscloud . dbaasmongo . Configuration ;
import com . ionoscloud . dbaasmongo . auth . * ;
import com . ionoscloud . dbaasmongo . model . * ;
import com . ionoscloud . dbaasmongo . 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) ;
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.
String filterName = "filterName_example" ; // String | Response filter to list only the MongoDB clusters that contain the specified name. The value is case insensitive and matched on the 'displayName' field.
try {
ClusterList result = apiInstance . clustersGet (limit , offset , 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 ();
}
}
}
⚠️ Note : for the example above, you need to provide all parameters to the method call. Null values will resolve to the API defaults.
Parameters
The maximum number of elements to return. Use together with 'offset' for pagination.
[optional] [default to 100]
The first element to return. Use together with 'limit' for pagination.
[optional] [default to 0]
Response filter to list only the MongoDB clusters that contain the specified name. The value is case insensitive and matched on the 'displayName' field.
Return type
ClusterList
Content-Type : Not defined
clustersPatch
ClusterResponse clustersPatch(clusterId, patchClusterRequest)
Patch a cluster
Patch attributes of a MongoDB cluster.
Example
Copy // Import classes:
import com . ionoscloud . dbaasmongo . ApiClient ;
import com . ionoscloud . dbaasmongo . ApiException ;
import com . ionoscloud . dbaasmongo . Configuration ;
import com . ionoscloud . dbaasmongo . auth . * ;
import com . ionoscloud . dbaasmongo . model . * ;
import com . ionoscloud . dbaasmongo . 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 | Part of the cluster which should be modified.
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 ();
}
}
}
⚠️ Note : for the example above, you need to provide all parameters to the method call. Null values will resolve to the API defaults.
Parameters
The unique ID of the cluster.
Part of the cluster which should be modified.
Return type
ClusterResponse
Content-Type : application/json
clustersPost
ClusterResponse clustersPost(createClusterRequest)
Create a Cluster
Creates a new MongoDB cluster.
Example
Copy // Import classes:
import com . ionoscloud . dbaasmongo . ApiClient ;
import com . ionoscloud . dbaasmongo . ApiException ;
import com . ionoscloud . dbaasmongo . Configuration ;
import com . ionoscloud . dbaasmongo . auth . * ;
import com . ionoscloud . dbaasmongo . model . * ;
import com . ionoscloud . dbaasmongo . 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 ();
}
}
}
⚠️ Note : for the example above, you need to provide all parameters to the method call. Null values will resolve to the API defaults.
Parameters
The cluster to be created.
Return type
ClusterResponse
Content-Type : application/json