> For the complete documentation index, see [llms.txt](https://docs.ionos.com/cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ionos.com/cloud/java/dbaas-mariadb/api/clustersapi.md).

# ClustersApi

## ClustersApi

All URIs are relative to *<https://mariadb.de-txl.ionos.com>*

| Method                                    | HTTP request                     | Description      |
| ----------------------------------------- | -------------------------------- | ---------------- |
| [**clustersDelete**](#clustersdelete)     | **DELETE** /clusters/{clusterId} | Delete a cluster |
| [**clustersFindById**](#clustersfindbyid) | **GET** /clusters/{clusterId}    | Fetch a cluster  |
| [**clustersGet**](#clustersget)           | **GET** /clusters                | List clusters    |
| [**clustersPost**](#clusterspost)         | **POST** /clusters               | Create a cluster |

## **clustersDelete**

> ClusterResponse clustersDelete(clusterId)

Delete a cluster

Delete a MariaDB cluster.

#### Example

```java
// Import classes:
import com.ionoscloud.dbaasmariadb.ApiClient;
import com.ionoscloud.dbaasmariadb.ApiException;
import com.ionoscloud.dbaasmariadb.ApiResponse;
import com.ionoscloud.dbaasmariadb.Configuration;
import com.ionoscloud.dbaasmariadb.auth.*;
import com.ionoscloud.dbaasmariadb.model.*;
import com.ionoscloud.dbaasmariadb.api.ClustersApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    
    // Configure Api Key authorization: tokenAuth
    defaultClient.setApiKeyWithBearerPrefix("YOUR TOKEN");
    ClustersApi apiInstance = new ClustersApi(defaultClient);
    String clusterId = "498ae72f-411f-11eb-9d07-046c59cc737e"; // String | The unique ID of the cluster.
    try {
      ApiResponse<ClusterResponse> result = apiInstance.clustersDeleteWithHttpInfo(clusterId);
      System.out.println("Response: " + result.getData());
      System.out.println("Status Code: " + result.getStatusCode());
      System.out.println("Headers: " + result.getHeaders());
    } 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

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

#### Return type

[**ClusterResponse**](https://docs.ionos.com/cloud/java/dbaas-mariadb/models/clusterresponse.md)

#### HTTP request headers

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

## **clustersFindById**

> ClusterResponse clustersFindById(clusterId)

Fetch a cluster

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

#### Example

```java
// Import classes:
import com.ionoscloud.dbaasmariadb.ApiClient;
import com.ionoscloud.dbaasmariadb.ApiException;
import com.ionoscloud.dbaasmariadb.ApiResponse;
import com.ionoscloud.dbaasmariadb.Configuration;
import com.ionoscloud.dbaasmariadb.auth.*;
import com.ionoscloud.dbaasmariadb.model.*;
import com.ionoscloud.dbaasmariadb.api.ClustersApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    
    // Configure Api Key authorization: tokenAuth
    defaultClient.setApiKeyWithBearerPrefix("YOUR TOKEN");
    ClustersApi apiInstance = new ClustersApi(defaultClient);
    String clusterId = "498ae72f-411f-11eb-9d07-046c59cc737e"; // String | The unique ID of the cluster.
    try {
      ApiResponse<ClusterResponse> result = apiInstance.clustersFindByIdWithHttpInfo(clusterId);
      System.out.println("Response: " + result.getData());
      System.out.println("Status Code: " + result.getStatusCode());
      System.out.println("Headers: " + result.getHeaders());
    } 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

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

#### Return type

[**ClusterResponse**](https://docs.ionos.com/cloud/java/dbaas-mariadb/models/clusterresponse.md)

#### HTTP request headers

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

## **clustersGet**

> ClusterList clustersGet(limit, offset, filterName)

List clusters

Retrieves a list of MariaDB clusters.

#### Example

```java
// Import classes:
import com.ionoscloud.dbaasmariadb.ApiClient;
import com.ionoscloud.dbaasmariadb.ApiException;
import com.ionoscloud.dbaasmariadb.ApiResponse;
import com.ionoscloud.dbaasmariadb.Configuration;
import com.ionoscloud.dbaasmariadb.auth.*;
import com.ionoscloud.dbaasmariadb.model.*;
import com.ionoscloud.dbaasmariadb.api.ClustersApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    
    // Configure Api Key authorization: tokenAuth
    defaultClient.setApiKeyWithBearerPrefix("YOUR TOKEN");
    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 MariaDB clusters that contain the specified name. The value is case insensitive and matched on the 'displayName' field. 
    String orderBy = "orderBy_example"; // String | Order by field
    Integer maxResults = "maxResults_example"; // Integer | Maximum number of results to return
    try {
      ApiResponse<ClusterList> result = apiInstance.clustersGetWithHttpInfo(limit, offset, filterName, orderBy, maxResults, filters);
      System.out.println("Response: " + result.getData());
      System.out.println("Status Code: " + result.getStatusCode());
      System.out.println("Headers: " + result.getHeaders());
    } 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

| Name           | Type        | Description                                                                                                                                              | Notes                         |
| -------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- |
| **limit**      | **Integer** | The maximum number of elements to return. Use together with 'offset' for pagination.                                                                     | \[optional] \[default to 100] |
| **offset**     | **Integer** | The first element to return. Use together with 'limit' for pagination.                                                                                   | \[optional] \[default to 0]   |
| **filterName** | **String**  | Response filter to list only the MariaDB clusters that contain the specified name. The value is case insensitive and matched on the 'displayName' field. | \[optional]                   |

#### Return type

[**ClusterList**](https://docs.ionos.com/cloud/java/dbaas-mariadb/models/clusterlist.md)

#### HTTP request headers

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

## **clustersPost**

> ClusterResponse clustersPost(createClusterRequest)

Create a cluster

Creates a new MariaDB cluster.

#### Example

```java
// Import classes:
import com.ionoscloud.dbaasmariadb.ApiClient;
import com.ionoscloud.dbaasmariadb.ApiException;
import com.ionoscloud.dbaasmariadb.ApiResponse;
import com.ionoscloud.dbaasmariadb.Configuration;
import com.ionoscloud.dbaasmariadb.auth.*;
import com.ionoscloud.dbaasmariadb.model.*;
import com.ionoscloud.dbaasmariadb.api.ClustersApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    
    // Configure Api Key authorization: tokenAuth
    defaultClient.setApiKeyWithBearerPrefix("YOUR TOKEN");
    ClustersApi apiInstance = new ClustersApi(defaultClient);
    CreateClusterRequest createClusterRequest = new CreateClusterRequest(); // CreateClusterRequest | The cluster to be created.
    try {
      ApiResponse<ClusterResponse> result = apiInstance.clustersPostWithHttpInfo(createClusterRequest);
      System.out.println("Response: " + result.getData());
      System.out.println("Status Code: " + result.getStatusCode());
      System.out.println("Headers: " + result.getHeaders());
    } 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

| Name                     | Type                                                                                                       | Description                | Notes |
| ------------------------ | ---------------------------------------------------------------------------------------------------------- | -------------------------- | ----- |
| **createClusterRequest** | [**CreateClusterRequest**](https://docs.ionos.com/cloud/java/dbaas-mariadb/models/createclusterrequest.md) | The cluster to be created. |       |

#### Return type

[**ClusterResponse**](https://docs.ionos.com/cloud/java/dbaas-mariadb/models/clusterresponse.md)

#### HTTP request headers

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ionos.com/cloud/java/dbaas-mariadb/api/clustersapi.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
