# ServersApi

## ServersApi

All URIs are relative to *<https://api.ionos.com/cloudapi/v6>*

| Method                                                                        | HTTP request                                                                 | Description                      |
| ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -------------------------------- |
| [**datacentersServersCdromsDelete**](#datacentersserverscdromsdelete)         | **DELETE** /datacenters/{datacenterId}/servers/{serverId}/cdroms/{cdromId}   | Detach a CD-ROM by ID            |
| [**datacentersServersCdromsFindById**](#datacentersserverscdromsfindbyid)     | **GET** /datacenters/{datacenterId}/servers/{serverId}/cdroms/{cdromId}      | Get Attached CD-ROM by ID        |
| [**datacentersServersCdromsGet**](#datacentersserverscdromsget)               | **GET** /datacenters/{datacenterId}/servers/{serverId}/cdroms                | Get Attached CD-ROMs             |
| [**datacentersServersCdromsPost**](#datacentersserverscdromspost)             | **POST** /datacenters/{datacenterId}/servers/{serverId}/cdroms               | Attach a CD-ROM                  |
| [**datacentersServersDelete**](#datacentersserversdelete)                     | **DELETE** /datacenters/{datacenterId}/servers/{serverId}                    | Delete servers                   |
| [**datacentersServersFindById**](#datacentersserversfindbyid)                 | **GET** /datacenters/{datacenterId}/servers/{serverId}                       | Retrieve servers by ID           |
| [**datacentersServersGet**](#datacentersserversget)                           | **GET** /datacenters/{datacenterId}/servers                                  | List servers                     |
| [**datacentersServersPatch**](#datacentersserverspatch)                       | **PATCH** /datacenters/{datacenterId}/servers/{serverId}                     | Partially modify servers         |
| [**datacentersServersPost**](#datacentersserverspost)                         | **POST** /datacenters/{datacenterId}/servers                                 | Create a Server                  |
| [**datacentersServersPut**](#datacentersserversput)                           | **PUT** /datacenters/{datacenterId}/servers/{serverId}                       | Modify a Server by ID            |
| [**datacentersServersRebootPost**](#datacentersserversrebootpost)             | **POST** /datacenters/{datacenterId}/servers/{serverId}/reboot               | Reboot servers                   |
| [**datacentersServersRemoteConsoleGet**](#datacentersserversremoteconsoleget) | **GET** /datacenters/{datacenterId}/servers/{serverId}/remoteconsole         | Get Remote Console link          |
| [**datacentersServersResumePost**](#datacentersserversresumepost)             | **POST** /datacenters/{datacenterId}/servers/{serverId}/resume               | Resume a Cube Server by ID       |
| [**datacentersServersStartPost**](#datacentersserversstartpost)               | **POST** /datacenters/{datacenterId}/servers/{serverId}/start                | Start an Enterprise Server by ID |
| [**datacentersServersStopPost**](#datacentersserversstoppost)                 | **POST** /datacenters/{datacenterId}/servers/{serverId}/stop                 | Stop an Enterprise Server by ID  |
| [**datacentersServersSuspendPost**](#datacentersserverssuspendpost)           | **POST** /datacenters/{datacenterId}/servers/{serverId}/suspend              | Suspend a Cube Server by ID      |
| [**datacentersServersTokenGet**](#datacentersserverstokenget)                 | **GET** /datacenters/{datacenterId}/servers/{serverId}/token                 | Get JASON Web Token              |
| [**datacentersServersUpgradePost**](#datacentersserversupgradepost)           | **POST** /datacenters/{datacenterId}/servers/{serverId}/upgrade              | Upgrade a Server by ID           |
| [**datacentersServersVolumesDelete**](#datacentersserversvolumesdelete)       | **DELETE** /datacenters/{datacenterId}/servers/{serverId}/volumes/{volumeId} | Detach a Volume by ID            |
| [**datacentersServersVolumesFindById**](#datacentersserversvolumesfindbyid)   | **GET** /datacenters/{datacenterId}/servers/{serverId}/volumes/{volumeId}    | Get Attached Volume by ID        |
| [**datacentersServersVolumesGet**](#datacentersserversvolumesget)             | **GET** /datacenters/{datacenterId}/servers/{serverId}/volumes               | Get Attached Volumes             |
| [**datacentersServersVolumesPost**](#datacentersserversvolumespost)           | **POST** /datacenters/{datacenterId}/servers/{serverId}/volumes              | Attach a Volume to a Server      |

## **datacentersServersCdromsDelete**

> datacentersServersCdromsDelete(datacenterId, serverId, cdromId, pretty, depth, xContractNumber)

Detach a CD-ROM by ID

Detachs the specified CD-ROM from the server. Detaching a CD-ROM deletes the CD-ROM. The image will not be deleted. Note that detaching a CD-ROM leads to a reset of the server.

#### Parameters

| Name                | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **datacenterId**    | **String**  | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                                |
| **serverId**        | **String**  | The unique ID of the server.                                                                                                                                                                                                                                                                                                                                                                                                             |                                |
| **cdromId**         | **String**  | The unique ID of the CD-ROM.                                                                                                                                                                                                                                                                                                                                                                                                             |                                |
| **pretty**          | **Boolean** | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional] \[default to true] |
| **depth**           | **Integer** | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional] \[default to 0]    |
| **xContractNumber** | **Integer** | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                    |

#### Return type

null (empty response body)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the datacentersServersCdromsDeleteWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersServersCdromsDelete instead

#### Example

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

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    
    // Configure HTTP basic authorization: Basic Authentication
    HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("Basic Authentication");
    basicAuthentication.setUsername("YOUR USERNAME");
    basicAuthentication.setPassword("YOUR PASSWORD");

    // Configure Api Key authorization: Token Authentication
    defaultClient.setApiKeyWithBearerPrefix("YOUR TOKEN");

    ServersApi apiInstance = new ServersApi(defaultClient);
    String datacenterId = "datacenterId_example"; // String | The unique ID of the data center.
    String serverId = "serverId_example"; // String | The unique ID of the server.
    String cdromId = "cdromId_example"; // String | The unique ID of the CD-ROM.
    Boolean pretty = true; // Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
    Integer depth = 0; // Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
    Integer xContractNumber = 56; // Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
    try {
      apiInstance.datacentersServersCdromsDeleteWithHttpInfo(datacenterId, serverId, cdromId, pretty, depth, xContractNumber);
    } catch (ApiException e) {
      System.err.println("Exception when calling ServersApi#datacentersServersCdromsDelete");
      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.

For convenience, you can alternatively use a builder, which allows to omit optional parameters:

```java
    try {
        apiInstance.datacentersServersCdromsDelete(datacenterId, serverId, cdromId)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ServersApi#datacentersServersCdromsDelete");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersServersCdromsFindById**

> Image datacentersServersCdromsFindById(datacenterId, serverId, cdromId, pretty, depth, xContractNumber)

Get Attached CD-ROM by ID

Retrieves the properties of the CD-ROM attached to the specified server.

#### Parameters

| Name                | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **datacenterId**    | **String**  | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                                |
| **serverId**        | **String**  | The unique ID of the server.                                                                                                                                                                                                                                                                                                                                                                                                             |                                |
| **cdromId**         | **String**  | The unique ID of the CD-ROM.                                                                                                                                                                                                                                                                                                                                                                                                             |                                |
| **pretty**          | **Boolean** | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional] \[default to true] |
| **depth**           | **Integer** | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional] \[default to 0]    |
| **xContractNumber** | **Integer** | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                    |

#### Return type

[**Image**](https://docs.ionos.com/sections-test/java-sdk/cloud-api-java-sdk/models/image)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the datacentersServersCdromsFindByIdWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersServersCdromsFindById instead

#### Example

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

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    
    // Configure HTTP basic authorization: Basic Authentication
    HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("Basic Authentication");
    basicAuthentication.setUsername("YOUR USERNAME");
    basicAuthentication.setPassword("YOUR PASSWORD");

    // Configure Api Key authorization: Token Authentication
    defaultClient.setApiKeyWithBearerPrefix("YOUR TOKEN");

    ServersApi apiInstance = new ServersApi(defaultClient);
    String datacenterId = "datacenterId_example"; // String | The unique ID of the data center.
    String serverId = "serverId_example"; // String | The unique ID of the server.
    String cdromId = "cdromId_example"; // String | The unique ID of the CD-ROM.
    Boolean pretty = true; // Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
    Integer depth = 0; // Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
    Integer xContractNumber = 56; // Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
    try {
      ApiResponse<Image> result = apiInstance.datacentersServersCdromsFindByIdWithHttpInfo(datacenterId, serverId, cdromId, pretty, depth, xContractNumber);
      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 ServersApi#datacentersServersCdromsFindById");
      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.

For convenience, you can alternatively use a builder, which allows to omit optional parameters:

```java
    try {
        Image result = apiInstance.datacentersServersCdromsFindById(datacenterId, serverId, cdromId)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ServersApi#datacentersServersCdromsFindById");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersServersCdromsGet**

> Cdroms datacentersServersCdromsGet(datacenterId, serverId, pretty, depth, xContractNumber, offset, limit)

Get Attached CD-ROMs

Lists all CD-ROMs attached to the specified server.

#### Parameters

| Name                | Type                 | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **datacenterId**    | **String**           | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                                |
| **serverId**        | **String**           | The unique ID of the server.                                                                                                                                                                                                                                                                                                                                                                                                             |                                |
| **pretty**          | **Boolean**          | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional] \[default to true] |
| **depth**           | **Integer**          | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional] \[default to 0]    |
| **xContractNumber** | **Integer**          | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                    |
| **offset**          | **Integer**          | The first element (from the complete list of the elements) to include in the response (used together with \<b>\<i>limit\</i>\</b> for pagination).                                                                                                                                                                                                                                                                                       | \[optional] \[default to 0]    |
| **limit**           | **Integer**          | The maximum number of elements to return (use together with offset for pagination).                                                                                                                                                                                                                                                                                                                                                      | \[optional] \[default to 1000] |
| orderBy             | String               | Sorts the results alphanumerically in ascending order based on the specified property.                                                                                                                                                                                                                                                                                                                                                   | \[optional]                    |
| maxResults          | Integer              | Limits the number of results returned.                                                                                                                                                                                                                                                                                                                                                                                                   | \[optional]                    |
| filters             | Map\<String, String> | Limit results to those containing a matching value for a specific property.                                                                                                                                                                                                                                                                                                                                                              | \[optional]                    |

#### Return type

[**Cdroms**](https://docs.ionos.com/sections-test/java-sdk/cloud-api-java-sdk/models/cdroms)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the datacentersServersCdromsGetWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersServersCdromsGet instead

#### Example

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

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    
    // Configure HTTP basic authorization: Basic Authentication
    HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("Basic Authentication");
    basicAuthentication.setUsername("YOUR USERNAME");
    basicAuthentication.setPassword("YOUR PASSWORD");

    // Configure Api Key authorization: Token Authentication
    defaultClient.setApiKeyWithBearerPrefix("YOUR TOKEN");

    ServersApi apiInstance = new ServersApi(defaultClient);
    String datacenterId = "datacenterId_example"; // String | The unique ID of the data center.
    String serverId = "serverId_example"; // String | The unique ID of the server.
    Boolean pretty = true; // Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
    Integer depth = 0; // Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
    Integer xContractNumber = 56; // Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
    Integer offset = 0; // Integer | The first element (from the complete list of the elements) to include in the response (used together with <b><i>limit</i></b> for pagination).
    Integer limit = 1000; // Integer | The maximum number of elements to return (use together with offset for pagination).
    String orderBy = "orderBy_example"; // String | Order by field
    Integer maxResults = "maxResults_example"; // Integer | Maximum number of results to return
    Map<String, String> filters = new HashMap<String, String>(); // Map<String, String> | Filter results by field
    try {
      ApiResponse<Cdroms> result = apiInstance.datacentersServersCdromsGetWithHttpInfo(datacenterId, serverId, pretty, depth, xContractNumber, offset, limit, 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 ServersApi#datacentersServersCdromsGet");
      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.

For convenience, you can alternatively use a builder, which allows to omit optional parameters:

```java
    try {
        Cdroms result = apiInstance.datacentersServersCdromsGet(datacenterId, serverId)
                .pretty(true)
                .depth(0)
                .offset(0)
                .limit(1000)
                .xContractNumber(56)
                .orderBy("orderBy_example")
                .maxResults(5)
                .filters(filters)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ServersApi#datacentersServersCdromsGet");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersServersCdromsPost**

> Image datacentersServersCdromsPost(datacenterId, serverId, cdrom, pretty, depth, xContractNumber)

Attach a CD-ROM

Attachs a CD-ROM to an existing server specified by its ID. CD-ROMs cannot be created stand-alone like volumes. They are either attached to a server or do not exist. They always have an ISO-Image associated; empty CD-ROMs can not be provisioned. It is possible to attach up to two CD-ROMs to the same server. Note that attaching a CD-ROM leads to a reset of the server.

#### Parameters

| Name                | Type                                                                                       | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | ------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **datacenterId**    | **String**                                                                                 | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                                |
| **serverId**        | **String**                                                                                 | The unique ID of the server.                                                                                                                                                                                                                                                                                                                                                                                                             |                                |
| **cdrom**           | [**Image**](https://docs.ionos.com/sections-test/java-sdk/cloud-api-java-sdk/models/image) | The CD-ROM to be attached.                                                                                                                                                                                                                                                                                                                                                                                                               |                                |
| **pretty**          | **Boolean**                                                                                | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional] \[default to true] |
| **depth**           | **Integer**                                                                                | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional] \[default to 0]    |
| **xContractNumber** | **Integer**                                                                                | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                    |

#### Return type

[**Image**](https://docs.ionos.com/sections-test/java-sdk/cloud-api-java-sdk/models/image)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the datacentersServersCdromsPostWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersServersCdromsPost instead

#### Example

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

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    
    // Configure HTTP basic authorization: Basic Authentication
    HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("Basic Authentication");
    basicAuthentication.setUsername("YOUR USERNAME");
    basicAuthentication.setPassword("YOUR PASSWORD");

    // Configure Api Key authorization: Token Authentication
    defaultClient.setApiKeyWithBearerPrefix("YOUR TOKEN");

    ServersApi apiInstance = new ServersApi(defaultClient);
    String datacenterId = "datacenterId_example"; // String | The unique ID of the data center.
    String serverId = "serverId_example"; // String | The unique ID of the server.
    properties = new ImageProperties(); // ImageProperties | 
    cdrom = new Image(ImageProperties); // Image | The CD-ROM to be attached.
    Boolean pretty = true; // Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
    Integer depth = 0; // Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
    Integer xContractNumber = 56; // Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
    try {
      ApiResponse<Image> result = apiInstance.datacentersServersCdromsPostWithHttpInfo(datacenterId, serverId, cdrom, pretty, depth, xContractNumber);
      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 ServersApi#datacentersServersCdromsPost");
      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.

For convenience, you can alternatively use a builder, which allows to omit optional parameters:

```java
    try {
        Image result = apiInstance.datacentersServersCdromsPost(datacenterId, serverId, cdrom)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ServersApi#datacentersServersCdromsPost");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersServersDelete**

> datacentersServersDelete(datacenterId, serverId, pretty, depth, xContractNumber, deleteVolumes)

Delete servers

Delete the specified server in your data center. The attached storage volumes will also be removed if the query parameter is set to true otherwise a separate API call must be made for these actions.

#### Parameters

| Name                | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **datacenterId**    | **String**  | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                                |
| **serverId**        | **String**  | The unique ID of the server.                                                                                                                                                                                                                                                                                                                                                                                                             |                                |
| **pretty**          | **Boolean** | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional] \[default to true] |
| **depth**           | **Integer** | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional] \[default to 0]    |
| **xContractNumber** | **Integer** | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                    |
| **deleteVolumes**   | **Boolean** | If true, all attached storage volumes will also be deleted.                                                                                                                                                                                                                                                                                                                                                                              | \[optional]                    |

#### Return type

null (empty response body)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the datacentersServersDeleteWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersServersDelete instead

#### Example

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

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    
    // Configure HTTP basic authorization: Basic Authentication
    HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("Basic Authentication");
    basicAuthentication.setUsername("YOUR USERNAME");
    basicAuthentication.setPassword("YOUR PASSWORD");

    // Configure Api Key authorization: Token Authentication
    defaultClient.setApiKeyWithBearerPrefix("YOUR TOKEN");

    ServersApi apiInstance = new ServersApi(defaultClient);
    String datacenterId = "datacenterId_example"; // String | The unique ID of the data center.
    String serverId = "serverId_example"; // String | The unique ID of the server.
    Boolean pretty = true; // Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
    Integer depth = 0; // Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
    Integer xContractNumber = 56; // Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
    Boolean deleteVolumes = true; // Boolean | If true, all attached storage volumes will also be deleted.
    try {
      apiInstance.datacentersServersDeleteWithHttpInfo(datacenterId, serverId, pretty, depth, xContractNumber, deleteVolumes);
    } catch (ApiException e) {
      System.err.println("Exception when calling ServersApi#datacentersServersDelete");
      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.

For convenience, you can alternatively use a builder, which allows to omit optional parameters:

```java
    try {
        apiInstance.datacentersServersDelete(datacenterId, serverId)
                .pretty(true)
                .depth(0)
                .deleteVolumes(true)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ServersApi#datacentersServersDelete");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersServersFindById**

> Server datacentersServersFindById(datacenterId, serverId, pretty, depth, xContractNumber)

Retrieve servers by ID

Retrieve information about the specified server within the data center, such as its configuration, provisioning status, and so on.

#### Parameters

| Name                | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **datacenterId**    | **String**  | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                                |
| **serverId**        | **String**  | The unique ID of the server.                                                                                                                                                                                                                                                                                                                                                                                                             |                                |
| **pretty**          | **Boolean** | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional] \[default to true] |
| **depth**           | **Integer** | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional] \[default to 0]    |
| **xContractNumber** | **Integer** | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                    |

#### Return type

[**Server**](https://docs.ionos.com/sections-test/java-sdk/cloud-api-java-sdk/models/server)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the datacentersServersFindByIdWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersServersFindById instead

#### Example

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

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    
    // Configure HTTP basic authorization: Basic Authentication
    HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("Basic Authentication");
    basicAuthentication.setUsername("YOUR USERNAME");
    basicAuthentication.setPassword("YOUR PASSWORD");

    // Configure Api Key authorization: Token Authentication
    defaultClient.setApiKeyWithBearerPrefix("YOUR TOKEN");

    ServersApi apiInstance = new ServersApi(defaultClient);
    String datacenterId = "datacenterId_example"; // String | The unique ID of the data center.
    String serverId = "serverId_example"; // String | The unique ID of the server.
    Boolean pretty = true; // Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
    Integer depth = 0; // Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
    Integer xContractNumber = 56; // Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
    try {
      ApiResponse<Server> result = apiInstance.datacentersServersFindByIdWithHttpInfo(datacenterId, serverId, pretty, depth, xContractNumber);
      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 ServersApi#datacentersServersFindById");
      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.

For convenience, you can alternatively use a builder, which allows to omit optional parameters:

```java
    try {
        Server result = apiInstance.datacentersServersFindById(datacenterId, serverId)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ServersApi#datacentersServersFindById");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersServersGet**

> Servers datacentersServersGet(datacenterId, pretty, depth, upgradeNeeded, xContractNumber, offset, limit)

List servers

List all servers within the data center.

#### Parameters

| Name                | Type                 | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **datacenterId**    | **String**           | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                                |
| **pretty**          | **Boolean**          | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional] \[default to true] |
| **depth**           | **Integer**          | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional] \[default to 0]    |
| **upgradeNeeded**   | **Boolean**          | Filter servers that can or that cannot be upgraded.                                                                                                                                                                                                                                                                                                                                                                                      | \[optional]                    |
| **xContractNumber** | **Integer**          | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                    |
| **offset**          | **Integer**          | The first element (from the complete list of the elements) to include in the response (used together with \<b>\<i>limit\</i>\</b> for pagination).                                                                                                                                                                                                                                                                                       | \[optional] \[default to 0]    |
| **limit**           | **Integer**          | The maximum number of elements to return (use together with offset for pagination).                                                                                                                                                                                                                                                                                                                                                      | \[optional] \[default to 1000] |
| orderBy             | String               | Sorts the results alphanumerically in ascending order based on the specified property.                                                                                                                                                                                                                                                                                                                                                   | \[optional]                    |
| maxResults          | Integer              | Limits the number of results returned.                                                                                                                                                                                                                                                                                                                                                                                                   | \[optional]                    |
| filters             | Map\<String, String> | Limit results to those containing a matching value for a specific property.                                                                                                                                                                                                                                                                                                                                                              | \[optional]                    |

#### Return type

[**Servers**](https://docs.ionos.com/sections-test/java-sdk/cloud-api-java-sdk/models/servers)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the datacentersServersGetWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersServersGet instead

#### Example

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

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    
    // Configure HTTP basic authorization: Basic Authentication
    HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("Basic Authentication");
    basicAuthentication.setUsername("YOUR USERNAME");
    basicAuthentication.setPassword("YOUR PASSWORD");

    // Configure Api Key authorization: Token Authentication
    defaultClient.setApiKeyWithBearerPrefix("YOUR TOKEN");

    ServersApi apiInstance = new ServersApi(defaultClient);
    String datacenterId = "datacenterId_example"; // String | The unique ID of the data center.
    Boolean pretty = true; // Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
    Integer depth = 0; // Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
    Boolean upgradeNeeded = true; // Boolean | Filter servers that can or that cannot be upgraded.
    Integer xContractNumber = 56; // Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
    Integer offset = 0; // Integer | The first element (from the complete list of the elements) to include in the response (used together with <b><i>limit</i></b> for pagination).
    Integer limit = 1000; // Integer | The maximum number of elements to return (use together with offset for pagination).
    String orderBy = "orderBy_example"; // String | Order by field
    Integer maxResults = "maxResults_example"; // Integer | Maximum number of results to return
    Map<String, String> filters = new HashMap<String, String>(); // Map<String, String> | Filter results by field
    try {
      ApiResponse<Servers> result = apiInstance.datacentersServersGetWithHttpInfo(datacenterId, pretty, depth, upgradeNeeded, xContractNumber, offset, limit, 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 ServersApi#datacentersServersGet");
      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.

For convenience, you can alternatively use a builder, which allows to omit optional parameters:

```java
    try {
        Servers result = apiInstance.datacentersServersGet(datacenterId)
                .pretty(true)
                .depth(0)
                .upgradeNeeded(true)
                .offset(0)
                .limit(1000)
                .xContractNumber(56)
                .orderBy("orderBy_example")
                .maxResults(5)
                .filters(filters)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ServersApi#datacentersServersGet");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersServersPatch**

> Server datacentersServersPatch(datacenterId, serverId, server, pretty, depth, xContractNumber)

Partially modify servers

Update the properties of the specified server within the data center.

#### Parameters

| Name                | Type                                                                                                             | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **datacenterId**    | **String**                                                                                                       | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                                |
| **serverId**        | **String**                                                                                                       | The unique ID of the server.                                                                                                                                                                                                                                                                                                                                                                                                             |                                |
| **server**          | [**ServerProperties**](https://docs.ionos.com/sections-test/java-sdk/cloud-api-java-sdk/models/serverproperties) | The properties of the server to be updated.                                                                                                                                                                                                                                                                                                                                                                                              |                                |
| **pretty**          | **Boolean**                                                                                                      | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional] \[default to true] |
| **depth**           | **Integer**                                                                                                      | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional] \[default to 0]    |
| **xContractNumber** | **Integer**                                                                                                      | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                    |

#### Return type

[**Server**](https://docs.ionos.com/sections-test/java-sdk/cloud-api-java-sdk/models/server)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the datacentersServersPatchWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersServersPatch instead

#### Example

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

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    
    // Configure HTTP basic authorization: Basic Authentication
    HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("Basic Authentication");
    basicAuthentication.setUsername("YOUR USERNAME");
    basicAuthentication.setPassword("YOUR PASSWORD");

    // Configure Api Key authorization: Token Authentication
    defaultClient.setApiKeyWithBearerPrefix("YOUR TOKEN");

    ServersApi apiInstance = new ServersApi(defaultClient);
    String datacenterId = "datacenterId_example"; // String | The unique ID of the data center.
    String serverId = "serverId_example"; // String | The unique ID of the server.
    ServerProperties server = new ServerProperties(); // ServerProperties | The properties of the server to be updated.
    Boolean pretty = true; // Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
    Integer depth = 0; // Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
    Integer xContractNumber = 56; // Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
    try {
      ApiResponse<Server> result = apiInstance.datacentersServersPatchWithHttpInfo(datacenterId, serverId, server, pretty, depth, xContractNumber);
      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 ServersApi#datacentersServersPatch");
      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.

For convenience, you can alternatively use a builder, which allows to omit optional parameters:

```java
    try {
        Server result = apiInstance.datacentersServersPatch(datacenterId, serverId, server)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ServersApi#datacentersServersPatch");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersServersPost**

> Server datacentersServersPost(datacenterId, server, pretty, depth, xContractNumber)

Create a Server

Creates a server within the specified data center. You can also use this request to configure the boot volumes and connect to existing LANs at the same time.

#### Parameters

| Name                | Type                                                                                         | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | -------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **datacenterId**    | **String**                                                                                   | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                                |
| **server**          | [**Server**](https://docs.ionos.com/sections-test/java-sdk/cloud-api-java-sdk/models/server) | The server to create.                                                                                                                                                                                                                                                                                                                                                                                                                    |                                |
| **pretty**          | **Boolean**                                                                                  | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional] \[default to true] |
| **depth**           | **Integer**                                                                                  | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional] \[default to 0]    |
| **xContractNumber** | **Integer**                                                                                  | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                    |

#### Return type

[**Server**](https://docs.ionos.com/sections-test/java-sdk/cloud-api-java-sdk/models/server)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the datacentersServersPostWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersServersPost instead

#### Example

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

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    
    // Configure HTTP basic authorization: Basic Authentication
    HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("Basic Authentication");
    basicAuthentication.setUsername("YOUR USERNAME");
    basicAuthentication.setPassword("YOUR PASSWORD");

    // Configure Api Key authorization: Token Authentication
    defaultClient.setApiKeyWithBearerPrefix("YOUR TOKEN");

    ServersApi apiInstance = new ServersApi(defaultClient);
    String datacenterId = "datacenterId_example"; // String | The unique ID of the data center.
    properties = new ServerProperties(); // ServerProperties | 
    server = new Server(ServerProperties); // Server | The server to create.
    Boolean pretty = true; // Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
    Integer depth = 0; // Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
    Integer xContractNumber = 56; // Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
    try {
      ApiResponse<Server> result = apiInstance.datacentersServersPostWithHttpInfo(datacenterId, server, pretty, depth, xContractNumber);
      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 ServersApi#datacentersServersPost");
      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.

For convenience, you can alternatively use a builder, which allows to omit optional parameters:

```java
    try {
        Server result = apiInstance.datacentersServersPost(datacenterId, server)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ServersApi#datacentersServersPost");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersServersPut**

> Server datacentersServersPut(datacenterId, serverId, server, pretty, depth, xContractNumber)

Modify a Server by ID

Modifies the properties of the specified server within the data center. Starting with v5, the 'allowReboot' attribute is retired; while previously required for changing certain server properties, this behavior is now implicit, and the backend will perform this automatically. For example, in earlier versions, when the CPU family is changed, 'allowReboot' had to be set to 'true'; this is no longer required, the reboot will be performed automatically.

#### Parameters

| Name                | Type                                                                                         | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | -------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **datacenterId**    | **String**                                                                                   | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                                |
| **serverId**        | **String**                                                                                   | The unique ID of the server.                                                                                                                                                                                                                                                                                                                                                                                                             |                                |
| **server**          | [**Server**](https://docs.ionos.com/sections-test/java-sdk/cloud-api-java-sdk/models/server) | The modified server                                                                                                                                                                                                                                                                                                                                                                                                                      |                                |
| **pretty**          | **Boolean**                                                                                  | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional] \[default to true] |
| **depth**           | **Integer**                                                                                  | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional] \[default to 0]    |
| **xContractNumber** | **Integer**                                                                                  | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                    |

#### Return type

[**Server**](https://docs.ionos.com/sections-test/java-sdk/cloud-api-java-sdk/models/server)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the datacentersServersPutWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersServersPut instead

#### Example

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

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    
    // Configure HTTP basic authorization: Basic Authentication
    HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("Basic Authentication");
    basicAuthentication.setUsername("YOUR USERNAME");
    basicAuthentication.setPassword("YOUR PASSWORD");

    // Configure Api Key authorization: Token Authentication
    defaultClient.setApiKeyWithBearerPrefix("YOUR TOKEN");

    ServersApi apiInstance = new ServersApi(defaultClient);
    String datacenterId = "datacenterId_example"; // String | The unique ID of the data center.
    String serverId = "serverId_example"; // String | The unique ID of the server.
    properties = new ServerProperties(); // ServerProperties | 
    server = new Server(ServerProperties); // Server | The modified server
    Boolean pretty = true; // Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
    Integer depth = 0; // Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
    Integer xContractNumber = 56; // Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
    try {
      ApiResponse<Server> result = apiInstance.datacentersServersPutWithHttpInfo(datacenterId, serverId, server, pretty, depth, xContractNumber);
      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 ServersApi#datacentersServersPut");
      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.

For convenience, you can alternatively use a builder, which allows to omit optional parameters:

```java
    try {
        Server result = apiInstance.datacentersServersPut(datacenterId, serverId, server)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ServersApi#datacentersServersPut");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersServersRebootPost**

> datacentersServersRebootPost(datacenterId, serverId, pretty, depth, xContractNumber)

Reboot servers

Force a hard reboot of the specified server within the data center. Don't use this method if you wish to reboot gracefully. This is an equivalent of powering down a computer and turning it back on.

#### Parameters

| Name                | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **datacenterId**    | **String**  | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                                |
| **serverId**        | **String**  | The unique ID of the server.                                                                                                                                                                                                                                                                                                                                                                                                             |                                |
| **pretty**          | **Boolean** | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional] \[default to true] |
| **depth**           | **Integer** | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional] \[default to 0]    |
| **xContractNumber** | **Integer** | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                    |

#### Return type

null (empty response body)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the datacentersServersRebootPostWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersServersRebootPost instead

#### Example

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

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    
    // Configure HTTP basic authorization: Basic Authentication
    HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("Basic Authentication");
    basicAuthentication.setUsername("YOUR USERNAME");
    basicAuthentication.setPassword("YOUR PASSWORD");

    // Configure Api Key authorization: Token Authentication
    defaultClient.setApiKeyWithBearerPrefix("YOUR TOKEN");

    ServersApi apiInstance = new ServersApi(defaultClient);
    String datacenterId = "datacenterId_example"; // String | The unique ID of the data center.
    String serverId = "serverId_example"; // String | The unique ID of the server.
    Boolean pretty = true; // Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
    Integer depth = 0; // Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
    Integer xContractNumber = 56; // Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
    try {
      apiInstance.datacentersServersRebootPostWithHttpInfo(datacenterId, serverId, pretty, depth, xContractNumber);
    } catch (ApiException e) {
      System.err.println("Exception when calling ServersApi#datacentersServersRebootPost");
      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.

For convenience, you can alternatively use a builder, which allows to omit optional parameters:

```java
    try {
        apiInstance.datacentersServersRebootPost(datacenterId, serverId)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ServersApi#datacentersServersRebootPost");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersServersRemoteConsoleGet**

> RemoteConsoleUrl datacentersServersRemoteConsoleGet(datacenterId, serverId, pretty, depth, xContractNumber)

Get Remote Console link

Retrieve a link with a JSON Web Token for accessing the server's Remote Console.

#### Parameters

| Name                | Type                 | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **datacenterId**    | **String**           | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                                |
| **serverId**        | **String**           | The unique ID of the server.                                                                                                                                                                                                                                                                                                                                                                                                             |                                |
| **pretty**          | **Boolean**          | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional] \[default to true] |
| **depth**           | **Integer**          | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional] \[default to 0]    |
| **xContractNumber** | **Integer**          | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                    |
| orderBy             | String               | Sorts the results alphanumerically in ascending order based on the specified property.                                                                                                                                                                                                                                                                                                                                                   | \[optional]                    |
| maxResults          | Integer              | Limits the number of results returned.                                                                                                                                                                                                                                                                                                                                                                                                   | \[optional]                    |
| filters             | Map\<String, String> | Limit results to those containing a matching value for a specific property.                                                                                                                                                                                                                                                                                                                                                              | \[optional]                    |

#### Return type

[**RemoteConsoleUrl**](https://docs.ionos.com/sections-test/java-sdk/cloud-api-java-sdk/models/remoteconsoleurl)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the datacentersServersRemoteConsoleGetWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersServersRemoteConsoleGet instead

#### Example

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

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    
    // Configure HTTP basic authorization: Basic Authentication
    HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("Basic Authentication");
    basicAuthentication.setUsername("YOUR USERNAME");
    basicAuthentication.setPassword("YOUR PASSWORD");

    // Configure Api Key authorization: Token Authentication
    defaultClient.setApiKeyWithBearerPrefix("YOUR TOKEN");

    ServersApi apiInstance = new ServersApi(defaultClient);
    String datacenterId = "datacenterId_example"; // String | The unique ID of the data center.
    String serverId = "serverId_example"; // String | The unique ID of the server.
    Boolean pretty = true; // Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
    Integer depth = 0; // Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
    Integer xContractNumber = 56; // Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
    String orderBy = "orderBy_example"; // String | Order by field
    Integer maxResults = "maxResults_example"; // Integer | Maximum number of results to return
    Map<String, String> filters = new HashMap<String, String>(); // Map<String, String> | Filter results by field
    try {
      ApiResponse<RemoteConsoleUrl> result = apiInstance.datacentersServersRemoteConsoleGetWithHttpInfo(datacenterId, serverId, pretty, depth, xContractNumber, 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 ServersApi#datacentersServersRemoteConsoleGet");
      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.

For convenience, you can alternatively use a builder, which allows to omit optional parameters:

```java
    try {
        RemoteConsoleUrl result = apiInstance.datacentersServersRemoteConsoleGet(datacenterId, serverId)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .orderBy("orderBy_example")
                .maxResults(5)
                .filters(filters)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ServersApi#datacentersServersRemoteConsoleGet");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersServersResumePost**

> datacentersServersResumePost(datacenterId, serverId, pretty, depth, xContractNumber)

Resume a Cube Server by ID

Resumes a suspended Cube Server specified by its ID. Since the suspended instance was not deleted the allocated resources continue to be billed. You can perform this operation only for Cube Servers. To check the status of the request, you can use the 'Location' HTTP header in the response (see 'Requests' for more information).

#### Parameters

| Name                | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **datacenterId**    | **String**  | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                                |
| **serverId**        | **String**  | The unique ID of the server.                                                                                                                                                                                                                                                                                                                                                                                                             |                                |
| **pretty**          | **Boolean** | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional] \[default to true] |
| **depth**           | **Integer** | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional] \[default to 0]    |
| **xContractNumber** | **Integer** | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                    |

#### Return type

null (empty response body)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the datacentersServersResumePostWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersServersResumePost instead

#### Example

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

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    
    // Configure HTTP basic authorization: Basic Authentication
    HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("Basic Authentication");
    basicAuthentication.setUsername("YOUR USERNAME");
    basicAuthentication.setPassword("YOUR PASSWORD");

    // Configure Api Key authorization: Token Authentication
    defaultClient.setApiKeyWithBearerPrefix("YOUR TOKEN");

    ServersApi apiInstance = new ServersApi(defaultClient);
    String datacenterId = "datacenterId_example"; // String | The unique ID of the data center.
    String serverId = "serverId_example"; // String | The unique ID of the server.
    Boolean pretty = true; // Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
    Integer depth = 0; // Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
    Integer xContractNumber = 56; // Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
    try {
      apiInstance.datacentersServersResumePostWithHttpInfo(datacenterId, serverId, pretty, depth, xContractNumber);
    } catch (ApiException e) {
      System.err.println("Exception when calling ServersApi#datacentersServersResumePost");
      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.

For convenience, you can alternatively use a builder, which allows to omit optional parameters:

```java
    try {
        apiInstance.datacentersServersResumePost(datacenterId, serverId)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ServersApi#datacentersServersResumePost");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersServersStartPost**

> datacentersServersStartPost(datacenterId, serverId, pretty, depth, xContractNumber)

Start an Enterprise Server by ID

Starts the Enterprise Server specified by its ID. >Note that you cannot use this method to start a Cube Server. By starting the Enterprise Server, cores and RAM are provisioned, and the billing continues. If the server's public IPv4 address has been deallocated, a new IPv4 address will be assigned. IPv6 blocks and addresses will remain unchanged when stopping and starting a server. To check the status of the request, you can use the 'Location' HTTP header in the response (see 'Requests' for more information).

#### Parameters

| Name                | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **datacenterId**    | **String**  | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                                |
| **serverId**        | **String**  | The unique ID of the server.                                                                                                                                                                                                                                                                                                                                                                                                             |                                |
| **pretty**          | **Boolean** | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional] \[default to true] |
| **depth**           | **Integer** | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional] \[default to 0]    |
| **xContractNumber** | **Integer** | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                    |

#### Return type

null (empty response body)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the datacentersServersStartPostWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersServersStartPost instead

#### Example

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

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    
    // Configure HTTP basic authorization: Basic Authentication
    HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("Basic Authentication");
    basicAuthentication.setUsername("YOUR USERNAME");
    basicAuthentication.setPassword("YOUR PASSWORD");

    // Configure Api Key authorization: Token Authentication
    defaultClient.setApiKeyWithBearerPrefix("YOUR TOKEN");

    ServersApi apiInstance = new ServersApi(defaultClient);
    String datacenterId = "datacenterId_example"; // String | The unique ID of the data center.
    String serverId = "serverId_example"; // String | The unique ID of the server.
    Boolean pretty = true; // Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
    Integer depth = 0; // Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
    Integer xContractNumber = 56; // Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
    try {
      apiInstance.datacentersServersStartPostWithHttpInfo(datacenterId, serverId, pretty, depth, xContractNumber);
    } catch (ApiException e) {
      System.err.println("Exception when calling ServersApi#datacentersServersStartPost");
      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.

For convenience, you can alternatively use a builder, which allows to omit optional parameters:

```java
    try {
        apiInstance.datacentersServersStartPost(datacenterId, serverId)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ServersApi#datacentersServersStartPost");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersServersStopPost**

> datacentersServersStopPost(datacenterId, serverId, pretty, depth, xContractNumber)

Stop an Enterprise Server by ID

Stops the Enterprise Server specified by its ID. >Note that you cannot use this method to stop a Cube Server. By stopping the Enterprise Server, cores and RAM are freed and no longer charged. Public IPv4 IPs that are not reserved are returned to the IPv4 pool. IPv6 blocks and addresses will remain unchanged when stopping and starting a server. To check the status of the request, you can use the 'Location' HTTP header in the response (see 'Requests' for more information).

#### Parameters

| Name                | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **datacenterId**    | **String**  | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                                |
| **serverId**        | **String**  | The unique ID of the server.                                                                                                                                                                                                                                                                                                                                                                                                             |                                |
| **pretty**          | **Boolean** | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional] \[default to true] |
| **depth**           | **Integer** | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional] \[default to 0]    |
| **xContractNumber** | **Integer** | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                    |

#### Return type

null (empty response body)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the datacentersServersStopPostWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersServersStopPost instead

#### Example

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

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    
    // Configure HTTP basic authorization: Basic Authentication
    HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("Basic Authentication");
    basicAuthentication.setUsername("YOUR USERNAME");
    basicAuthentication.setPassword("YOUR PASSWORD");

    // Configure Api Key authorization: Token Authentication
    defaultClient.setApiKeyWithBearerPrefix("YOUR TOKEN");

    ServersApi apiInstance = new ServersApi(defaultClient);
    String datacenterId = "datacenterId_example"; // String | The unique ID of the data center.
    String serverId = "serverId_example"; // String | The unique ID of the server.
    Boolean pretty = true; // Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
    Integer depth = 0; // Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
    Integer xContractNumber = 56; // Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
    try {
      apiInstance.datacentersServersStopPostWithHttpInfo(datacenterId, serverId, pretty, depth, xContractNumber);
    } catch (ApiException e) {
      System.err.println("Exception when calling ServersApi#datacentersServersStopPost");
      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.

For convenience, you can alternatively use a builder, which allows to omit optional parameters:

```java
    try {
        apiInstance.datacentersServersStopPost(datacenterId, serverId)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ServersApi#datacentersServersStopPost");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersServersSuspendPost**

> datacentersServersSuspendPost(datacenterId, serverId, pretty, depth, xContractNumber)

Suspend a Cube Server by ID

Suspends the specified Cubes instance within the data center. The instance is not deleted and allocated resources continue to be billed. You can perform this operation only for Cube Servers. To check the status of the request, you can use the 'Location' HTTP header in the response (see 'Requests' for more information).

#### Parameters

| Name                | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **datacenterId**    | **String**  | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                                |
| **serverId**        | **String**  | The unique ID of the server.                                                                                                                                                                                                                                                                                                                                                                                                             |                                |
| **pretty**          | **Boolean** | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional] \[default to true] |
| **depth**           | **Integer** | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional] \[default to 0]    |
| **xContractNumber** | **Integer** | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                    |

#### Return type

null (empty response body)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the datacentersServersSuspendPostWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersServersSuspendPost instead

#### Example

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

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    
    // Configure HTTP basic authorization: Basic Authentication
    HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("Basic Authentication");
    basicAuthentication.setUsername("YOUR USERNAME");
    basicAuthentication.setPassword("YOUR PASSWORD");

    // Configure Api Key authorization: Token Authentication
    defaultClient.setApiKeyWithBearerPrefix("YOUR TOKEN");

    ServersApi apiInstance = new ServersApi(defaultClient);
    String datacenterId = "datacenterId_example"; // String | The unique ID of the data center.
    String serverId = "serverId_example"; // String | The unique ID of the server.
    Boolean pretty = true; // Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
    Integer depth = 0; // Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
    Integer xContractNumber = 56; // Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
    try {
      apiInstance.datacentersServersSuspendPostWithHttpInfo(datacenterId, serverId, pretty, depth, xContractNumber);
    } catch (ApiException e) {
      System.err.println("Exception when calling ServersApi#datacentersServersSuspendPost");
      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.

For convenience, you can alternatively use a builder, which allows to omit optional parameters:

```java
    try {
        apiInstance.datacentersServersSuspendPost(datacenterId, serverId)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ServersApi#datacentersServersSuspendPost");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersServersTokenGet**

> Token datacentersServersTokenGet(datacenterId, serverId, pretty, depth, xContractNumber)

Get JASON Web Token

Retrieve a JSON Web Token from the server for use in login operations (such as accessing the server's console).

#### Parameters

| Name                | Type                 | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **datacenterId**    | **String**           | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                                |
| **serverId**        | **String**           | The unique ID of the server.                                                                                                                                                                                                                                                                                                                                                                                                             |                                |
| **pretty**          | **Boolean**          | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional] \[default to true] |
| **depth**           | **Integer**          | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional] \[default to 0]    |
| **xContractNumber** | **Integer**          | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                    |
| orderBy             | String               | Sorts the results alphanumerically in ascending order based on the specified property.                                                                                                                                                                                                                                                                                                                                                   | \[optional]                    |
| maxResults          | Integer              | Limits the number of results returned.                                                                                                                                                                                                                                                                                                                                                                                                   | \[optional]                    |
| filters             | Map\<String, String> | Limit results to those containing a matching value for a specific property.                                                                                                                                                                                                                                                                                                                                                              | \[optional]                    |

#### Return type

[**Token**](https://docs.ionos.com/sections-test/java-sdk/cloud-api-java-sdk/models/token)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the datacentersServersTokenGetWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersServersTokenGet instead

#### Example

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

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    
    // Configure HTTP basic authorization: Basic Authentication
    HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("Basic Authentication");
    basicAuthentication.setUsername("YOUR USERNAME");
    basicAuthentication.setPassword("YOUR PASSWORD");

    // Configure Api Key authorization: Token Authentication
    defaultClient.setApiKeyWithBearerPrefix("YOUR TOKEN");

    ServersApi apiInstance = new ServersApi(defaultClient);
    String datacenterId = "datacenterId_example"; // String | The unique ID of the data center.
    String serverId = "serverId_example"; // String | The unique ID of the server.
    Boolean pretty = true; // Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
    Integer depth = 0; // Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
    Integer xContractNumber = 56; // Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
    String orderBy = "orderBy_example"; // String | Order by field
    Integer maxResults = "maxResults_example"; // Integer | Maximum number of results to return
    Map<String, String> filters = new HashMap<String, String>(); // Map<String, String> | Filter results by field
    try {
      ApiResponse<Token> result = apiInstance.datacentersServersTokenGetWithHttpInfo(datacenterId, serverId, pretty, depth, xContractNumber, 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 ServersApi#datacentersServersTokenGet");
      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.

For convenience, you can alternatively use a builder, which allows to omit optional parameters:

```java
    try {
        Token result = apiInstance.datacentersServersTokenGet(datacenterId, serverId)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .orderBy("orderBy_example")
                .maxResults(5)
                .filters(filters)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ServersApi#datacentersServersTokenGet");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersServersUpgradePost**

> datacentersServersUpgradePost(datacenterId, serverId, pretty, depth, xContractNumber)

Upgrade a Server by ID

Upgrades the server version.

#### Parameters

| Name                | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **datacenterId**    | **String**  | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                                |
| **serverId**        | **String**  | The unique ID of the server.                                                                                                                                                                                                                                                                                                                                                                                                             |                                |
| **pretty**          | **Boolean** | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional] \[default to true] |
| **depth**           | **Integer** | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional] \[default to 0]    |
| **xContractNumber** | **Integer** | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                    |

#### Return type

null (empty response body)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the datacentersServersUpgradePostWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersServersUpgradePost instead

#### Example

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

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    
    // Configure HTTP basic authorization: Basic Authentication
    HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("Basic Authentication");
    basicAuthentication.setUsername("YOUR USERNAME");
    basicAuthentication.setPassword("YOUR PASSWORD");

    // Configure Api Key authorization: Token Authentication
    defaultClient.setApiKeyWithBearerPrefix("YOUR TOKEN");

    ServersApi apiInstance = new ServersApi(defaultClient);
    String datacenterId = "datacenterId_example"; // String | The unique ID of the data center.
    String serverId = "serverId_example"; // String | The unique ID of the server.
    Boolean pretty = true; // Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
    Integer depth = 0; // Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
    Integer xContractNumber = 56; // Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
    try {
      apiInstance.datacentersServersUpgradePostWithHttpInfo(datacenterId, serverId, pretty, depth, xContractNumber);
    } catch (ApiException e) {
      System.err.println("Exception when calling ServersApi#datacentersServersUpgradePost");
      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.

For convenience, you can alternatively use a builder, which allows to omit optional parameters:

```java
    try {
        apiInstance.datacentersServersUpgradePost(datacenterId, serverId)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ServersApi#datacentersServersUpgradePost");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersServersVolumesDelete**

> datacentersServersVolumesDelete(datacenterId, serverId, volumeId, pretty, depth, xContractNumber)

Detach a Volume by ID

Detachs the specified volume from the server. Note that only the volume's connection to the specified server is disconnected. If you want to delete the volume, you must submit a separate request to perform the deletion.

#### Parameters

| Name                | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **datacenterId**    | **String**  | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                                |
| **serverId**        | **String**  | The unique ID of the server.                                                                                                                                                                                                                                                                                                                                                                                                             |                                |
| **volumeId**        | **String**  | The unique ID of the volume.                                                                                                                                                                                                                                                                                                                                                                                                             |                                |
| **pretty**          | **Boolean** | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional] \[default to true] |
| **depth**           | **Integer** | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional] \[default to 0]    |
| **xContractNumber** | **Integer** | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                    |

#### Return type

null (empty response body)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the datacentersServersVolumesDeleteWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersServersVolumesDelete instead

#### Example

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

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    
    // Configure HTTP basic authorization: Basic Authentication
    HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("Basic Authentication");
    basicAuthentication.setUsername("YOUR USERNAME");
    basicAuthentication.setPassword("YOUR PASSWORD");

    // Configure Api Key authorization: Token Authentication
    defaultClient.setApiKeyWithBearerPrefix("YOUR TOKEN");

    ServersApi apiInstance = new ServersApi(defaultClient);
    String datacenterId = "datacenterId_example"; // String | The unique ID of the data center.
    String serverId = "serverId_example"; // String | The unique ID of the server.
    String volumeId = "volumeId_example"; // String | The unique ID of the volume.
    Boolean pretty = true; // Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
    Integer depth = 0; // Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
    Integer xContractNumber = 56; // Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
    try {
      apiInstance.datacentersServersVolumesDeleteWithHttpInfo(datacenterId, serverId, volumeId, pretty, depth, xContractNumber);
    } catch (ApiException e) {
      System.err.println("Exception when calling ServersApi#datacentersServersVolumesDelete");
      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.

For convenience, you can alternatively use a builder, which allows to omit optional parameters:

```java
    try {
        apiInstance.datacentersServersVolumesDelete(datacenterId, serverId, volumeId)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ServersApi#datacentersServersVolumesDelete");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersServersVolumesFindById**

> Volume datacentersServersVolumesFindById(datacenterId, serverId, volumeId, pretty, depth, xContractNumber)

Get Attached Volume by ID

Retrieves the properties of the volume attached to the specified server.

#### Parameters

| Name                | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **datacenterId**    | **String**  | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                                |
| **serverId**        | **String**  | The unique ID of the server.                                                                                                                                                                                                                                                                                                                                                                                                             |                                |
| **volumeId**        | **String**  | The unique ID of the volume.                                                                                                                                                                                                                                                                                                                                                                                                             |                                |
| **pretty**          | **Boolean** | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional] \[default to true] |
| **depth**           | **Integer** | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional] \[default to 0]    |
| **xContractNumber** | **Integer** | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                    |

#### Return type

[**Volume**](https://docs.ionos.com/sections-test/java-sdk/cloud-api-java-sdk/models/volume)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the datacentersServersVolumesFindByIdWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersServersVolumesFindById instead

#### Example

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

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    
    // Configure HTTP basic authorization: Basic Authentication
    HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("Basic Authentication");
    basicAuthentication.setUsername("YOUR USERNAME");
    basicAuthentication.setPassword("YOUR PASSWORD");

    // Configure Api Key authorization: Token Authentication
    defaultClient.setApiKeyWithBearerPrefix("YOUR TOKEN");

    ServersApi apiInstance = new ServersApi(defaultClient);
    String datacenterId = "datacenterId_example"; // String | The unique ID of the data center.
    String serverId = "serverId_example"; // String | The unique ID of the server.
    String volumeId = "volumeId_example"; // String | The unique ID of the volume.
    Boolean pretty = true; // Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
    Integer depth = 0; // Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
    Integer xContractNumber = 56; // Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
    try {
      ApiResponse<Volume> result = apiInstance.datacentersServersVolumesFindByIdWithHttpInfo(datacenterId, serverId, volumeId, pretty, depth, xContractNumber);
      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 ServersApi#datacentersServersVolumesFindById");
      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.

For convenience, you can alternatively use a builder, which allows to omit optional parameters:

```java
    try {
        Volume result = apiInstance.datacentersServersVolumesFindById(datacenterId, serverId, volumeId)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ServersApi#datacentersServersVolumesFindById");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersServersVolumesGet**

> AttachedVolumes datacentersServersVolumesGet(datacenterId, serverId, pretty, depth, xContractNumber, offset, limit)

Get Attached Volumes

Lists all volumes attached to the specified server.

#### Parameters

| Name                | Type                 | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **datacenterId**    | **String**           | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                                |
| **serverId**        | **String**           | The unique ID of the server.                                                                                                                                                                                                                                                                                                                                                                                                             |                                |
| **pretty**          | **Boolean**          | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional] \[default to true] |
| **depth**           | **Integer**          | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional] \[default to 0]    |
| **xContractNumber** | **Integer**          | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                    |
| **offset**          | **Integer**          | The first element (from the complete list of the elements) to include in the response (used together with \<b>\<i>limit\</i>\</b> for pagination).                                                                                                                                                                                                                                                                                       | \[optional] \[default to 0]    |
| **limit**           | **Integer**          | The maximum number of elements to return (use together with offset for pagination).                                                                                                                                                                                                                                                                                                                                                      | \[optional] \[default to 1000] |
| orderBy             | String               | Sorts the results alphanumerically in ascending order based on the specified property.                                                                                                                                                                                                                                                                                                                                                   | \[optional]                    |
| maxResults          | Integer              | Limits the number of results returned.                                                                                                                                                                                                                                                                                                                                                                                                   | \[optional]                    |
| filters             | Map\<String, String> | Limit results to those containing a matching value for a specific property.                                                                                                                                                                                                                                                                                                                                                              | \[optional]                    |

#### Return type

[**AttachedVolumes**](https://docs.ionos.com/sections-test/java-sdk/cloud-api-java-sdk/models/attachedvolumes)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the datacentersServersVolumesGetWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersServersVolumesGet instead

#### Example

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

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    
    // Configure HTTP basic authorization: Basic Authentication
    HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("Basic Authentication");
    basicAuthentication.setUsername("YOUR USERNAME");
    basicAuthentication.setPassword("YOUR PASSWORD");

    // Configure Api Key authorization: Token Authentication
    defaultClient.setApiKeyWithBearerPrefix("YOUR TOKEN");

    ServersApi apiInstance = new ServersApi(defaultClient);
    String datacenterId = "datacenterId_example"; // String | The unique ID of the data center.
    String serverId = "serverId_example"; // String | The unique ID of the server.
    Boolean pretty = true; // Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
    Integer depth = 0; // Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
    Integer xContractNumber = 56; // Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
    Integer offset = 0; // Integer | The first element (from the complete list of the elements) to include in the response (used together with <b><i>limit</i></b> for pagination).
    Integer limit = 1000; // Integer | The maximum number of elements to return (use together with offset for pagination).
    String orderBy = "orderBy_example"; // String | Order by field
    Integer maxResults = "maxResults_example"; // Integer | Maximum number of results to return
    Map<String, String> filters = new HashMap<String, String>(); // Map<String, String> | Filter results by field
    try {
      ApiResponse<AttachedVolumes> result = apiInstance.datacentersServersVolumesGetWithHttpInfo(datacenterId, serverId, pretty, depth, xContractNumber, offset, limit, 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 ServersApi#datacentersServersVolumesGet");
      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.

For convenience, you can alternatively use a builder, which allows to omit optional parameters:

```java
    try {
        AttachedVolumes result = apiInstance.datacentersServersVolumesGet(datacenterId, serverId)
                .pretty(true)
                .depth(0)
                .offset(0)
                .limit(1000)
                .xContractNumber(56)
                .orderBy("orderBy_example")
                .maxResults(5)
                .filters(filters)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ServersApi#datacentersServersVolumesGet");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersServersVolumesPost**

> Volume datacentersServersVolumesPost(datacenterId, serverId, volume, pretty, depth, xContractNumber)

Attach a Volume to a Server

Attachs an existing storage volume to the specified server. You can attach an existing volume in the VDC to a server. To move a volume from one server to another, you must first detach the volume from the first server and attach it to the second server. It is also possible to create and attach a volume in one step by simply providing a new volume description as a payload. The only difference is the URL; see 'Creating a Volume' for details about volumes. Note that the combined total of attached volumes and NICs cannot exceed 24 per server.

#### Parameters

| Name                | Type                                                                                         | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | -------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **datacenterId**    | **String**                                                                                   | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                                |
| **serverId**        | **String**                                                                                   | The unique ID of the server.                                                                                                                                                                                                                                                                                                                                                                                                             |                                |
| **volume**          | [**Volume**](https://docs.ionos.com/sections-test/java-sdk/cloud-api-java-sdk/models/volume) | The volume to be attached (or created and attached).                                                                                                                                                                                                                                                                                                                                                                                     |                                |
| **pretty**          | **Boolean**                                                                                  | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional] \[default to true] |
| **depth**           | **Integer**                                                                                  | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional] \[default to 0]    |
| **xContractNumber** | **Integer**                                                                                  | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                    |

#### Return type

[**Volume**](https://docs.ionos.com/sections-test/java-sdk/cloud-api-java-sdk/models/volume)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the datacentersServersVolumesPostWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersServersVolumesPost instead

#### Example

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

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    
    // Configure HTTP basic authorization: Basic Authentication
    HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("Basic Authentication");
    basicAuthentication.setUsername("YOUR USERNAME");
    basicAuthentication.setPassword("YOUR PASSWORD");

    // Configure Api Key authorization: Token Authentication
    defaultClient.setApiKeyWithBearerPrefix("YOUR TOKEN");

    ServersApi apiInstance = new ServersApi(defaultClient);
    String datacenterId = "datacenterId_example"; // String | The unique ID of the data center.
    String serverId = "serverId_example"; // String | The unique ID of the server.
    properties = new VolumeProperties(); // VolumeProperties | 
    volume = new Volume(VolumeProperties); // Volume | The volume to be attached (or created and attached).
    Boolean pretty = true; // Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
    Integer depth = 0; // Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
    Integer xContractNumber = 56; // Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
    try {
      ApiResponse<Volume> result = apiInstance.datacentersServersVolumesPostWithHttpInfo(datacenterId, serverId, volume, pretty, depth, xContractNumber);
      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 ServersApi#datacentersServersVolumesPost");
      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.

For convenience, you can alternatively use a builder, which allows to omit optional parameters:

```java
    try {
        Volume result = apiInstance.datacentersServersVolumesPost(datacenterId, serverId, volume)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ServersApi#datacentersServersVolumesPost");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```
