# BackupUnitsApi

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

| Method                                            | HTTP request                               | Description                     |
| ------------------------------------------------- | ------------------------------------------ | ------------------------------- |
| [**backupunitsDelete**](#backupunitsdelete)       | **DELETE** /backupunits/{backupunitId}     | Delete backup units             |
| [**backupunitsFindById**](#backupunitsfindbyid)   | **GET** /backupunits/{backupunitId}        | Retrieve backup units           |
| [**backupunitsGet**](#backupunitsget)             | **GET** /backupunits                       | List backup units               |
| [**backupunitsPatch**](#backupunitspatch)         | **PATCH** /backupunits/{backupunitId}      | Partially modify backup units   |
| [**backupunitsPost**](#backupunitspost)           | **POST** /backupunits                      | Create backup units             |
| [**backupunitsPut**](#backupunitsput)             | **PUT** /backupunits/{backupunitId}        | Modify backup units             |
| [**backupunitsSsourlGet**](#backupunitsssourlget) | **GET** /backupunits/{backupunitId}/ssourl | Retrieve BU single sign-on URLs |

## backupunitsDelete

> backupunitsDelete(backupunitId, opts)

Delete backup units

Remove the specified backup unit. This process will delete: 1) The backup plans inside the backup unit 2) All backups, associated with this backup unit 3) The backup user 4) The backup unit itself

### Examples

```javascript
const ionoscloud = require('@ionos-cloud/sdk-nodejs');
// setup authorization
const config = new ionoscloud.Configuration({
    username: 'YOUR_USERNAME',
    password: 'YOUR_PASSWORD',
    apiKey: 'YOUR_API_KEY'
});
const api_instance = new ionoscloud.BackupUnitsApi(config);
// Delete backup units
api_instance
  .backupunitsDelete({
    backupunitId: backupunitId_example,
    pretty: true,
    depth: 56,
    xContractNumber: 56, 
        options: {}
  })
  .then((response) => console.log(response.data))
  .catch((error) => console.log(error.response.data));
```

### Parameters

| Name                | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                                   | Notes                              |
| ------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- |
| **backupunitId**    | **string**  | The unique ID of the backup unit.                                                                                                                                                                                                                                                                                                                                                                                                             | \[default to undefined]            |
| **pretty**          | **boolean** | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                            | \[optional]\[default to true]      |
| **depth**           | **number**  | 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\&#39;s children are included. - depth=... and so on | \[optional]\[default to 0]         |
| **xContractNumber** | **number**  | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                                | \[optional]\[default to undefined] |

### Return type

nil (empty response body)

### Authorization

Basic Authentication, Token Authentication

### HTTP request headers

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

## backupunitsFindById

> backupunitsFindById(backupunitId, opts)

Retrieve backup units

Retrieve the properties of the specified backup unit.

### Examples

```javascript
const ionoscloud = require('@ionos-cloud/sdk-nodejs');
// setup authorization
const config = new ionoscloud.Configuration({
    username: 'YOUR_USERNAME',
    password: 'YOUR_PASSWORD',
    apiKey: 'YOUR_API_KEY'
});
const api_instance = new ionoscloud.BackupUnitsApi(config);
// Retrieve backup units
api_instance
  .backupunitsFindById({
    backupunitId: backupunitId_example,
    pretty: true,
    depth: 56,
    xContractNumber: 56, 
        options: {}
  })
  .then((response) => console.log(response.data))
  .catch((error) => console.log(error.response.data));
```

### Parameters

| Name                | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                                   | Notes                              |
| ------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- |
| **backupunitId**    | **string**  | The unique ID of the backup unit.                                                                                                                                                                                                                                                                                                                                                                                                             | \[default to undefined]            |
| **pretty**          | **boolean** | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                            | \[optional]\[default to true]      |
| **depth**           | **number**  | 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\&#39;s children are included. - depth=... and so on | \[optional]\[default to 0]         |
| **xContractNumber** | **number**  | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                                | \[optional]\[default to undefined] |

### Return type

[**BackupUnit**](/nodejs-sdk/models/backupunit.md)

### Authorization

Basic Authentication, Token Authentication

### HTTP request headers

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

## backupunitsGet

> backupunitsGet(opts)

List backup units

List all available backup units.

### Examples

```javascript
const ionoscloud = require('@ionos-cloud/sdk-nodejs');
// setup authorization
const config = new ionoscloud.Configuration({
    username: 'YOUR_USERNAME',
    password: 'YOUR_PASSWORD',
    apiKey: 'YOUR_API_KEY'
});
const api_instance = new ionoscloud.BackupUnitsApi(config);
var filterMap = new Map()
filterMap.set("<property_name>", "<property_value>")
// List backup units
api_instance
  .backupunitsGet({
    pretty: true,
    depth: 56,
    xContractNumber: 56
    orderBy: "<property_name>"
    maxResults: 2,
    filters: filterMap
    options: {}
  })
  .then((response) => console.log(response.data))
  .catch((error) => console.log(error.response.data));
```

### Parameters

| Name                | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                                   | Notes                              |
| ------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- |
| **pretty**          | **boolean** | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                            | \[optional]\[default to true]      |
| **depth**           | **number**  | 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\&#39;s children are included. - depth=... and so on | \[optional]\[default to 0]         |
| **xContractNumber** | **number**  | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                                | \[optional]\[default to undefined] |

### Return type

[**BackupUnits**](/nodejs-sdk/models/backupunits.md)

### Authorization

Basic Authentication, Token Authentication

### HTTP request headers

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

## backupunitsPatch

> backupunitsPatch(backupunitId, backupUnit, opts)

Partially modify backup units

Update the properties of the specified backup unit.

### Examples

```javascript
const ionoscloud = require('@ionos-cloud/sdk-nodejs');
// setup authorization
const config = new ionoscloud.Configuration({
    username: 'YOUR_USERNAME',
    password: 'YOUR_PASSWORD',
    apiKey: 'YOUR_API_KEY'
});
const api_instance = new ionoscloud.BackupUnitsApi(config);
// Partially modify backup units
api_instance
  .backupunitsPatch({
    backupunitId: backupunitId_example,
    backupUnit: backupUnit_example,
    pretty: true,
    depth: 56,
    xContractNumber: 56, 
        options: {}
  })
  .then((response) => console.log(response.data))
  .catch((error) => console.log(error.response.data));
```

### Parameters

| Name                | Type                                                                   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                   | Notes                              |
| ------------------- | ---------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- |
| **backupunitId**    | **string**                                                             | The unique ID of the backup unit.                                                                                                                                                                                                                                                                                                                                                                                                             | \[default to undefined]            |
| **backupUnit**      | [**BackupUnitProperties**](/nodejs-sdk/models/backupunitproperties.md) | The properties of the backup unit to be updated.                                                                                                                                                                                                                                                                                                                                                                                              |                                    |
| **pretty**          | **boolean**                                                            | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                            | \[optional]\[default to true]      |
| **depth**           | **number**                                                             | 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\&#39;s children are included. - depth=... and so on | \[optional]\[default to 0]         |
| **xContractNumber** | **number**                                                             | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                                | \[optional]\[default to undefined] |

### Return type

[**BackupUnit**](/nodejs-sdk/models/backupunit.md)

### Authorization

Basic Authentication, Token Authentication

### HTTP request headers

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

## backupunitsPost

> backupunitsPost(backupUnit, opts)

Create backup units

Create a backup unit. Backup units are resources, same as storage volumes or snapshots; they can be shared through groups in User management.

### Examples

```javascript
const ionoscloud = require('@ionos-cloud/sdk-nodejs');
// setup authorization
const config = new ionoscloud.Configuration({
    username: 'YOUR_USERNAME',
    password: 'YOUR_PASSWORD',
    apiKey: 'YOUR_API_KEY'
});
const api_instance = new ionoscloud.BackupUnitsApi(config);
// Create backup units
api_instance
  .backupunitsPost({
    backupUnit: backupUnit_example,
    pretty: true,
    depth: 56,
    xContractNumber: 56, 
        options: {}
  })
  .then((response) => console.log(response.data))
  .catch((error) => console.log(error.response.data));
```

### Parameters

| Name                | Type                                               | Description                                                                                                                                                                                                                                                                                                                                                                                                                                   | Notes                              |
| ------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- |
| **backupUnit**      | [**BackupUnit**](/nodejs-sdk/models/backupunit.md) | The backup unit to create.                                                                                                                                                                                                                                                                                                                                                                                                                    |                                    |
| **pretty**          | **boolean**                                        | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                            | \[optional]\[default to true]      |
| **depth**           | **number**                                         | 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\&#39;s children are included. - depth=... and so on | \[optional]\[default to 0]         |
| **xContractNumber** | **number**                                         | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                                | \[optional]\[default to undefined] |

### Return type

[**BackupUnit**](/nodejs-sdk/models/backupunit.md)

### Authorization

Basic Authentication, Token Authentication

### HTTP request headers

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

## backupunitsPut

> backupunitsPut(backupunitId, backupUnit, opts)

Modify backup units

Modify the properties of the specified backup unit.

### Examples

```javascript
const ionoscloud = require('@ionos-cloud/sdk-nodejs');
// setup authorization
const config = new ionoscloud.Configuration({
    username: 'YOUR_USERNAME',
    password: 'YOUR_PASSWORD',
    apiKey: 'YOUR_API_KEY'
});
const api_instance = new ionoscloud.BackupUnitsApi(config);
// Modify backup units
api_instance
  .backupunitsPut({
    backupunitId: backupunitId_example,
    backupUnit: backupUnit_example,
    pretty: true,
    depth: 56,
    xContractNumber: 56, 
        options: {}
  })
  .then((response) => console.log(response.data))
  .catch((error) => console.log(error.response.data));
```

### Parameters

| Name                | Type                                               | Description                                                                                                                                                                                                                                                                                                                                                                                                                                   | Notes                              |
| ------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- |
| **backupunitId**    | **string**                                         | The unique ID of the backup unit.                                                                                                                                                                                                                                                                                                                                                                                                             | \[default to undefined]            |
| **backupUnit**      | [**BackupUnit**](/nodejs-sdk/models/backupunit.md) | The modified backup unit.                                                                                                                                                                                                                                                                                                                                                                                                                     |                                    |
| **pretty**          | **boolean**                                        | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                            | \[optional]\[default to true]      |
| **depth**           | **number**                                         | 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\&#39;s children are included. - depth=... and so on | \[optional]\[default to 0]         |
| **xContractNumber** | **number**                                         | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                                | \[optional]\[default to undefined] |

### Return type

[**BackupUnit**](/nodejs-sdk/models/backupunit.md)

### Authorization

Basic Authentication, Token Authentication

### HTTP request headers

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

## backupunitsSsourlGet

> backupunitsSsourlGet(backupunitId, opts)

Retrieve BU single sign-on URLs

Retrieve a single sign-on URL for the specified backup unit.

### Examples

```javascript
const ionoscloud = require('@ionos-cloud/sdk-nodejs');
// setup authorization
const config = new ionoscloud.Configuration({
    username: 'YOUR_USERNAME',
    password: 'YOUR_PASSWORD',
    apiKey: 'YOUR_API_KEY'
});
const api_instance = new ionoscloud.BackupUnitsApi(config);
var filterMap = new Map()
filterMap.set("<property_name>", "<property_value>")
// Retrieve BU single sign-on URLs
api_instance
  .backupunitsSsourlGet({
    backupunitId: backupunitId_example,
    pretty: true,
    xContractNumber: 56, 
    orderBy: "<property_name>"
    maxResults: 2,
    filters: filterMap
    options: {}
  })
  .then((response) => console.log(response.data))
  .catch((error) => console.log(error.response.data));
```

### Parameters

| Name                | Type        | Description                                                                                                    | Notes                              |
| ------------------- | ----------- | -------------------------------------------------------------------------------------------------------------- | ---------------------------------- |
| **backupunitId**    | **string**  | The unique ID of the backup unit.                                                                              | \[default to undefined]            |
| **pretty**          | **boolean** | Controls whether the response is pretty-printed (with indentations and new lines).                             | \[optional]\[default to true]      |
| **xContractNumber** | **number**  | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. | \[optional]\[default to undefined] |

### Return type

[**BackupUnitSSO**](/nodejs-sdk/models/backupunitsso.md)

### Authorization

Basic Authentication, Token Authentication

### HTTP request headers

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


---

# 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/nodejs-sdk/api/backupunitsapi.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.
