# LabelsApi

## LabelsApi

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

| Method                                                                      | HTTP request                                                           | Description                       |
| --------------------------------------------------------------------------- | ---------------------------------------------------------------------- | --------------------------------- |
| [**datacentersLabelsDelete**](#datacenterslabelsdelete)                     | **DELETE** /datacenters/{datacenterId}/labels/{key}                    | Delete data center labels         |
| [**datacentersLabelsFindByKey**](#datacenterslabelsfindbykey)               | **GET** /datacenters/{datacenterId}/labels/{key}                       | Retrieve data center labels       |
| [**datacentersLabelsGet**](#datacenterslabelsget)                           | **GET** /datacenters/{datacenterId}/labels                             | List data center labels           |
| [**datacentersLabelsPost**](#datacenterslabelspost)                         | **POST** /datacenters/{datacenterId}/labels                            | Create a Data Center Label        |
| [**datacentersLabelsPut**](#datacenterslabelsput)                           | **PUT** /datacenters/{datacenterId}/labels/{key}                       | Modify a Data Center Label by Key |
| [**datacentersServersLabelsDelete**](#datacentersserverslabelsdelete)       | **DELETE** /datacenters/{datacenterId}/servers/{serverId}/labels/{key} | Delete server labels              |
| [**datacentersServersLabelsFindByKey**](#datacentersserverslabelsfindbykey) | **GET** /datacenters/{datacenterId}/servers/{serverId}/labels/{key}    | Retrieve server labels            |
| [**datacentersServersLabelsGet**](#datacentersserverslabelsget)             | **GET** /datacenters/{datacenterId}/servers/{serverId}/labels          | List server labels                |
| [**datacentersServersLabelsPost**](#datacentersserverslabelspost)           | **POST** /datacenters/{datacenterId}/servers/{serverId}/labels         | Create a Server Label             |
| [**datacentersServersLabelsPut**](#datacentersserverslabelsput)             | **PUT** /datacenters/{datacenterId}/servers/{serverId}/labels/{key}    | Modify a Server Label             |
| [**datacentersVolumesLabelsDelete**](#datacentersvolumeslabelsdelete)       | **DELETE** /datacenters/{datacenterId}/volumes/{volumeId}/labels/{key} | Delete volume labels              |
| [**datacentersVolumesLabelsFindByKey**](#datacentersvolumeslabelsfindbykey) | **GET** /datacenters/{datacenterId}/volumes/{volumeId}/labels/{key}    | Retrieve volume labels            |
| [**datacentersVolumesLabelsGet**](#datacentersvolumeslabelsget)             | **GET** /datacenters/{datacenterId}/volumes/{volumeId}/labels          | List volume labels                |
| [**datacentersVolumesLabelsPost**](#datacentersvolumeslabelspost)           | **POST** /datacenters/{datacenterId}/volumes/{volumeId}/labels         | Create a Volume Label             |
| [**datacentersVolumesLabelsPut**](#datacentersvolumeslabelsput)             | **PUT** /datacenters/{datacenterId}/volumes/{volumeId}/labels/{key}    | Modify a Volume Label             |
| [**ipblocksLabelsDelete**](#ipblockslabelsdelete)                           | **DELETE** /ipblocks/{ipblockId}/labels/{key}                          | Delete IP block labels            |
| [**ipblocksLabelsFindByKey**](#ipblockslabelsfindbykey)                     | **GET** /ipblocks/{ipblockId}/labels/{key}                             | Retrieve IP block labels          |
| [**ipblocksLabelsGet**](#ipblockslabelsget)                                 | **GET** /ipblocks/{ipblockId}/labels                                   | List IP block labels              |
| [**ipblocksLabelsPost**](#ipblockslabelspost)                               | **POST** /ipblocks/{ipblockId}/labels                                  | Create IP block labels            |
| [**ipblocksLabelsPut**](#ipblockslabelsput)                                 | **PUT** /ipblocks/{ipblockId}/labels/{key}                             | Modify a IP Block Label by ID     |
| [**labelsFindByUrn**](#labelsfindbyurn)                                     | **GET** /labels/{labelurn}                                             | Retrieve labels by URN            |
| [**labelsGet**](#labelsget)                                                 | **GET** /labels                                                        | List labels                       |
| [**snapshotsLabelsDelete**](#snapshotslabelsdelete)                         | **DELETE** /snapshots/{snapshotId}/labels/{key}                        | Delete snapshot labels            |
| [**snapshotsLabelsFindByKey**](#snapshotslabelsfindbykey)                   | **GET** /snapshots/{snapshotId}/labels/{key}                           | Retrieve snapshot labels          |
| [**snapshotsLabelsGet**](#snapshotslabelsget)                               | **GET** /snapshots/{snapshotId}/labels                                 | List snapshot labels              |
| [**snapshotsLabelsPost**](#snapshotslabelspost)                             | **POST** /snapshots/{snapshotId}/labels                                | Create a Snapshot Label           |
| [**snapshotsLabelsPut**](#snapshotslabelsput)                               | **PUT** /snapshots/{snapshotId}/labels/{key}                           | Modify a Snapshot Label by ID     |

## **datacentersLabelsDelete**

> datacentersLabelsDelete(datacenterId, key, pretty, depth, xContractNumber)

Delete data center labels

Delete the specified data center label.

#### Parameters

| Name                | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **datacenterId**    | **String**  | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                                |
| **key**             | **String**  | The label key                                                                                                                                                                                                                                                                                                                                                                                                                            |                                |
| **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 datacentersLabelsDeleteWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersLabelsDelete 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.LabelsApi;

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");

    LabelsApi apiInstance = new LabelsApi(defaultClient);
    String datacenterId = "datacenterId_example"; // String | The unique ID of the data center.
    String key = "key_example"; // String | The label key
    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.datacentersLabelsDeleteWithHttpInfo(datacenterId, key, pretty, depth, xContractNumber);
    } catch (ApiException e) {
      System.err.println("Exception when calling LabelsApi#datacentersLabelsDelete");
      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.datacentersLabelsDelete(datacenterId, key)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling LabelsApi#datacentersLabelsDelete");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersLabelsFindByKey**

> LabelResource datacentersLabelsFindByKey(datacenterId, key, pretty, depth, xContractNumber)

Retrieve data center labels

Retrieve the properties of the specified data center label.

#### Parameters

| Name                | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **datacenterId**    | **String**  | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                                |
| **key**             | **String**  | The label key                                                                                                                                                                                                                                                                                                                                                                                                                            |                                |
| **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

[**LabelResource**](/java-sdk/models/labelresource.md)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the datacentersLabelsFindByKeyWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersLabelsFindByKey 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.LabelsApi;

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");

    LabelsApi apiInstance = new LabelsApi(defaultClient);
    String datacenterId = "datacenterId_example"; // String | The unique ID of the data center.
    String key = "key_example"; // String | The label key
    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<LabelResource> result = apiInstance.datacentersLabelsFindByKeyWithHttpInfo(datacenterId, key, 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 LabelsApi#datacentersLabelsFindByKey");
      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 {
        LabelResource result = apiInstance.datacentersLabelsFindByKey(datacenterId, key)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling LabelsApi#datacentersLabelsFindByKey");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersLabelsGet**

> LabelResources datacentersLabelsGet(datacenterId, pretty, depth, xContractNumber)

List data center labels

List all the the labels for the specified 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]    |
| **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

[**LabelResources**](/java-sdk/models/labelresources.md)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the datacentersLabelsGetWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersLabelsGet 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.LabelsApi;

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");

    LabelsApi apiInstance = new LabelsApi(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
    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<LabelResources> result = apiInstance.datacentersLabelsGetWithHttpInfo(datacenterId, 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 LabelsApi#datacentersLabelsGet");
      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 {
        LabelResources result = apiInstance.datacentersLabelsGet(datacenterId)
                .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 LabelsApi#datacentersLabelsGet");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersLabelsPost**

> LabelResource datacentersLabelsPost(datacenterId, label, pretty, depth, xContractNumber)

Create a Data Center Label

Adds a new label to the specified data center.

#### Parameters

| Name                | Type                                                   | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **datacenterId**    | **String**                                             | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                                |
| **label**           | [**LabelResource**](/java-sdk/models/labelresource.md) | The label 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

[**LabelResource**](/java-sdk/models/labelresource.md)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the datacentersLabelsPostWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersLabelsPost 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.LabelsApi;

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");

    LabelsApi apiInstance = new LabelsApi(defaultClient);
    String datacenterId = "datacenterId_example"; // String | The unique ID of the data center.
    properties = new LabelResourceProperties(); // LabelResourceProperties | 
    label = new LabelResource(LabelResourceProperties); // LabelResource | The label 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<LabelResource> result = apiInstance.datacentersLabelsPostWithHttpInfo(datacenterId, label, 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 LabelsApi#datacentersLabelsPost");
      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 {
        LabelResource result = apiInstance.datacentersLabelsPost(datacenterId, label)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling LabelsApi#datacentersLabelsPost");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersLabelsPut**

> LabelResource datacentersLabelsPut(datacenterId, key, label, pretty, depth, xContractNumber)

Modify a Data Center Label by Key

Modifies the specified data center label.

#### Parameters

| Name                | Type                                                   | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **datacenterId**    | **String**                                             | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                                |
| **key**             | **String**                                             | The label key                                                                                                                                                                                                                                                                                                                                                                                                                            |                                |
| **label**           | [**LabelResource**](/java-sdk/models/labelresource.md) | The modified label                                                                                                                                                                                                                                                                                                                                                                                                                       |                                |
| **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

[**LabelResource**](/java-sdk/models/labelresource.md)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the datacentersLabelsPutWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersLabelsPut 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.LabelsApi;

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");

    LabelsApi apiInstance = new LabelsApi(defaultClient);
    String datacenterId = "datacenterId_example"; // String | The unique ID of the data center.
    String key = "key_example"; // String | The label key
    properties = new LabelResourceProperties(); // LabelResourceProperties | 
    label = new LabelResource(LabelResourceProperties); // LabelResource | The modified label
    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<LabelResource> result = apiInstance.datacentersLabelsPutWithHttpInfo(datacenterId, key, label, 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 LabelsApi#datacentersLabelsPut");
      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 {
        LabelResource result = apiInstance.datacentersLabelsPut(datacenterId, key, label)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling LabelsApi#datacentersLabelsPut");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersServersLabelsDelete**

> datacentersServersLabelsDelete(datacenterId, serverId, key, pretty, depth, xContractNumber)

Delete server labels

Delete the specified server label.

#### Parameters

| Name                | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **datacenterId**    | **String**  | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                                |
| **serverId**        | **String**  | The unique ID of the server.                                                                                                                                                                                                                                                                                                                                                                                                             |                                |
| **key**             | **String**  | The label key                                                                                                                                                                                                                                                                                                                                                                                                                            |                                |
| **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 datacentersServersLabelsDeleteWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersServersLabelsDelete 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.LabelsApi;

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");

    LabelsApi apiInstance = new LabelsApi(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 key = "key_example"; // String | The label key
    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.datacentersServersLabelsDeleteWithHttpInfo(datacenterId, serverId, key, pretty, depth, xContractNumber);
    } catch (ApiException e) {
      System.err.println("Exception when calling LabelsApi#datacentersServersLabelsDelete");
      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.datacentersServersLabelsDelete(datacenterId, serverId, key)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling LabelsApi#datacentersServersLabelsDelete");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersServersLabelsFindByKey**

> LabelResource datacentersServersLabelsFindByKey(datacenterId, serverId, key, pretty, depth, xContractNumber)

Retrieve server labels

Retrieve the properties of the specified server label.

#### Parameters

| Name                | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **datacenterId**    | **String**  | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                                |
| **serverId**        | **String**  | The unique ID of the server.                                                                                                                                                                                                                                                                                                                                                                                                             |                                |
| **key**             | **String**  | The label key                                                                                                                                                                                                                                                                                                                                                                                                                            |                                |
| **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

[**LabelResource**](/java-sdk/models/labelresource.md)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the datacentersServersLabelsFindByKeyWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersServersLabelsFindByKey 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.LabelsApi;

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");

    LabelsApi apiInstance = new LabelsApi(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 key = "key_example"; // String | The label key
    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<LabelResource> result = apiInstance.datacentersServersLabelsFindByKeyWithHttpInfo(datacenterId, serverId, key, 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 LabelsApi#datacentersServersLabelsFindByKey");
      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 {
        LabelResource result = apiInstance.datacentersServersLabelsFindByKey(datacenterId, serverId, key)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling LabelsApi#datacentersServersLabelsFindByKey");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersServersLabelsGet**

> LabelResources datacentersServersLabelsGet(datacenterId, serverId, pretty, depth, xContractNumber)

List server labels

List all the the labels for 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]                    |
| 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

[**LabelResources**](/java-sdk/models/labelresources.md)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the datacentersServersLabelsGetWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersServersLabelsGet 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.LabelsApi;

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");

    LabelsApi apiInstance = new LabelsApi(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<LabelResources> result = apiInstance.datacentersServersLabelsGetWithHttpInfo(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 LabelsApi#datacentersServersLabelsGet");
      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 {
        LabelResources result = apiInstance.datacentersServersLabelsGet(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 LabelsApi#datacentersServersLabelsGet");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersServersLabelsPost**

> LabelResource datacentersServersLabelsPost(datacenterId, serverId, label, pretty, depth, xContractNumber)

Create a Server Label

Adds a new label 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.                                                                                                                                                                                                                                                                                                                                                                                                             |                                |
| **label**           | [**LabelResource**](/java-sdk/models/labelresource.md) | The label 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

[**LabelResource**](/java-sdk/models/labelresource.md)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the datacentersServersLabelsPostWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersServersLabelsPost 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.LabelsApi;

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");

    LabelsApi apiInstance = new LabelsApi(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 LabelResourceProperties(); // LabelResourceProperties | 
    label = new LabelResource(LabelResourceProperties); // LabelResource | The label 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<LabelResource> result = apiInstance.datacentersServersLabelsPostWithHttpInfo(datacenterId, serverId, label, 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 LabelsApi#datacentersServersLabelsPost");
      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 {
        LabelResource result = apiInstance.datacentersServersLabelsPost(datacenterId, serverId, label)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling LabelsApi#datacentersServersLabelsPost");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersServersLabelsPut**

> LabelResource datacentersServersLabelsPut(datacenterId, serverId, key, label, pretty, depth, xContractNumber)

Modify a Server Label

Modifies the specified server label.

#### Parameters

| Name                | Type                                                   | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **datacenterId**    | **String**                                             | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                                |
| **serverId**        | **String**                                             | The unique ID of the server.                                                                                                                                                                                                                                                                                                                                                                                                             |                                |
| **key**             | **String**                                             | The label key                                                                                                                                                                                                                                                                                                                                                                                                                            |                                |
| **label**           | [**LabelResource**](/java-sdk/models/labelresource.md) | The modified label                                                                                                                                                                                                                                                                                                                                                                                                                       |                                |
| **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

[**LabelResource**](/java-sdk/models/labelresource.md)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the datacentersServersLabelsPutWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersServersLabelsPut 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.LabelsApi;

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");

    LabelsApi apiInstance = new LabelsApi(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 key = "key_example"; // String | The label key
    properties = new LabelResourceProperties(); // LabelResourceProperties | 
    label = new LabelResource(LabelResourceProperties); // LabelResource | The modified label
    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<LabelResource> result = apiInstance.datacentersServersLabelsPutWithHttpInfo(datacenterId, serverId, key, label, 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 LabelsApi#datacentersServersLabelsPut");
      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 {
        LabelResource result = apiInstance.datacentersServersLabelsPut(datacenterId, serverId, key, label)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling LabelsApi#datacentersServersLabelsPut");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersVolumesLabelsDelete**

> datacentersVolumesLabelsDelete(datacenterId, volumeId, key, pretty, depth, xContractNumber)

Delete volume labels

Delete the specified volume label.

#### Parameters

| Name                | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **datacenterId**    | **String**  | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                                |
| **volumeId**        | **String**  | The unique ID of the volume.                                                                                                                                                                                                                                                                                                                                                                                                             |                                |
| **key**             | **String**  | The label key                                                                                                                                                                                                                                                                                                                                                                                                                            |                                |
| **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 datacentersVolumesLabelsDeleteWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersVolumesLabelsDelete 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.LabelsApi;

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");

    LabelsApi apiInstance = new LabelsApi(defaultClient);
    String datacenterId = "datacenterId_example"; // String | The unique ID of the data center.
    String volumeId = "volumeId_example"; // String | The unique ID of the volume.
    String key = "key_example"; // String | The label key
    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.datacentersVolumesLabelsDeleteWithHttpInfo(datacenterId, volumeId, key, pretty, depth, xContractNumber);
    } catch (ApiException e) {
      System.err.println("Exception when calling LabelsApi#datacentersVolumesLabelsDelete");
      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.datacentersVolumesLabelsDelete(datacenterId, volumeId, key)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling LabelsApi#datacentersVolumesLabelsDelete");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersVolumesLabelsFindByKey**

> LabelResource datacentersVolumesLabelsFindByKey(datacenterId, volumeId, key, pretty, depth, xContractNumber)

Retrieve volume labels

Retrieve the properties of the specified volume label.

#### Parameters

| Name                | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **datacenterId**    | **String**  | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                                |
| **volumeId**        | **String**  | The unique ID of the volume.                                                                                                                                                                                                                                                                                                                                                                                                             |                                |
| **key**             | **String**  | The label key                                                                                                                                                                                                                                                                                                                                                                                                                            |                                |
| **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

[**LabelResource**](/java-sdk/models/labelresource.md)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the datacentersVolumesLabelsFindByKeyWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersVolumesLabelsFindByKey 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.LabelsApi;

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");

    LabelsApi apiInstance = new LabelsApi(defaultClient);
    String datacenterId = "datacenterId_example"; // String | The unique ID of the data center.
    String volumeId = "volumeId_example"; // String | The unique ID of the volume.
    String key = "key_example"; // String | The label key
    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<LabelResource> result = apiInstance.datacentersVolumesLabelsFindByKeyWithHttpInfo(datacenterId, volumeId, key, 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 LabelsApi#datacentersVolumesLabelsFindByKey");
      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 {
        LabelResource result = apiInstance.datacentersVolumesLabelsFindByKey(datacenterId, volumeId, key)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling LabelsApi#datacentersVolumesLabelsFindByKey");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersVolumesLabelsGet**

> LabelResources datacentersVolumesLabelsGet(datacenterId, volumeId, pretty, depth, xContractNumber)

List volume labels

List all the the labels for the specified volume.

#### Parameters

| Name                | Type                 | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **datacenterId**    | **String**           | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                                |
| **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]                    |
| 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

[**LabelResources**](/java-sdk/models/labelresources.md)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the datacentersVolumesLabelsGetWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersVolumesLabelsGet 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.LabelsApi;

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");

    LabelsApi apiInstance = new LabelsApi(defaultClient);
    String datacenterId = "datacenterId_example"; // String | The unique ID of the data center.
    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.
    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<LabelResources> result = apiInstance.datacentersVolumesLabelsGetWithHttpInfo(datacenterId, volumeId, 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 LabelsApi#datacentersVolumesLabelsGet");
      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 {
        LabelResources result = apiInstance.datacentersVolumesLabelsGet(datacenterId, volumeId)
                .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 LabelsApi#datacentersVolumesLabelsGet");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersVolumesLabelsPost**

> LabelResource datacentersVolumesLabelsPost(datacenterId, volumeId, label, pretty, depth, xContractNumber)

Create a Volume Label

Adds a new label to the specified volume.

#### Parameters

| Name                | Type                                                   | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **datacenterId**    | **String**                                             | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                                |
| **volumeId**        | **String**                                             | The unique ID of the volume.                                                                                                                                                                                                                                                                                                                                                                                                             |                                |
| **label**           | [**LabelResource**](/java-sdk/models/labelresource.md) | The label 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

[**LabelResource**](/java-sdk/models/labelresource.md)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the datacentersVolumesLabelsPostWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersVolumesLabelsPost 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.LabelsApi;

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");

    LabelsApi apiInstance = new LabelsApi(defaultClient);
    String datacenterId = "datacenterId_example"; // String | The unique ID of the data center.
    String volumeId = "volumeId_example"; // String | The unique ID of the volume.
    properties = new LabelResourceProperties(); // LabelResourceProperties | 
    label = new LabelResource(LabelResourceProperties); // LabelResource | The label 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<LabelResource> result = apiInstance.datacentersVolumesLabelsPostWithHttpInfo(datacenterId, volumeId, label, 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 LabelsApi#datacentersVolumesLabelsPost");
      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 {
        LabelResource result = apiInstance.datacentersVolumesLabelsPost(datacenterId, volumeId, label)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling LabelsApi#datacentersVolumesLabelsPost");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **datacentersVolumesLabelsPut**

> LabelResource datacentersVolumesLabelsPut(datacenterId, volumeId, key, label, pretty, depth, xContractNumber)

Modify a Volume Label

Modifies the specified volume label.

#### Parameters

| Name                | Type                                                   | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **datacenterId**    | **String**                                             | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                                |
| **volumeId**        | **String**                                             | The unique ID of the volume.                                                                                                                                                                                                                                                                                                                                                                                                             |                                |
| **key**             | **String**                                             | The label key                                                                                                                                                                                                                                                                                                                                                                                                                            |                                |
| **label**           | [**LabelResource**](/java-sdk/models/labelresource.md) | The modified label                                                                                                                                                                                                                                                                                                                                                                                                                       |                                |
| **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

[**LabelResource**](/java-sdk/models/labelresource.md)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the datacentersVolumesLabelsPutWithHttpInfo which also returns the status code and the headers, if you don't need them you may use datacentersVolumesLabelsPut 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.LabelsApi;

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");

    LabelsApi apiInstance = new LabelsApi(defaultClient);
    String datacenterId = "datacenterId_example"; // String | The unique ID of the data center.
    String volumeId = "volumeId_example"; // String | The unique ID of the volume.
    String key = "key_example"; // String | The label key
    properties = new LabelResourceProperties(); // LabelResourceProperties | 
    label = new LabelResource(LabelResourceProperties); // LabelResource | The modified label
    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<LabelResource> result = apiInstance.datacentersVolumesLabelsPutWithHttpInfo(datacenterId, volumeId, key, label, 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 LabelsApi#datacentersVolumesLabelsPut");
      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 {
        LabelResource result = apiInstance.datacentersVolumesLabelsPut(datacenterId, volumeId, key, label)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling LabelsApi#datacentersVolumesLabelsPut");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **ipblocksLabelsDelete**

> ipblocksLabelsDelete(ipblockId, key, pretty, depth, xContractNumber)

Delete IP block labels

Delete the specified IP block label.

#### Parameters

| Name                | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **ipblockId**       | **String**  | The unique ID of the IP block.                                                                                                                                                                                                                                                                                                                                                                                                           |                                |
| **key**             | **String**  | The label key                                                                                                                                                                                                                                                                                                                                                                                                                            |                                |
| **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 ipblocksLabelsDeleteWithHttpInfo which also returns the status code and the headers, if you don't need them you may use ipblocksLabelsDelete 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.LabelsApi;

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");

    LabelsApi apiInstance = new LabelsApi(defaultClient);
    String ipblockId = "ipblockId_example"; // String | The unique ID of the IP block.
    String key = "key_example"; // String | The label key
    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.ipblocksLabelsDeleteWithHttpInfo(ipblockId, key, pretty, depth, xContractNumber);
    } catch (ApiException e) {
      System.err.println("Exception when calling LabelsApi#ipblocksLabelsDelete");
      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.ipblocksLabelsDelete(ipblockId, key)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling LabelsApi#ipblocksLabelsDelete");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **ipblocksLabelsFindByKey**

> LabelResource ipblocksLabelsFindByKey(ipblockId, key, pretty, depth, xContractNumber)

Retrieve IP block labels

Retrieve the properties of the specified IP block label.

#### Parameters

| Name                | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **ipblockId**       | **String**  | The unique ID of the IP block.                                                                                                                                                                                                                                                                                                                                                                                                           |                                |
| **key**             | **String**  | The label key                                                                                                                                                                                                                                                                                                                                                                                                                            |                                |
| **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

[**LabelResource**](/java-sdk/models/labelresource.md)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the ipblocksLabelsFindByKeyWithHttpInfo which also returns the status code and the headers, if you don't need them you may use ipblocksLabelsFindByKey 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.LabelsApi;

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");

    LabelsApi apiInstance = new LabelsApi(defaultClient);
    String ipblockId = "ipblockId_example"; // String | The unique ID of the IP block.
    String key = "key_example"; // String | The label key
    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<LabelResource> result = apiInstance.ipblocksLabelsFindByKeyWithHttpInfo(ipblockId, key, 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 LabelsApi#ipblocksLabelsFindByKey");
      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 {
        LabelResource result = apiInstance.ipblocksLabelsFindByKey(ipblockId, key)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling LabelsApi#ipblocksLabelsFindByKey");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **ipblocksLabelsGet**

> LabelResources ipblocksLabelsGet(ipblockId, pretty, depth, xContractNumber)

List IP block labels

List all the the labels for the specified IP block.

#### Parameters

| Name                | Type                 | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **ipblockId**       | **String**           | The unique ID of the IP block.                                                                                                                                                                                                                                                                                                                                                                                                           |                                |
| **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

[**LabelResources**](/java-sdk/models/labelresources.md)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the ipblocksLabelsGetWithHttpInfo which also returns the status code and the headers, if you don't need them you may use ipblocksLabelsGet 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.LabelsApi;

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");

    LabelsApi apiInstance = new LabelsApi(defaultClient);
    String ipblockId = "ipblockId_example"; // String | The unique ID of the IP block.
    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<LabelResources> result = apiInstance.ipblocksLabelsGetWithHttpInfo(ipblockId, 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 LabelsApi#ipblocksLabelsGet");
      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 {
        LabelResources result = apiInstance.ipblocksLabelsGet(ipblockId)
                .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 LabelsApi#ipblocksLabelsGet");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **ipblocksLabelsPost**

> LabelResource ipblocksLabelsPost(ipblockId, label, pretty, depth, xContractNumber)

Create IP block labels

Add a new label to the specified IP block.

#### Parameters

| Name                | Type                                                   | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **ipblockId**       | **String**                                             | The unique ID of the IP block.                                                                                                                                                                                                                                                                                                                                                                                                           |                                |
| **label**           | [**LabelResource**](/java-sdk/models/labelresource.md) | The label 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

[**LabelResource**](/java-sdk/models/labelresource.md)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the ipblocksLabelsPostWithHttpInfo which also returns the status code and the headers, if you don't need them you may use ipblocksLabelsPost 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.LabelsApi;

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");

    LabelsApi apiInstance = new LabelsApi(defaultClient);
    String ipblockId = "ipblockId_example"; // String | The unique ID of the IP block.
    properties = new LabelResourceProperties(); // LabelResourceProperties | 
    label = new LabelResource(LabelResourceProperties); // LabelResource | The label 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<LabelResource> result = apiInstance.ipblocksLabelsPostWithHttpInfo(ipblockId, label, 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 LabelsApi#ipblocksLabelsPost");
      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 {
        LabelResource result = apiInstance.ipblocksLabelsPost(ipblockId, label)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling LabelsApi#ipblocksLabelsPost");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **ipblocksLabelsPut**

> LabelResource ipblocksLabelsPut(ipblockId, key, label, pretty, depth, xContractNumber)

Modify a IP Block Label by ID

Modifies the specified IP block label.

#### Parameters

| Name                | Type                                                   | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **ipblockId**       | **String**                                             | The unique ID of the IP block.                                                                                                                                                                                                                                                                                                                                                                                                           |                                |
| **key**             | **String**                                             | The label key                                                                                                                                                                                                                                                                                                                                                                                                                            |                                |
| **label**           | [**LabelResource**](/java-sdk/models/labelresource.md) | The modified label                                                                                                                                                                                                                                                                                                                                                                                                                       |                                |
| **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

[**LabelResource**](/java-sdk/models/labelresource.md)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the ipblocksLabelsPutWithHttpInfo which also returns the status code and the headers, if you don't need them you may use ipblocksLabelsPut 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.LabelsApi;

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");

    LabelsApi apiInstance = new LabelsApi(defaultClient);
    String ipblockId = "ipblockId_example"; // String | The unique ID of the IP block.
    String key = "key_example"; // String | The label key
    properties = new LabelResourceProperties(); // LabelResourceProperties | 
    label = new LabelResource(LabelResourceProperties); // LabelResource | The modified label
    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<LabelResource> result = apiInstance.ipblocksLabelsPutWithHttpInfo(ipblockId, key, label, 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 LabelsApi#ipblocksLabelsPut");
      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 {
        LabelResource result = apiInstance.ipblocksLabelsPut(ipblockId, key, label)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling LabelsApi#ipblocksLabelsPut");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **labelsFindByUrn**

> Label labelsFindByUrn(labelurn, pretty, depth, xContractNumber)

Retrieve labels by URN

Retrieve a label by label URN. The URN is unique for each label, and consists of: urn:label:\<resource\_type>:\<resource\_uuid>:\<key>

#### Parameters

| Name                | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **labelurn**        | **String**  | The label URN; URN is unique for each label, and consists of: urn:label:\<resource\_type>:\<resource\_uuid>:\<key>\<key>                                                                                                                                                                                                                                                                                                                 |                                |
| **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

[**Label**](/java-sdk/models/label.md)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the labelsFindByUrnWithHttpInfo which also returns the status code and the headers, if you don't need them you may use labelsFindByUrn 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.LabelsApi;

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");

    LabelsApi apiInstance = new LabelsApi(defaultClient);
    String labelurn = "labelurn_example"; // String | The label URN; URN is unique for each label, and consists of:  urn:label:<resource_type>:<resource_uuid>:<key><key>
    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<Label> result = apiInstance.labelsFindByUrnWithHttpInfo(labelurn, 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 LabelsApi#labelsFindByUrn");
      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 {
        Label result = apiInstance.labelsFindByUrn(labelurn)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling LabelsApi#labelsFindByUrn");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **labelsGet**

> Labels labelsGet(pretty, depth, xContractNumber)

List labels

List all available labels.

#### Parameters

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

[**Labels**](/java-sdk/models/labels.md)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the labelsGetWithHttpInfo which also returns the status code and the headers, if you don't need them you may use labelsGet 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.LabelsApi;

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");

    LabelsApi apiInstance = new LabelsApi(defaultClient);
    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<Labels> result = apiInstance.labelsGetWithHttpInfo(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 LabelsApi#labelsGet");
      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 {
        Labels result = apiInstance.labelsGet()
                .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 LabelsApi#labelsGet");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **snapshotsLabelsDelete**

> snapshotsLabelsDelete(snapshotId, key, pretty, depth, xContractNumber)

Delete snapshot labels

Delete the specified snapshot label.

#### Parameters

| Name                | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **snapshotId**      | **String**  | The unique ID of the snapshot.                                                                                                                                                                                                                                                                                                                                                                                                           |                                |
| **key**             | **String**  | The label key                                                                                                                                                                                                                                                                                                                                                                                                                            |                                |
| **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 snapshotsLabelsDeleteWithHttpInfo which also returns the status code and the headers, if you don't need them you may use snapshotsLabelsDelete 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.LabelsApi;

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");

    LabelsApi apiInstance = new LabelsApi(defaultClient);
    String snapshotId = "snapshotId_example"; // String | The unique ID of the snapshot.
    String key = "key_example"; // String | The label key
    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.snapshotsLabelsDeleteWithHttpInfo(snapshotId, key, pretty, depth, xContractNumber);
    } catch (ApiException e) {
      System.err.println("Exception when calling LabelsApi#snapshotsLabelsDelete");
      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.snapshotsLabelsDelete(snapshotId, key)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling LabelsApi#snapshotsLabelsDelete");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **snapshotsLabelsFindByKey**

> LabelResource snapshotsLabelsFindByKey(snapshotId, key, pretty, depth, xContractNumber)

Retrieve snapshot labels

Retrieve the properties of the specified snapshot label.

#### Parameters

| Name                | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **snapshotId**      | **String**  | The unique ID of the snapshot.                                                                                                                                                                                                                                                                                                                                                                                                           |                                |
| **key**             | **String**  | The label key                                                                                                                                                                                                                                                                                                                                                                                                                            |                                |
| **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

[**LabelResource**](/java-sdk/models/labelresource.md)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the snapshotsLabelsFindByKeyWithHttpInfo which also returns the status code and the headers, if you don't need them you may use snapshotsLabelsFindByKey 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.LabelsApi;

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");

    LabelsApi apiInstance = new LabelsApi(defaultClient);
    String snapshotId = "snapshotId_example"; // String | The unique ID of the snapshot.
    String key = "key_example"; // String | The label key
    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<LabelResource> result = apiInstance.snapshotsLabelsFindByKeyWithHttpInfo(snapshotId, key, 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 LabelsApi#snapshotsLabelsFindByKey");
      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 {
        LabelResource result = apiInstance.snapshotsLabelsFindByKey(snapshotId, key)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling LabelsApi#snapshotsLabelsFindByKey");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **snapshotsLabelsGet**

> LabelResources snapshotsLabelsGet(snapshotId, pretty, depth, xContractNumber)

List snapshot labels

List all the the labels for the specified snapshot.

#### Parameters

| Name                | Type                 | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **snapshotId**      | **String**           | The unique ID of the snapshot.                                                                                                                                                                                                                                                                                                                                                                                                           |                                |
| **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

[**LabelResources**](/java-sdk/models/labelresources.md)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the snapshotsLabelsGetWithHttpInfo which also returns the status code and the headers, if you don't need them you may use snapshotsLabelsGet 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.LabelsApi;

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");

    LabelsApi apiInstance = new LabelsApi(defaultClient);
    String snapshotId = "snapshotId_example"; // String | The unique ID of the snapshot.
    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<LabelResources> result = apiInstance.snapshotsLabelsGetWithHttpInfo(snapshotId, 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 LabelsApi#snapshotsLabelsGet");
      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 {
        LabelResources result = apiInstance.snapshotsLabelsGet(snapshotId)
                .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 LabelsApi#snapshotsLabelsGet");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **snapshotsLabelsPost**

> LabelResource snapshotsLabelsPost(snapshotId, label, pretty, depth, xContractNumber)

Create a Snapshot Label

Adds a new label to the specified snapshot.

#### Parameters

| Name                | Type                                                   | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **snapshotId**      | **String**                                             | The unique ID of the snapshot.                                                                                                                                                                                                                                                                                                                                                                                                           |                                |
| **label**           | [**LabelResource**](/java-sdk/models/labelresource.md) | The label 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

[**LabelResource**](/java-sdk/models/labelresource.md)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the snapshotsLabelsPostWithHttpInfo which also returns the status code and the headers, if you don't need them you may use snapshotsLabelsPost 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.LabelsApi;

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");

    LabelsApi apiInstance = new LabelsApi(defaultClient);
    String snapshotId = "snapshotId_example"; // String | The unique ID of the snapshot.
    properties = new LabelResourceProperties(); // LabelResourceProperties | 
    label = new LabelResource(LabelResourceProperties); // LabelResource | The label 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<LabelResource> result = apiInstance.snapshotsLabelsPostWithHttpInfo(snapshotId, label, 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 LabelsApi#snapshotsLabelsPost");
      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 {
        LabelResource result = apiInstance.snapshotsLabelsPost(snapshotId, label)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling LabelsApi#snapshotsLabelsPost");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```

## **snapshotsLabelsPut**

> LabelResource snapshotsLabelsPut(snapshotId, key, label, pretty, depth, xContractNumber)

Modify a Snapshot Label by ID

Modifies the specified snapshot label.

#### Parameters

| Name                | Type                                                   | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ------------------- | ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **snapshotId**      | **String**                                             | The unique ID of the snapshot.                                                                                                                                                                                                                                                                                                                                                                                                           |                                |
| **key**             | **String**                                             | The label key                                                                                                                                                                                                                                                                                                                                                                                                                            |                                |
| **label**           | [**LabelResource**](/java-sdk/models/labelresource.md) | The modified label                                                                                                                                                                                                                                                                                                                                                                                                                       |                                |
| **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

[**LabelResource**](/java-sdk/models/labelresource.md)

#### HTTP request headers

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

⚠️ **Note**: the example bellow uses the snapshotsLabelsPutWithHttpInfo which also returns the status code and the headers, if you don't need them you may use snapshotsLabelsPut 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.LabelsApi;

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");

    LabelsApi apiInstance = new LabelsApi(defaultClient);
    String snapshotId = "snapshotId_example"; // String | The unique ID of the snapshot.
    String key = "key_example"; // String | The label key
    properties = new LabelResourceProperties(); // LabelResourceProperties | 
    label = new LabelResource(LabelResourceProperties); // LabelResource | The modified label
    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<LabelResource> result = apiInstance.snapshotsLabelsPutWithHttpInfo(snapshotId, key, label, 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 LabelsApi#snapshotsLabelsPut");
      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 {
        LabelResource result = apiInstance.snapshotsLabelsPut(snapshotId, key, label)
                .pretty(true)
                .depth(0)
                .xContractNumber(56)
                .execute();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling LabelsApi#snapshotsLabelsPut");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ionos.com/java-sdk/api/labelsapi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

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