# Backup Targets

***

## Backup Targets <a href="#backup-targets" id="backup-targets"></a>

### **Create Backup Target**

Creates the backup target

<mark style="color:green;">`POST`</mark> `https://<wlm_api_endpoint>/backup_targets`

#### Input Parameters:

Path:

<table><thead><tr><th width="219">Parameter Name</th><th>Description</th></tr></thead><tbody><tr><td>wlm_api_endpoint</td><td>The endpoint URL of the <code>Workloadmgr</code> service</td></tr></tbody></table>

Headers:

| Header Name       | Value/Description                            |
| ----------------- | -------------------------------------------- |
| X-Auth-Project-Id | Project ID to run the authentication against |
| X-Auth-Token      | Authentication token to use                  |
| Accept            | `application/json`                           |
| User-Agent        | `python-workloadmgrclient`                   |

Body Format:

```json
{
    "backup_target" :
    {
        "s3_endpoint_url": <s3 endpint url>,
        "s3_bucket": <s3 bucket name>,
        "filesystem_export": <filesystem export required for NFS type>,
        "type": <Backup Target type Eg. nfs, s3>,
        "is_default": <integer value 0|1 to specify if default or non-default>,
        "btt_name": <Backup Target Type name, using filesystem_export if not provided>,
        "immutable": <integer value 0|1 to specify if s3 Backup Target has object locked enabled>,
        "secret_ref": <Barbican secret URL holding the S3 access credentials, required for type=s3>,
        "nfs_mount_opts": <NFS mount options string, required for type=nfs>,
        "metadata": <dictionary of key-value pair denotes metadata of backup target>
    }
}
```

{% hint style="info" %}
**6.2 and later:** S3 credentials are not sent in the request body. Instead, store the access key, secret key, bucket, and endpoint in an OpenStack Barbican secret and pass the secret's URL as `secret_ref`. See [Backup Targets — admin guide](/openstack/admin-guide/backup-targets.md#id-6-2-configuring-an-s-3-backup-target) for the required Barbican payload shape and worked examples. The [Dynamic Mount Service (DMS)](/openstack/about-trilio-for-openstack/triliovault-for-openstack-architecture.md#dynamic-mount-service-dms) retrieves the credentials from Barbican at mount time.
{% endhint %}

{% hint style="info" %}
**Status field.** Starting in 6.2, mount state on a backup target is owned by the Dynamic Mount Service rather than by node-local startup logic. Treat the `status` field as read-only from the client side.
{% endhint %}

<details>

<summary>Deprecated (6.1) — Request body without <code>secret_ref</code></summary>

In Trilio for OpenStack 6.1 and earlier, S3 access credentials were submitted directly in the create-backup-target request body and the `secret_ref`/`nfs_mount_opts` fields did not exist. The 6.1 request body shape was:

```json
{
    "backup_target" :
    {
        "s3_endpoint_url": <s3 endpoint url>,
        "s3_bucket": <s3 bucket name>,
        "s3_access_key_id": <s3 access key id>,
        "s3_secret_access_key": <s3 secret access key>,
        "filesystem_export": <filesystem export required for NFS type>,
        "type": <Backup Target type Eg. nfs, s3>,
        "is_default": <integer value 0|1 to specify if default or non-default>,
        "btt_name": <Backup Target Type name, using filesystem_export if not provided>,
        "immutable": <integer value 0|1 to specify if s3 Backup Target has object locked enabled>,
        "metadata": <dictionary of key-value pair denotes metadata of backup target>
    }
}
```

This shape is **deprecated in 6.2**. New deployments must use `secret_ref` (S3) and `nfs_mount_opts` (NFS) as documented above. 6.1-shape requests are not accepted by 6.2 wlm-api.

</details>

<details>

<summary>Sample Response</summary>

```json5
HTTP/1.1 200 OK
'Server': 'nginx/1.20.1'
'Date': 'Wed, 13 Mar 2024 10:25:14 GMT'
'Content-Type': 'application/json'
'Content-Length': '430'
'Connection': 'keep-alive'
'X-Compute-Request-Id': 'req-5730cced-949b-4567-827e-8349a023e716'

{"backup_targets": {"id": "4720baae-5422-466d-a4b2-a4a2c94400f3", "type": "s3", "created_at": "2025-01-30T12:32:27.000000", "updated_at": "2025-01-30T12:32:27.000000", "version": "5.2.8.15", "filesystem_export": "cephs3.triliodata.demo/object-locked-cephs3-2", "filesystem_export_mount_path": "/var/trilio/triliovault-mounts/Y2VwaHMzLnRyaWxpb2RhdGEuZGVtby9vYmplY3QtbG9ja2VkLWNlcGhzMy0y", "is_default": false, "capacity": null, "used": null, "status": "offline", "backup_target_types": [{"created_at": "2025-01-30T12:32:27.000000", "updated_at": null, "version": "5.2.8.15", "user_id": "a62bf1546cdf4b02a3fc08b7aad79acb", "name": "cephs3.triliodata.demo/object-locked-cephs3-2", "description": null, "is_public": true, "is_default": false}], "backup_target_metadata": []}}
```

</details>

### **Update a Backup Target**

Updates an existing backup target. Only the credential / mount-option fields can be modified; type, endpoint, and bucket are immutable after create.

* For S3 targets, pass a new `secret_ref` to rotate the Barbican-stored credentials. The new `secret_ref` is normalized against the Barbican endpoint in the service catalog and validated before being stored.
* For NFS targets, pass `nfs_mount_opts` to change the mount options used at mount time.

<mark style="color:blue;">`PUT`</mark> `https://<wlm_api_endpoint>/backup_targets/<backup_target_id>`

#### Input Parameters:

Path:

<table><thead><tr><th width="219">Parameter Name</th><th>Description</th></tr></thead><tbody><tr><td>wlm_api_endpoint</td><td>The endpoint URL of the <code>Workloadmgr</code> service</td></tr><tr><td>backup_target_id</td><td>Id of the Backup Target to be modified</td></tr></tbody></table>

Headers:

| Header Name       | Value/Description                            |
| ----------------- | -------------------------------------------- |
| X-Auth-Project-Id | Project ID to run the authentication against |
| X-Auth-Token      | Authentication token to use                  |
| Accept            | `application/json`                           |
| User-Agent        | `python-workloadmgrclient`                   |

Body Format:

```json
{
    "backup_target" :
    {
        "secret_ref": <Barbican secret URL holding the S3 access credentials, applies to type=s3>,
        "nfs_mount_opts": <NFS mount options string, applies to type=nfs>
    }
}
```

{% hint style="info" %}
**6.2 and later:** Updating a backup target is the supported way to rotate S3 credentials — store the new access key, secret key, bucket, and endpoint in a fresh OpenStack Barbican secret and `PUT` its URL as `secret_ref`. The old Barbican secret is not touched by this call and should be deleted separately once no in-flight job references it. The next mount issued by the [Dynamic Mount Service (DMS)](/openstack/about-trilio-for-openstack/triliovault-for-openstack-architecture.md#dynamic-mount-service-dms) will pick up the new credentials.
{% endhint %}

<details>

<summary>Sample Response</summary>

```json5
HTTP/1.1 200 OK
'Server': 'nginx/1.20.1'
'Date': 'Wed, 13 Mar 2024 10:27:49 GMT'
'Content-Type': 'application/json'
'Content-Length': '432'
'Connection': 'keep-alive'
'X-Compute-Request-Id': 'req-14b39336-bc84-414a-a128-1d71e7dfb3cf'

{"backup_targets": {"id": "4720baae-5422-466d-a4b2-a4a2c94400f3", "type": "s3", "created_at": "2025-01-30T12:32:27.000000", "updated_at": "2025-01-30T12:35:02.000000", "version": "6.2.0", "filesystem_export": "cephs3.triliodata.demo/object-locked-cephs3-2", "filesystem_export_mount_path": "/var/trilio/triliovault-mounts/Y2VwaHMzLnRyaWxpb2RhdGEuZGVtby9vYmplY3QtbG9ja2VkLWNlcGhzMy0y", "is_default": false, "capacity": null, "used": null, "status": "available", "secret_ref": "https://barbican.example.com/v1/secrets/abcd1234-5678-90ab-cdef-1234567890ab", "backup_target_types": [{"created_at": "2025-01-30T12:32:27.000000", "updated_at": null, "version": "6.2.0", "user_id": "a62bf1546cdf4b02a3fc08b7aad79acb", "name": "cephs3.triliodata.demo/object-locked-cephs3-2", "description": null, "is_public": true, "is_default": false}], "backup_target_metadata": []}}
```

</details>

### **Delete a Backup Target**

Deleting an existing backup target

{% hint style="danger" %}
Removing Backup Target from an active Workload can lead to inconsistent behavior and potential backup operation failures.
{% endhint %}

<mark style="color:red;">`DELETE`</mark> `https://<wlm_api_endpoint>/backup_targets/<backup_target_id>`

#### Input Parameters:

Path:

<table><thead><tr><th width="219">Parameter Name</th><th>Description</th></tr></thead><tbody><tr><td>wlm_api_endpoint</td><td>The endpoint URL of the <code>Workloadmgr</code>service</td></tr><tr><td>backup_target_id</td><td>Id of the required Backup Target</td></tr></tbody></table>

Headers:

| Header Name       | Value/Description                            |
| ----------------- | -------------------------------------------- |
| X-Auth-Project-Id | Project ID to run the authentication against |
| X-Auth-Token      | Authentication token to use                  |
| Accept            | `application/json`                           |
| User-Agent        | `python-workloadmgrclient`                   |

<details>

<summary>Sample Response</summary>

```json5
HTTP/1.1 202 OK
'Server': 'nginx/1.20.1'
'Date': 'Thu, 30 Jan 2025 13:04:32 GMT'
'Content-Type': 'text/html; charset=UTF-8'
'Content-Length': '0'
'Connection': 'keep-alive'
```

</details>

### **List Backup Targets**

Provides the list of all backup targets

<mark style="color:green;">`GET`</mark> `https://<wlm_api_endpoint>/backup_targets`

#### Input Parameters:

Path:

<table><thead><tr><th width="219">Parameter Name</th><th>Description</th></tr></thead><tbody><tr><td>wlm_api_endpoint</td><td>The endpoint URL of the <code>Workloadmgr</code> service</td></tr></tbody></table>

Headers:

| Header Name       | Value/Description                            |
| ----------------- | -------------------------------------------- |
| X-Auth-Project-Id | Project ID to run the authentication against |
| X-Auth-Token      | Authentication token to use                  |
| Accept            | `application/json`                           |
| User-Agent        | `python-workloadmgrclient`                   |

<details>

<summary>Sample Response</summary>

```json5
HTTP/1.1 200 OK
'Server': 'nginx/1.20.1'
'Date': 'Wed, 13 Mar 2024 10:15:16 GMT',
'Content-Type': 'application/json',
'Content-Length': '1808',
'Connection': 'keep-alive',
'X-Compute-Request-Id': 'req-739464e0-3b84-4e94-866a-f34476915a38'
{
  "backup_targets": [
    {
      "id": "b39847c8-bf65-4cec-9af6-dd65303ca485",
      "type": "nfs",
      "created_at": "2024-03-04T10:59:51.000000",
      "updated_at": "2024-03-04T10:59:51.000000",
      "version": "5.0.204",
      "nfs_export": "192.168.1.34:/mnt/tvault/162",
      "nfs_export_mount_path": "/var/triliovault-mounts/L21udC90dmF1bHQvMTYy",
      "is_default": true,
      "capacity": "2.4 TB",
      "used": "1.2 TB",
      "status": "available",
      "backup_target_types": [
        {
          "created_at": "2024-03-04T10:59:51.000000",
          "updated_at": null,
          "version": "5.0.204",
          "user_id": null,
          "name": "nfs_1",
          "description": null,
          "is_public": true,
          "is_default": true
        }
      ]
    },
    {
      "id": "2af5f2db-3267-453f-bc57-19884837e274",
      "type": "s3",
      "created_at": "2024-03-04T10:59:51.000000",
      "updated_at": "2024-03-04T10:59:51.000000",
      "version": "5.0.204",
      "nfs_export": "https://cephs3.triliodata.demo/trilio-qamanual",
      "nfs_export_mount_path": "/var/triliovault-mounts/Y2VwaHMzLnRyaWxpb2RhdGEuZGVtby90cmlsaW8tcWFtYW51YWw=",
      "is_default": false,
      "capacity": null,
      "used": null,
      "status": "offline",
      "backup_target_types": [
        {
          "created_at": "2024-03-04T10:59:51.000000",
          "updated_at": null,
          "version": "5.0.204",
          "user_id": null,
          "name": "s3_2",
          "description": null,
          "is_public": true,
          "is_default": false
        }
      ]
    },
    {
      "id": "1fd7af34-d723-428d-90f5-35d31bf24884",
      "type": "nfs",
      "created_at": "2024-03-04T10:59:51.000000",
      "updated_at": "2024-03-04T10:59:51.000000",
      "version": "5.0.204",
      "nfs_export": "192.168.1.34:/mnt/tvault/tvm",
      "nfs_export_mount_path": "/var/triliovault-mounts/L21udC90dmF1bHQvdHZt",
      "is_default": false,
      "capacity": "2.4 TB",
      "used": "1.2 TB",
      "status": "available",
      "backup_target_types": [
        {
          "created_at": "2024-03-04T10:59:51.000000",
          "updated_at": null,
          "version": "5.0.204",
          "user_id": null,
          "name": "nfs_2",
          "description": null,
          "is_public": true,
          "is_default": false
        }
      ]
    }
  ]
}
```

</details>

### **Detailed List of all Backup Targets**

Provides a detailed list of all backup targets

<mark style="color:green;">`GET`</mark> `https://<wlm_api_endpoint>/backup_targets/detail`

#### Parameters:

Path:

<table><thead><tr><th width="219">Parameter Name</th><th>Description</th></tr></thead><tbody><tr><td>wlm_api_endpoint</td><td>The endpoint URL of the <code>Workloadmgr</code> service</td></tr></tbody></table>

Headers:

| Header Name       | Value/Description                            |
| ----------------- | -------------------------------------------- |
| X-Auth-Project-Id | Project ID to run the authentication against |
| X-Auth-Token      | Authentication token to use                  |
| Accept            | `application/json`                           |
| User-Agent        | `python-workloadmgrclient`                   |

<details>

<summary>Sample Response</summary>

```json5
HTTP/1.1 200 OK
'Server': 'nginx/1.20.1'
'Date': 'Wed, 13 Mar 2024 10:15:16 GMT',
'Content-Type': 'application/json',
'Content-Length': '1808',
'Connection': 'keep-alive',
'X-Compute-Request-Id': 'req-739464e0-3b84-4e94-866a-f34476915a38'
{
  "backup_targets": [
    {
      "id": "b39847c8-bf65-4cec-9af6-dd65303ca485",
      "type": "nfs",
      "created_at": "2024-03-04T10:59:51.000000",
      "updated_at": "2024-03-04T10:59:51.000000",
      "version": "5.0.204",
      "nfs_export": "192.168.1.34:/mnt/tvault/162",
      "nfs_export_mount_path": "/var/triliovault-mounts/L21udC90dmF1bHQvMTYy",
      "is_default": true,
      "capacity": "2.4 TB",
      "used": "1.2 TB",
      "status": "available",
      "backup_target_types": [
        {
          "created_at": "2024-03-04T10:59:51.000000",
          "updated_at": null,
          "version": "5.0.204",
          "user_id": null,
          "name": "nfs_1",
          "description": null,
          "is_public": true,
          "is_default": true
        }
      ]
    },
    {
      "id": "2af5f2db-3267-453f-bc57-19884837e274",
      "type": "s3",
      "created_at": "2024-03-04T10:59:51.000000",
      "updated_at": "2024-03-04T10:59:51.000000",
      "version": "5.0.204",
      "nfs_export": "https://cephs3.triliodata.demo/trilio-qamanual",
      "nfs_export_mount_path": "/var/triliovault-mounts/Y2VwaHMzLnRyaWxpb2RhdGEuZGVtby90cmlsaW8tcWFtYW51YWw=",
      "is_default": false,
      "capacity": null,
      "used": null,
      "status": "offline",
      "backup_target_types": [
        {
          "created_at": "2024-03-04T10:59:51.000000",
          "updated_at": null,
          "version": "5.0.204",
          "user_id": null,
          "name": "s3_2",
          "description": null,
          "is_public": true,
          "is_default": false
        }
      ]
    },
    {
      "id": "1fd7af34-d723-428d-90f5-35d31bf24884",
      "type": "nfs",
      "created_at": "2024-03-04T10:59:51.000000",
      "updated_at": "2024-03-04T10:59:51.000000",
      "version": "5.0.204",
      "nfs_export": "192.168.1.34:/mnt/tvault/tvm",
      "nfs_export_mount_path": "/var/triliovault-mounts/L21udC90dmF1bHQvdHZt",
      "is_default": false,
      "capacity": "2.4 TB",
      "used": "1.2 TB",
      "status": "available",
      "backup_target_types": [
        {
          "created_at": "2024-03-04T10:59:51.000000",
          "updated_at": null,
          "version": "5.0.204",
          "user_id": null,
          "name": "nfs_2",
          "description": null,
          "is_public": true,
          "is_default": false
        }
      ]
    }
  ]
}
```

</details>

**Show Details of a Backup Target**

Provides all details of a specific backup target

<mark style="color:green;">`GET`</mark> `https://<wlm_api_endpoint>/backup_targets/<backup_target_id>`

#### Parameters:

Path:

<table><thead><tr><th width="219">Parameter Name</th><th>Description</th></tr></thead><tbody><tr><td>wlm_api_endpoint</td><td>The endpoint URL of the <code>Workloadmgr</code> service</td></tr><tr><td>backup_target_id</td><td>ID of the Backup Target to be fetched</td></tr></tbody></table>

Headers:

| Header Name       | Value/Description                            |
| ----------------- | -------------------------------------------- |
| X-Auth-Project-Id | Project ID to run the authentication against |
| X-Auth-Token      | Authentication token to use                  |
| Accept            | `application/json`                           |
| User-Agent        | `python-workloadmgrclient`                   |

<details>

<summary>Sample Response</summary>

```json5
HTTP/1.1 200 OK
'Server': 'nginx/1.20.1'
'Date': 'Wed, 13 Mar 2024 10:21:14 GMT'
'Content-Type': 'application/json'
'Content-Length': '600'
'Connection': 'keep-alive'
'X-Compute-Request-Id': 'req-0b298919-f2e8-4c50-aa55-ce88b4569f2a'
{
  "backup_targets": {
    "id": "b39847c8-bf65-4cec-9af6-dd65303ca485",
    "type": "nfs",
    "created_at": "2024-03-04T10:59:51.000000",
    "updated_at": "2024-03-04T10:59:51.000000",
    "version": "5.0.204",
    "nfs_export": "192.168.1.34:/mnt/tvault/162",
    "nfs_export_mount_path": "/var/triliovault-mounts/L21udC90dmF1bHQvMTYy",
    "is_default": true,
    "capacity": "2.4 TB",
    "used": "1.2 TB",
    "status": "available",
    "backup_target_types": [
      {
        "created_at": "2024-03-04T10:59:51.000000",
        "updated_at": null,
        "version": "5.0.204",
        "user_id": null,
        "name": "nfs_1",
        "description": null,
        "is_public": true,
        "is_default": true
      }
    ]
  }
}
```

</details>

### **Backup Target Set Default**

Sets the given Backup target as default

<mark style="color:green;">`GET`</mark> `https://<wlm_api_endpoint>/backup_targets/<backup_target_id>/set_default`

#### Input Parameters:

Path:

<table><thead><tr><th width="219">Parameter Name</th><th>Description</th></tr></thead><tbody><tr><td>wlm_api_endpoint</td><td>The endpoint URL of the <code>Workloadmgr</code>service</td></tr><tr><td>backup_target_id</td><td>Id of the required Backup Target</td></tr></tbody></table>

Headers:

| Header Name       | Value/Description                            |
| ----------------- | -------------------------------------------- |
| X-Auth-Project-Id | Project ID to run the authentication against |
| X-Auth-Token      | Authentication token to use                  |
| Accept            | `application/json`                           |
| User-Agent        | `python-workloadmgrclient`                   |

<details>

<summary>Sample Response</summary>

````json5
'x-compute-request-id': 'req-295c03f7-8dfb-4b72-a654-9f06a51d9b0c'
'content-type': 'application/json'
'content-length': '911'
'date': 'Tue, 04 Feb 2025 14:19:05 GMT'

{"backup_targets": {"id": "0dcc632a-aed7-45ab-a40e-7cc2deae3994", "type": "s3", "created_at": "2025-02-04T10:43:37.000000", "updated_at": "2025-02-04T10:43:37.000000", "version": "5.2.8.15", "filesystem_export": "cephs3.triliodata.demo/object-locked-cephs3-2", "filesystem_export_mount_path": "/var/trilio/triliovault-mounts/Y2VwaHMzLnRyaWxpb2RhdGEuZGVtby9vYmplY3QtbG9ja2VkLWNlcGhzMy0y", "is_default": true, "capacity": null, "used": null, "status": "offline", "backup_target_types": [{"created_at": "2025-02-04T10:43:37.000000", "updated_at": "2025-02-04T14:19:05.000000", "version": "5.2.8.15", "user_id": "a62bf1546cdf4b02a3fc08b7aad79acb", "name": "cephs3.triliodata.demo/object-locked-cephs3-2", "description": null, "is_public": true, "is_default": true}], "backup_target_metadata": [{"key": "bucket", "value": "s3-object-lock"}, {"key": "immutable", "value": "1"}, {"key": "object_lock", "value": "1"}]}}```

</details>

***

## Backup Target Types: <a href="#backup-target-types" id="backup-target-types"></a>

### **List Backup Target Types**&#x20;

Provides the list of all backup target types

&#x20;<mark style="color:green;">`GET`</mark> `https://<wlm_api_endpoint>/backup_target_types`&#x20;

#### Input Parameters:

Path:

<table><thead><tr><th width="219">Parameter Name</th><th>Description</th></tr></thead><tbody><tr><td>wlm_api_endpoint</td><td>The endpoint URL of the <code>Workloadmgr</code> service</td></tr></tbody></table>

Headers:

| Header Name       | Value/Description                             |
| ----------------- | --------------------------------------------- |
| X-Auth-Project-Id |  Project ID to run the authentication against |
| X-Auth-Token      | Authentication token to use                   |
| Accept            | `application/json`                            |
| User-Agent        | `python-workloadmgrclient`                    |

<details>

<summary>Sample Response</summary>

```json5
HTTP/1.1 200 OK
'Server': 'nginx/1.20.1'
'Date': 'Wed, 13 Mar 2024 10:29:09 GMT'
'Content-Type': 'application/json'
'Content-Length': '1628'
'Connection': 'keep-alive'
'X-Compute-Request-Id': 'req-dd23df0a-37a6-4769-882a-40e67431d997'
{
  "backup_target_types": [
    {
      "id": "13dd2bf2-12c5-4eb8-98a3-0f1dd9f8579f",
      "backup_targets_id": "b39847c8-bf65-4cec-9af6-dd65303ca485",
      "created_at": "2024-03-04T10:59:51.000000",
      "updated_at": "2024-03-04T10:59:51.000000",
      "version": "5.0.204",
      "user_id": null,
      "name": "nfs_1",
      "is_default": true,
      "description": null,
      "is_public": true,
      "backup_target_type_projects": [],
      "backup_target_type_metadata": []
    },
    {
      "id": "51f11fc5-854b-4cb7-9b64-0a0ace33b0d5",
      "backup_targets_id": "1fd7af34-d723-428d-90f5-35d31bf24884",
      "created_at": "2024-03-04T10:59:51.000000",
      "updated_at": "2024-03-04T10:59:51.000000",
      "version": "5.0.204",
      "user_id": null,
      "name": "nfs_2",
      "is_default": false,
      "description": null,
      "is_public": true,
      "backup_target_type_projects": [],
      "backup_target_type_metadata": []
    },
    {
      "id": "c65625c1-50bf-4ab7-aa26-f625001e60f1",
      "backup_targets_id": "2af5f2db-3267-453f-bc57-19884837e274",
      "created_at": "2024-03-04T10:59:51.000000",
      "updated_at": "2024-03-04T10:59:51.000000",
      "version": "5.0.204",
      "user_id": null,
      "name": "s3_2",
      "is_default": false,
      "description": null,
      "is_public": true,
      "backup_target_type_projects": [],
      "backup_target_type_metadata": []
    },
    {
      "id": "fdae1b10-9852-4c68-8879-64ead0aed31b",
      "backup_targets_id": "b39847c8-bf65-4cec-9af6-dd65303ca485",
      "created_at": "2024-03-13T10:25:14.000000",
      "updated_at": "2024-03-13T10:25:14.000000",
      "version": "5.0.204",
      "user_id": "2b1189be3add4806bcb7e0c259b03597",
      "name": "BTT-name",
      "is_default": false,
      "description": null,
      "is_public": true,
      "backup_target_type_projects": [],
      "backup_target_type_metadata": [
        {
          "key": "nfs",
          "value": "secondary"
        }
      ]
    }
  ]
}
````

</details>

### **Detailed List of all Backup Target Types**

Provides a detailed list of all backup target types

<mark style="color:green;">`GET`</mark> `https://<wlm_api_endpoint>/backup_target_types/detail`

#### Parameters:

Path:

<table><thead><tr><th width="219">Parameter Name</th><th>Description</th></tr></thead><tbody><tr><td>wlm_api_endpoint</td><td>The endpoint URL of the <code>Workloadmgr</code> service</td></tr></tbody></table>

Headers:

| Header Name       | Value/Description                            |
| ----------------- | -------------------------------------------- |
| X-Auth-Project-Id | Project ID to run the authentication against |
| X-Auth-Token      | Authentication token to use                  |
| Accept            | `application/json`                           |
| User-Agent        | `python-workloadmgrclient`                   |

<details>

<summary>Sample Response</summary>

```json5
HTTP/1.1 200 OK
'Server': 'nginx/1.20.1'
'Date': 'Wed, 13 Mar 2024 10:29:09 GMT'
'Content-Type': 'application/json'
'Content-Length': '1628'
'Connection': 'keep-alive'
'X-Compute-Request-Id': 'req-dd23df0a-37a6-4769-882a-40e67431d997'
{
  "backup_target_types": [
    {
      "id": "13dd2bf2-12c5-4eb8-98a3-0f1dd9f8579f",
      "backup_targets_id": "b39847c8-bf65-4cec-9af6-dd65303ca485",
      "created_at": "2024-03-04T10:59:51.000000",
      "updated_at": "2024-03-04T10:59:51.000000",
      "version": "5.0.204",
      "user_id": null,
      "name": "nfs_1",
      "is_default": true,
      "description": null,
      "is_public": true,
      "backup_target_type_projects": [],
      "backup_target_type_metadata": []
    },
    {
      "id": "51f11fc5-854b-4cb7-9b64-0a0ace33b0d5",
      "backup_targets_id": "1fd7af34-d723-428d-90f5-35d31bf24884",
      "created_at": "2024-03-04T10:59:51.000000",
      "updated_at": "2024-03-04T10:59:51.000000",
      "version": "5.0.204",
      "user_id": null,
      "name": "nfs_2",
      "is_default": false,
      "description": null,
      "is_public": true,
      "backup_target_type_projects": [],
      "backup_target_type_metadata": []
    },
    {
      "id": "c65625c1-50bf-4ab7-aa26-f625001e60f1",
      "backup_targets_id": "2af5f2db-3267-453f-bc57-19884837e274",
      "created_at": "2024-03-04T10:59:51.000000",
      "updated_at": "2024-03-04T10:59:51.000000",
      "version": "5.0.204",
      "user_id": null,
      "name": "s3_2",
      "is_default": false,
      "description": null,
      "is_public": true,
      "backup_target_type_projects": [],
      "backup_target_type_metadata": []
    },
    {
      "id": "fdae1b10-9852-4c68-8879-64ead0aed31b",
      "backup_targets_id": "b39847c8-bf65-4cec-9af6-dd65303ca485",
      "created_at": "2024-03-13T10:25:14.000000",
      "updated_at": "2024-03-13T10:25:14.000000",
      "version": "5.0.204",
      "user_id": "2b1189be3add4806bcb7e0c259b03597",
      "name": "BTT-name",
      "is_default": false,
      "description": null,
      "is_public": true,
      "backup_target_type_projects": [],
      "backup_target_type_metadata": [
        {
          "key": "nfs",
          "value": "secondary"
        }
      ]
    }
  ]
}
```

</details>

### **Show Details of a Backup Target Type**

Provides all details of a specific backup target type

<mark style="color:green;">`GET`</mark> `https://<wlm_api_endpoint>/backup_target_types/<backup_target_type_id>`

#### Parameters:

Path:

<table><thead><tr><th width="219">Parameter Name</th><th>Description</th></tr></thead><tbody><tr><td>wlm_api_endpoint</td><td>The endpoint URL of the <code>Workloadmgr</code> service</td></tr><tr><td>backup_target_type_id</td><td>ID of the Backup Target Type to be fetched</td></tr></tbody></table>

Headers:

| Header Name       | Value/Description                            |
| ----------------- | -------------------------------------------- |
| X-Auth-Project-Id | Project ID to run the authentication against |
| X-Auth-Token      | Authentication token to use                  |
| Accept            | `application/json`                           |
| User-Agent        | `python-workloadmgrclient`                   |

<details>

<summary>Sample Response</summary>

```json5
HTTP/1.1 200 OK
'Server': 'nginx/1.20.1'
'Date': 'Wed, 13 Mar 2024 10:30:31 GMT'
'Content-Type': 'application/json'
'Content-Length': '406'
'Connection': 'keep-alive'
'X-Compute-Request-Id': 'req-f20d2e28-a083-47fe-8eda-a702ac484865'
{
  "backup_target_types": {
    "id": "13dd2bf2-12c5-4eb8-98a3-0f1dd9f8579f",
    "backup_targets_id": "b39847c8-bf65-4cec-9af6-dd65303ca485",
    "created_at": "2024-03-04T10:59:51.000000",
    "updated_at": "2024-03-04T10:59:51.000000",
    "version": "5.0.204",
    "user_id": null,
    "name": "nfs_1",
    "is_default": true,
    "description": null,
    "is_public": true,
    "backup_target_type_projects": [],
    "backup_target_type_metadata": []
  }
}
```

</details>

### **Create a Backup Target Type**

Creates the backup target type

<mark style="color:orange;">`POST`</mark> `https://<wlm_api_endpoint>/backup_target_types`

#### Input Parameters:

Path:

<table><thead><tr><th width="219">Parameter Name</th><th>Description</th></tr></thead><tbody><tr><td>wlm_api_endpoint</td><td>The endpoint URL of the <code>Workloadmgr</code> service</td></tr></tbody></table>

Headers:

| Header Name       | Value/Description                            |
| ----------------- | -------------------------------------------- |
| X-Auth-Project-Id | Project ID to run the authentication against |
| X-Auth-Token      | Authentication token to use                  |
| Accept            | `application/json`                           |
| User-Agent        | `python-workloadmgrclient`                   |

Body Format:

```json
{
    "backup_target_type" :
    {
        "name": <name of the backup target type>,
        "description": <description of backup target type>,
        "backup_targets_id": <ID of the backup target>,
        "is_default": <integer value 0|1 to specify if default or non-default>,
        "is_public": <integer value 0|1 to specify if public or non-public>,
        "project_list": [
            <list of project IDs on which backup target type will be assigned>
        ],
        "metadata": [
            <list of dictionaries of key-value pair >
            {
                "key":<meta-key>,
                "value":<meta-value>
            },
        ]
    }
}
```

<details>

<summary>Sample Response</summary>

```json5
HTTP/1.1 200 OK
'Server': 'nginx/1.20.1'
'Date': 'Wed, 13 Mar 2024 10:25:14 GMT'
'Content-Type': 'application/json'
'Content-Length': '430'
'Connection': 'keep-alive'
'X-Compute-Request-Id': 'req-5730cced-949b-4567-827e-8349a023e716'
{
  "backup_target_types": {
    "id": "fdae1b10-9852-4c68-8879-64ead0aed31b",
    "backup_targets_id": "b39847c8-bf65-4cec-9af6-dd65303ca485",
    "created_at": "2024-03-13T10:25:14.000000",
    "version": "5.0.204",
    "user_id": "2b1189be3add4806bcb7e0c259b03597",
    "name": "BTT-name",
    "is_default": false,
    "description": null,
    "is_public": true,
    "backup_target_type_projects": [],
    "backup_target_type_metadata": [
      {
        "key": "nfs",
        "value": "primary"
      }
    ]
  }
}
```

</details>

### Update the backup target type

Update an existing backup target type

<mark style="color:blue;">`PUT`</mark> `https://<wlm_api_endpoint>/backup_target_types/<backup_target_type_id>`

#### Input Parameters:

Path:

<table><thead><tr><th width="219">Parameter Name</th><th>Description</th></tr></thead><tbody><tr><td>wlm_api_endpoint</td><td>The endpoint URL of the <code>Workloadmgr</code> service</td></tr><tr><td>backup_target_type_id</td><td>Id of the Backup Target Type to be modified</td></tr></tbody></table>

Headers:

| Header Name       | Value/Description                            |
| ----------------- | -------------------------------------------- |
| X-Auth-Project-Id | Project ID to run the authentication against |
| X-Auth-Token      | Authentication token to use                  |
| Accept            | `application/json`                           |
| User-Agent        | `python-workloadmgrclient`                   |

Body Format:

```json
{
    "backup_target_type" :
    {
        "name": <name of the backup target type>,
        "description": <description of backup target type>,
        "is_default": <integer value 0|1 to specify if default or non-default>,
        "is_public": <integer value 0|1 to specify if public or non-public>,
        "project_list": [
            <list of project IDs on which backup target type will be assigned>
        ],
        "purge_projects": True <if All the assigned projects need to be purged>,
        "metadata": [
            <list of dictionaries of key-value pair >
            {
                "key":<meta-key>,
                "value":<meta-value>
            },
        ],
        "purge_metadata": True <if All the metadata needs to be purged>
    }
}
```

<details>

<summary>Sample Response</summary>

```json5
HTTP/1.1 200 OK
'Server': 'nginx/1.20.1'
'Date': 'Wed, 13 Mar 2024 10:27:49 GMT'
'Content-Type': 'application/json'
'Content-Length': '432'
'Connection': 'keep-alive'
'X-Compute-Request-Id': 'req-14b39336-bc84-414a-a128-1d71e7dfb3cf'
{
  "backup_target_types": {
    "id": "fdae1b10-9852-4c68-8879-64ead0aed31b",
    "backup_targets_id": "b39847c8-bf65-4cec-9af6-dd65303ca485",
    "created_at": "2024-03-13T10:25:14.000000",
    "version": "5.0.204",
    "user_id": "2b1189be3add4806bcb7e0c259b03597",
    "name": "BTT-name",
    "is_default": false,
    "description": null,
    "is_public": true,
    "backup_target_type_projects": [],
    "backup_target_type_metadata": [
      {
        "key": "nfs",
        "value": "secondary"
      }
    ]
  }
}
```

</details>

### **Assign Projects to a Backup Target Type**

Add projects to an existing backup target type

<mark style="color:orange;">`POST`</mark> `https://<wlm_api_endpoint>/backup_target_types/<backup_target_type_id>/add_projects`

#### Input Parameters:

Path:

<table><thead><tr><th width="219">Parameter Name</th><th>Description</th></tr></thead><tbody><tr><td>wlm_api_endpoint</td><td>The endpoint URL of the <code>Workloadmgr</code>service</td></tr><tr><td>backup_target_type_id</td><td>Id of the required Backup Target Type</td></tr></tbody></table>

Headers:

| Header Name       | Value/Description                            |
| ----------------- | -------------------------------------------- |
| X-Auth-Project-Id | Project ID to run the authentication against |
| X-Auth-Token      | Authentication token to use                  |
| Accept            | `application/json`                           |
| User-Agent        | `python-workloadmgrclient`                   |

Body Format:

```json
{
    "backup_target_type" :
    {
        "backup_target_type_id": <ID of the backup target type>,
        "project_list": [
            <list of project IDs on which backup target type will be assigned>
            ]
        }
}
```

<details>

<summary>Sample Response</summary>

```json5
HTTP/1.1 200 OK
'Server': 'nginx/1.20.1'
'Date': 'Wed, 13 Mar 2024 10:40:05 GMT'
'Content-Type': 'application/json'
'Content-Length': '921'
'Connection': 'keep-alive'
'X-Compute-Request-Id': 'req-3dd1a577-ef35-4997-83bc-b2e50afaea73'
{
  "backup_target_types": {
    "id": "c65625c1-50bf-4ab7-aa26-f625001e60f1",
    "backup_targets_id": "2af5f2db-3267-453f-bc57-19884837e274",
    "created_at": "2024-03-04T10:59:51.000000",
    "version": "5.0.204",
    "user_id": "2b1189be3add4806bcb7e0c259b03597",
    "name": "s3_2",
    "is_default": false,
    "description": null,
    "is_public": false,
    "backup_target_type_projects": [
      {
        "created_at": "2024-03-13T10:39:14.000000",
        "updated_at": null,
        "version": "5.0.204",
        "id": "5a14a688-e16f-45f9-91c2-6906fb200825",
        "backup_target_types_id": "c65625c1-50bf-4ab7-aa26-f625001e60f1",
        "project_id": "fc439373e340459fb28202b2412e26c0"
      },
      {
        "created_at": "2024-03-13T10:40:05.000000",
        "updated_at": null,
        "version": "5.0.204",
        "id": "c0fe123e-e566-465a-acf2-56e2b27ae9b2",
        "backup_target_types_id": "c65625c1-50bf-4ab7-aa26-f625001e60f1",
        "project_id": "0920f871077c4c079057ce940d8105a8"
      }
    ],
    "backup_target_type_metadata": [
      {
        "key": "dg1",
        "value": "dg2"
      }
    ]
  }
}
```

</details>

### **Remove Assigned Projects from a Backup Target Type**

Add projects to an existing backup target type

<mark style="color:blue;">`PUT`</mark> `https://<wlm_api_endpoint>/backup_target_types/<backup_target_type_id>/remove_projects`

#### Input Parameters:

Path:

<table><thead><tr><th width="219">Parameter Name</th><th>Description</th></tr></thead><tbody><tr><td>wlm_api_endpoint</td><td>The endpoint URL of the <code>Workloadmgr</code>service</td></tr><tr><td>backup_target_type_id</td><td>Id of the required Backup Target Type</td></tr></tbody></table>

Headers:

| Header Name       | Value/Description                            |
| ----------------- | -------------------------------------------- |
| X-Auth-Project-Id | Project ID to run the authentication against |
| X-Auth-Token      | Authentication token to use                  |
| Accept            | `application/json`                           |
| User-Agent        | `python-workloadmgrclient`                   |

Body Format:

```json
{
    "backup_target_type" :
    {
        "backup_target_type_id": <ID of the backup target type>,
        "project_list": [
            <list of assigned project IDs that needs to be unassigned>
            ]
        }
}
```

<details>

<summary>Sample Response</summary>

```json5
HTTP/1.1 200 OK
'Server': 'nginx/1.20.1'
'Date': 'Wed, 13 Mar 2024 10:41:18 GMT'
'Content-Type': 'application/json'
'Content-Length': '671'
'Connection': 'keep-alive'
'X-Compute-Request-Id': 'req-9dfe92c3-5b82-4062-98b0-b00294147b02'
{
  "backup_target_types": {
    "id": "c65625c1-50bf-4ab7-aa26-f625001e60f1",
    "backup_targets_id": "2af5f2db-3267-453f-bc57-19884837e274",
    "created_at": "2024-03-04T10:59:51.000000",
    "version": "5.0.204",
    "user_id": "2b1189be3add4806bcb7e0c259b03597",
    "name": "s3_2",
    "is_default": false,
    "description": null,
    "is_public": false,
    "backup_target_type_projects": [
      {
        "created_at": "2024-03-13T10:39:14.000000",
        "updated_at": null,
        "version": "5.0.204",
        "id": "5a14a688-e16f-45f9-91c2-6906fb200825",
        "backup_target_types_id": "c65625c1-50bf-4ab7-aa26-f625001e60f1",
        "project_id": "fc439373e340459fb28202b2412e26c0"
      }
    ],
    "backup_target_type_metadata": [
      {
        "key": "dg1",
        "value": "dg2"
      }
    ]
  }
}
```

</details>

### **Add Metadata to Backup Target Type**

Adds metadata to an existing backup target type

<mark style="color:orange;">`POST`</mark> `https://<wlm_api_endpoint>/backup_target_types/<backup_target_type_id>/add_metadata`

#### Input Parameters:

Path:

<table><thead><tr><th width="219">Parameter Name</th><th>Description</th></tr></thead><tbody><tr><td>wlm_api_endpoint</td><td>The endpoint URL of the <code>Workloadmgr</code>service</td></tr><tr><td>backup_target_type_id</td><td>Id of the required Backup Target Type</td></tr></tbody></table>

Headers:

| Header Name       | Value/Description                            |
| ----------------- | -------------------------------------------- |
| X-Auth-Project-Id | Project ID to run the authentication against |
| X-Auth-Token      | Authentication token to use                  |
| Accept            | `application/json`                           |
| User-Agent        | `python-workloadmgrclient`                   |

Body Format:

```json
{
    "backup_target_type" :
    {
        "backup_target_type_id": <ID of the backup target type>,
        "metadata": [
            <list of dictionaries of key-value pair to be added >
            {
                "key":<meta-key>,
                "value":<meta-value>
            },
        ],
        }
}
```

<details>

<summary>Sample Response</summary>

```json5
HTTP/1.1 200 OK
'Server': 'nginx/1.20.1'
'Date': 'Wed, 13 Mar 2024 10:44:02 GMT'
'Content-Type': 'application/json'
'Content-Length': '671'
'Connection': 'keep-alive'
'X-Compute-Request-Id': 'req-870c776b-a160-41c0-82a9-d9e7131d77aa'
{
  "backup_target_types": {
    "id": "c65625c1-50bf-4ab7-aa26-f625001e60f1",
    "backup_targets_id": "2af5f2db-3267-453f-bc57-19884837e274",
    "created_at": "2024-03-04T10:59:51.000000",
    "version": "5.0.204",
    "user_id": "2b1189be3add4806bcb7e0c259b03597",
    "name": "s3_2",
    "is_default": false,
    "description": null,
    "is_public": false,
    "backup_target_type_projects": [
      {
        "created_at": "2024-03-13T10:39:14.000000",
        "updated_at": null,
        "version": "5.0.204",
        "id": "5a14a688-e16f-45f9-91c2-6906fb200825",
        "backup_target_types_id": "c65625c1-50bf-4ab7-aa26-f625001e60f1",
        "project_id": "fc439373e340459fb28202b2412e26c0"
      }
    ],
    "backup_target_type_metadata": [
      {
        "key": "dg1",
        "value": "dg2"
      }
    ]
  }
}
```

</details>

### **Remove Metadata from a Backup Target Type**

Removes metadata from an existing backup target type

<mark style="color:blue;">`PUT`</mark> `https://<wlm_api_endpoint>/backup_target_types/<backup_target_type_id>/remove_metadata`

#### Input Parameters:

Path:

<table><thead><tr><th width="219">Parameter Name</th><th>Description</th></tr></thead><tbody><tr><td>wlm_api_endpoint</td><td>The endpoint URL of the <code>Workloadmgr</code>service</td></tr><tr><td>backup_target_type_id</td><td>Id of the required Backup Target Type</td></tr></tbody></table>

Headers:

| Header Name       | Value/Description                            |
| ----------------- | -------------------------------------------- |
| X-Auth-Project-Id | Project ID to run the authentication against |
| X-Auth-Token      | Authentication token to use                  |
| Accept            | `application/json`                           |
| User-Agent        | `python-workloadmgrclient`                   |

Body Format:

```json
{
    "backup_target_type" :
    {
        "backup_target_type_id": <ID of the backup target type>,
        "metadata": [
            <list of dictionaries of key-value pair to be removed >
            {
                "key":<meta-key>,
                "value":<meta-value>
            },
        ],
        }
}
```

<details>

<summary>Sample Response</summary>

```json5
HTTP/1.1 200 OK
'Server': 'nginx/1.20.1'
'Date': 'Wed, 13 Mar 2024 10:45:12 GMT'
'Content-Type': 'application/json'
'Content-Length': '671'
'Connection': 'keep-alive'
'X-Compute-Request-Id': 'req-7eee91f0-d02f-41e1-afe2-ebcbe39aaa85'
{
  "backup_target_types": {
    "id": "c65625c1-50bf-4ab7-aa26-f625001e60f1",
    "backup_targets_id": "2af5f2db-3267-453f-bc57-19884837e274",
    "created_at": "2024-03-04T10:59:51.000000",
    "version": "5.0.204",
    "user_id": "2b1189be3add4806bcb7e0c259b03597",
    "name": "s3_2",
    "is_default": false,
    "description": null,
    "is_public": false,
    "backup_target_type_projects": [
      {
        "created_at": "2024-03-13T10:39:14.000000",
        "updated_at": null,
        "version": "5.0.204",
        "id": "5a14a688-e16f-45f9-91c2-6906fb200825",
        "backup_target_types_id": "c65625c1-50bf-4ab7-aa26-f625001e60f1",
        "project_id": "fc439373e340459fb28202b2412e26c0"
      }
    ],
    "backup_target_type_metadata": [
      {
        "key": "dg1",
        "value": "dg2"
      }
    ]
  }
}
```

</details>

### **Delete a Backup Target Type**

Deleting an existing backup target type

{% hint style="danger" %}
Removing Backup Target Types from an active Workload can lead to inconsistent behavior and potential backup operation failures.
{% endhint %}

<mark style="color:red;">`DELETE`</mark> `https://<wlm_api_endpoint>/backup_target_types/<backup_target_type_id>`

#### Input Parameters:

Path:

<table><thead><tr><th width="219">Parameter Name</th><th>Description</th></tr></thead><tbody><tr><td>wlm_api_endpoint</td><td>The endpoint URL of the <code>Workloadmgr</code>service</td></tr><tr><td>backup_target_type_id</td><td>Id of the required Backup Target Type</td></tr></tbody></table>

Headers:

| Header Name       | Value/Description                            |
| ----------------- | -------------------------------------------- |
| X-Auth-Project-Id | Project ID to run the authentication against |
| X-Auth-Token      | Authentication token to use                  |
| Accept            | `application/json`                           |
| User-Agent        | `python-workloadmgrclient`                   |

<details>

<summary>Sample Response</summary>

```json5
HTTP/1.1 202 OK
'Server': 'nginx/1.20.1'
'Date': 'Wed, 13 Mar 2024 10:33:02 GMT'
'Content-Type': 'text/html; charset=UTF-8'
'Content-Length': '0'
'Connection': 'keep-alive'
```

</details>


---

# 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.trilio.io/openstack/api-guide/backup-targets.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.
