> For the complete documentation index, see [llms.txt](https://docs.trilio.io/openstack/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.trilio.io/openstack/api-guide/workload-import-and-migration.md).

# Workload Import and Migration

{% hint style="info" %}
All Import & Reassign endpoints require an admin user.
{% endhint %}

## \[DEPRECATED] Importable workload list

<mark style="color:green;">`POST`</mark> `https://$(tvm_address):8780/v1/$(tenant_id)/workloads/get_list/import_workloads`

DEPRECATED: use POST /workloads/get\_list/import\_reassign (see "Import and Reassign workload discovery" below). Response change: instead of the inline workload list, it now starts a discovery job listing the importable workloads by project\_id/backup\_targets and returns its jobid; fetch the results via the job details endpoint.

#### Path Parameters

| Name         | Type   | Description                         |
| ------------ | ------ | ----------------------------------- |
| tvm\_address | string | IP or FQDN of Trilio Service        |
| tenant\_id   | string | ID of the Tenant/Project to work in |

#### Headers

| Name              | Type   | Description                               |
| ----------------- | ------ | ----------------------------------------- |
| X-Auth-Project-Id | string | project to run the authentication against |
| X-Auth-Token      | string | Authentication token to use               |
| Accept            | string | application/json                          |

#### Request Body

| Name            | Type   | Description                                         |
| --------------- | ------ | --------------------------------------------------- |
| project\_id     | string | restricts the discovery to the given project        |
| backup\_targets | array  | restricts the discovery to the given backup targets |

{% tabs %}
{% tab title="200 Returns the jobid of the started discovery job and a deprecation notice" %}

```
{
   "jobs":[
      {
         "jobid":104
      }
   ],
   "deprecation":"/workloads/get_list/import_workloads is deprecated; use /workloads/get_list/import_reassign."
}
```

{% endtab %}
{% endtabs %}

## \[DEPRECATED] Orphaned workload list

<mark style="color:blue;">`GET`</mark> `https://$(tvm_address):8780/v1/$(tenant_id)/workloads/orphan_workloads/`

DEPRECATED: use POST /workloads/get\_list/import\_reassign with orphaned=true (see "Import and Reassign workload discovery" below). Response change: instead of the inline orphaned workload list, it now starts an orphaned-workload discovery job and returns its jobid; fetch the results via the job details endpoint.

#### Path Parameters

| Name         | Type   | Description                         |
| ------------ | ------ | ----------------------------------- |
| tvm\_address | string | IP or FQDN of Trilio Service        |
| tenant\_id   | string | ID of the Tenant/Project to work in |

#### Query Parameters

| Name           | Type    | Description                                         |
| -------------- | ------- | --------------------------------------------------- |
| migrate\_cloud | boolean | True also discovers workloads from different clouds |

#### Headers

| Name              | Type   | Description                               |
| ----------------- | ------ | ----------------------------------------- |
| X-Auth-Project-Id | string | project to run the authentication against |
| X-Auth-Token      | string | Authentication token to use               |
| Accept            | string | application/json                          |

{% tabs %}
{% tab title="200 Returns the jobid of the started discovery job and a deprecation notice" %}

```
{
   "jobs":[
      {
         "jobid":105
      }
   ],
   "deprecation":"/workloads/orphan_workloads is deprecated; use /workloads/get_list/import_reassign with orphaned=True."
}
```

{% endtab %}
{% endtabs %}

## \[DEPRECATED] Import workloads

<mark style="color:green;">`POST`</mark> `https://$(tvm_address):8780/v1/$(tenant_id)/workloads/import_workloads`

DEPRECATED: use POST /workloads/import\_reassign\_workloads (see "Import and Reassign workloads" below). Imports all or the provided workloads and returns the jobid of the import job. With inplace\_upgrade=true it instead upgrades the existing workload and policy database records to the current release (the workload-inplace-db-upgrade CLI command).

#### Path Parameters

| Name         | Type   | Description                         |
| ------------ | ------ | ----------------------------------- |
| tvm\_address | string | IP or FQDN of the Trilio Service    |
| tenant\_id   | string | ID of the Tenant/Project to work in |

#### Headers

| Name              | Type   | Description                           |
| ----------------- | ------ | ------------------------------------- |
| X-Auth-Project-Id | string | Project to run authentication against |
| X-Auth-Token      | string | Authentication token to use           |
| Content-Type      | string | application/json                      |
| Accept            | string | application/json                      |

#### Request Body

| Name             | Type    | Description                                                                                                  |
| ---------------- | ------- | ------------------------------------------------------------------------------------------------------------ |
| workload\_ids    | array   | Workload ids to import. If omitted, all available workloads from the source Backup Target Type are imported. |
| source\_btt      | array   | List of Backup Target Type ids to search in                                                                  |
| source\_btt\_all | boolean | True searches all Backup Target Types                                                                        |
| target\_btt      | string  | Backup Target Type id to assign the imported workloads to                                                    |
| upgrade          | boolean | True upgrades the imported workload records to the current release schema. Default is True.                  |
| inplace\_upgrade | boolean | True runs the in-place database upgrade instead of an import. Default is False.                              |

{% tabs %}
{% tab title="200 Returns the jobid of the started import (or in-place upgrade) job" %}

```
{
   "jobs":[
      {
         "jobid":106
      }
   ]
}
```

{% endtab %}
{% endtabs %}

## \[DEPRECATED] Reassign workloads

<mark style="color:green;">`POST`</mark> `https://$(tvm_address):8780/v1/$(tenant_id)/workloads/reasign_workloads`

DEPRECATED: use POST /workloads/import\_reassign\_workloads (see "Import and Reassign workloads" below). Accepts the same list-of-tenant-maps body as the unified endpoint and delegates to it. Response change: instead of only the reassigned workloads, the response now contains the immediately reassigned workloads, the failed workloads and the jobid\_list of the asynchronous import operations, plus a deprecation notice.

#### Path Parameters

| Name         | Type   | Description                         |
| ------------ | ------ | ----------------------------------- |
| tvm\_address | string | IP or FQDN of Trilio Service        |
| tenant\_id   | string | ID of the Tenant/Project to work in |

#### Headers

| Name              | Type   | Description                               |
| ----------------- | ------ | ----------------------------------------- |
| X-Auth-Project-Id | string | project to run the authentication against |
| X-Auth-Token      | string | Authentication token to use               |
| Content-Type      | string | application/json                          |
| Accept            | string | application/json                          |

{% tabs %}
{% tab title="200 Same response as the unified endpoint plus a deprecation notice" %}

```
{
   "workloads":{
      "reassigned_workloads":[],
      "failed_workloads":[],
      "jobid_list":[
         107
      ]
   },
   "deprecation":"/workloads/reasign_workloads is deprecated; use /workloads/import_reassign_workloads."
}
```

{% endtab %}
{% endtabs %}

## Unified Import and Reassign API

The typical flow is:

1. `POST /workloads/get_list/import_reassign` :arrow\_right: discover importable/reassignable workloads, returns a `jobid`
2. `POST /workloads/job_details` :arrow\_right: fetch the discovery results for the `jobid`
3. `POST /workloads/import_reassign_workloads` :arrow\_right: run the import/reassign operation, returns `jobid`s
4. `POST /workloads/job_details` :arrow\_right: track the operation progress
5. `GET /workloads/jobs/list` and `POST /workloads/jobs/delete` :arrow\_right: manage job records

### Import and Reassign workload discovery

## Import/Reassign workload discovery

<mark style="color:green;">`POST`</mark> `https://$(tvm_address):8780/v1/$(tenant_id)/workloads/get_list/import_reassign`

Starts a discovery job that lists all workloads on the Backup Target(s) that can be imported into the Trilio database and/or reassigned to a new owner. Returns a jobid; fetch the results with the job details endpoint.

#### Path Parameters

| Name         | Type   | Description                         |
| ------------ | ------ | ----------------------------------- |
| tvm\_address | string | IP or FQDN of Trilio Service        |
| tenant\_id   | string | ID of the Tenant/Project to work in |

#### Headers

| Name              | Type   | Description                               |
| ----------------- | ------ | ----------------------------------------- |
| X-Auth-Project-Id | string | project to run the authentication against |
| X-Auth-Token      | string | Authentication token to use               |
| Content-Type      | string | application/json                          |
| Accept            | string | application/json                          |

#### Request Body

| Name             | Type    | Description                                                                                                                                                 |
| ---------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| old\_tenant\_ids | array   | List of old tenant ids whose workloads shall be listed. Mutually exclusive with orphaned.                                                                   |
| orphaned         | boolean | True discovers orphaned workloads (whose tenant/user is not valid in the current cloud). Mutually exclusive with old\_tenant\_ids.                          |
| source\_btt      | array   | List of Backup Target Type ids to search in. Mutually exclusive with source\_btt\_all. If neither is provided the default Backup Target Type is considered. |
| source\_btt\_all | boolean | True searches all Backup Target Types. Mutually exclusive with source\_btt.                                                                                 |
| migrate\_cloud   | boolean | True also includes workloads owned by other clouds. Default is False.                                                                                       |

{% tabs %}
{% tab title="200 Returns the jobid of the started discovery job" %}

```
{
   "jobs":[
      {
         "jobid":101
      }
   ]
}
```

{% endtab %}
{% endtabs %}

At least one of `old_tenant_ids`, `orphaned`, `source_btt` or `source_btt_all` must be provided. Providing `workload_ids` is rejected — to act on a known set of workloads, run the import/reassign operation directly.

#### Body format

```
{
   "old_tenant_ids":[
      "<old_tenant_id>"
   ],
   "orphaned":false,
   "source_btt":[
      "<backup_target_type_id>"
   ],
   "source_btt_all":false,
   "migrate_cloud":false
}
```

### Get job details

## Job details

<mark style="color:green;">`POST`</mark> `https://$(tvm_address):8780/v1/$(tenant_id)/workloads/job_details`

Returns the details/results of a job by jobid. The response layout depends on the job's action; for the Import & Reassign workflow these are list\_import\_reassign (discovery jobs) and import\_reassign (operation jobs).

#### Path Parameters

| Name         | Type   | Description                         |
| ------------ | ------ | ----------------------------------- |
| tvm\_address | string | IP or FQDN of Trilio Service        |
| tenant\_id   | string | ID of the Tenant/Project to work in |

#### Headers

| Name              | Type   | Description                               |
| ----------------- | ------ | ----------------------------------------- |
| X-Auth-Project-Id | string | project to run the authentication against |
| X-Auth-Token      | string | Authentication token to use               |
| Content-Type      | string | application/json                          |
| Accept            | string | application/json                          |

#### Request Body

| Name                                    | Type    | Description                           |
| --------------------------------------- | ------- | ------------------------------------- |
| jobid<mark style="color:red;">\*</mark> | integer | ID of the job to fetch the details of |

{% tabs %}
{% tab title="200 Discovery job (action list\_import\_reassign): the discovered workloads per Backup Target Type" %}

```
{
   "action":"list_import_reassign",
   "id":101,
   "created_at":"2026-08-04T10:15:32.000000",
   "updated_at":"2026-08-04T10:16:10.000000",
   "status":"completed",
   "workload_list":[
      {
         "workload_to_import":[
            "18b809de-d7c8-41e2-867d-4a306407fb11"
         ],
         "workload_to_reassign":[
            "0ed39f25-5df2-4cc5-820f-2af2cde6aa67"
         ],
         "source_btt":[
            "c9a5c9b6-92c3-4e73-a2b3-1e0a29e6b8b1"
         ],
         "tenant_map":{},
         "status":"processed",
         "error_message":null,
         "current_cloud":true
      }
   ]
}
```

{% endtab %}

{% tab title="200 Operation job (action import\_reassign): progress of the reassigned and imported workloads" %}

```
{
   "action":"import_reassign",
   "id":102,
   "created_at":"2026-08-04T10:20:01.000000",
   "updated_at":"2026-08-04T10:22:47.000000",
   "status":"completed",
   "workload_update_list":[
      {
         "workload_to_update":[
            "0ed39f25-5df2-4cc5-820f-2af2cde6aa67"
         ],
         "updated_workloads":[
            "0ed39f25-5df2-4cc5-820f-2af2cde6aa67"
         ],
         "source_btt":[
            "c9a5c9b6-92c3-4e73-a2b3-1e0a29e6b8b1"
         ],
         "error_message":null
      }
   ],
   "workload_import_list":[
      {
         "workload_to_import":[
            "18b809de-d7c8-41e2-867d-4a306407fb11"
         ],
         "source_btt":[
            "c9a5c9b6-92c3-4e73-a2b3-1e0a29e6b8b1"
         ],
         "error_message":null,
         "wl_import_job_id":103,
         "wl_import_job_details":{
            "...":"import job progress"
         }
      }
   ]
}
```

{% endtab %}
{% endtabs %}

Workloads listed under `workload_to_import` are not yet known to this Trilio installation and will be imported; workloads under `workload_to_reassign` already exist in the database and will only be reassigned. A `current_cloud` value of `false` means the workload belongs to another cloud and `migrate_cloud` is required to import/reassign it.

#### Body format

```
{
   "jobid":101
}
```

### Import and Reassign workloads

## Import & Reassign workloads

<mark style="color:green;">`POST`</mark> `https://$(tvm_address):8780/v1/$(tenant_id)/workloads/import_reassign_workloads`

Unified import + reassign operation. Imports workloads from the Backup Target and, when a reassignment target (new\_tenant\_id/user\_id) is provided, reassigns them to that tenant/user. When the target is omitted this performs a pure import and the workloads keep their original owner. The request body is a list of tenant maps, so multiple mappings can be executed in one call.

#### Path Parameters

| Name         | Type   | Description                         |
| ------------ | ------ | ----------------------------------- |
| tvm\_address | string | IP or FQDN of Trilio Service        |
| tenant\_id   | string | ID of the Tenant/Project to work in |

#### Headers

| Name              | Type   | Description                               |
| ----------------- | ------ | ----------------------------------------- |
| X-Auth-Project-Id | string | project to run the authentication against |
| X-Auth-Token      | string | Authentication token to use               |
| Content-Type      | string | application/json                          |
| Accept            | string | application/json                          |

#### Request Body

| Name             | Type    | Description                                                                                                                                                                                                                                         |
| ---------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| workload\_ids    | array   | Workload ids to import/reassign. Mutually exclusive with old\_tenant\_ids.                                                                                                                                                                          |
| old\_tenant\_ids | array   | Old tenant ids whose workloads shall be imported/reassigned. Mutually exclusive with workload\_ids.                                                                                                                                                 |
| new\_tenant\_id  | string  | Optional. New tenant id to reassign the workloads to. Must be provided together with user\_id. When omitted this is a pure import.                                                                                                                  |
| user\_id         | string  | Optional. User id to reassign the workloads to. Required when new\_tenant\_id is provided; the user must exist in the new tenant and hold the trustee role.                                                                                         |
| migrate\_cloud   | boolean | True also imports/reassigns workloads owned by other clouds. Default is False.                                                                                                                                                                      |
| source\_btt      | array   | List of Backup Target Type ids to search in. Mutually exclusive with source\_btt\_all. If neither is provided the default Backup Target Type is considered. When a workload exists in more than one Backup Target Type the latest copy is imported. |
| source\_btt\_all | boolean | True searches all Backup Target Types. Not allowed together with workload\_ids. Mutually exclusive with source\_btt.                                                                                                                                |
| target\_btt      | string  | Optional. Backup Target Type id to assign the imported workloads to. If not provided the workload's original Backup Target Type is used.                                                                                                            |
| upgrade          | boolean | True upgrades the imported workload records to the current release schema. Default is True.                                                                                                                                                         |

{% tabs %}
{% tab title="200 Returns the immediately reassigned workloads, the failed workloads and the jobids of the asynchronous import operations" %}

```
{
   "workloads":{
      "reassigned_workloads":[
         {
            "id":"0ed39f25-5df2-4cc5-820f-2af2cde6aa67",
            "name":"Workload_1",
            "project_id":"c76b3355a164498aa95ddbc960adc238",
            "user_id":"ccddc7e7a015487fa02920f4d4979779"
         }
      ],
      "failed_workloads":[],
      "jobid_list":[
         102
      ]
   }
}
```

{% endtab %}
{% endtabs %}

#### Body format

The body is a **list** of tenant maps:

```
[
   {
      "workload_ids":[
         "<workload_id>"
      ],
      "old_tenant_ids":[],
      "new_tenant_id":"<new_tenant_id>",
      "user_id":"<user_id>",
      "migrate_cloud":false,
      "source_btt":[
         "<backup_target_type_id>"
      ],
      "source_btt_all":false,
      "target_btt":null,
      "upgrade":true
   }
]
```

### List jobs

## List jobs

<mark style="color:blue;">`GET`</mark> `https://$(tvm_address):8780/v1/$(tenant_id)/workloads/jobs/list`

Paginated list of jobs, newest first, across every job action the job details endpoint can render. Admin only.

#### Path Parameters

| Name         | Type   | Description                         |
| ------------ | ------ | ----------------------------------- |
| tvm\_address | string | IP or FQDN of Trilio Service        |
| tenant\_id   | string | ID of the Tenant/Project to work in |

#### Query Parameters

| Name      | Type    | Description                                                                                                                                                                                                                                                                                                        |
| --------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| limit     | integer | Maximum number of jobs to return                                                                                                                                                                                                                                                                                   |
| marker    | integer | Return jobs older than (with a job id less than) this job id. Use the next\_marker of the previous page to fetch the next page.                                                                                                                                                                                    |
| action    | string  | Comma-separated list of job actions to narrow to, e.g. import\_reassign,list\_import\_reassign. Supported actions: import\_workloads, list\_importable\_workloads, inplace\_upgrade\_db\_records, tenants-chargeback-csv, list\_import\_reassign, list\_reassign\_workloads, import\_reassign, workload\_reassign. |
| sort\_dir | string  | desc (default) walks newest first, asc walks oldest first                                                                                                                                                                                                                                                          |

#### Headers

| Name              | Type   | Description                               |
| ----------------- | ------ | ----------------------------------------- |
| X-Auth-Project-Id | string | project to run the authentication against |
| X-Auth-Token      | string | Authentication token to use               |
| Accept            | string | application/json                          |

{% tabs %}
{% tab title="200 Returns the list of jobs; next\_marker is set only when another page exists" %}

```
{
   "jobs":[
      {
         "id":102,
         "action":"import_reassign",
         "status":"completed",
         "created_at":"2026-08-04T10:20:01.000000",
         "updated_at":"2026-08-04T10:22:47.000000"
      },
      {
         "id":101,
         "action":"list_import_reassign",
         "status":"completed",
         "created_at":"2026-08-04T10:15:32.000000",
         "updated_at":"2026-08-04T10:16:10.000000"
      }
   ],
   "next_marker":101
}
```

{% endtab %}
{% endtabs %}

### Delete jobs

## Delete jobs

<mark style="color:green;">`POST`</mark> `https://$(tvm_address):8780/v1/$(tenant_id)/workloads/jobs/delete`

Deletes one or more job records by job id, including their detail records. Admin only.

#### Path Parameters

| Name         | Type   | Description                         |
| ------------ | ------ | ----------------------------------- |
| tvm\_address | string | IP or FQDN of Trilio Service        |
| tenant\_id   | string | ID of the Tenant/Project to work in |

#### Headers

| Name              | Type   | Description                               |
| ----------------- | ------ | ----------------------------------------- |
| X-Auth-Project-Id | string | project to run the authentication against |
| X-Auth-Token      | string | Authentication token to use               |
| Content-Type      | string | application/json                          |
| Accept            | string | application/json                          |

#### Request Body

| Name                                     | Type  | Description                         |
| ---------------------------------------- | ----- | ----------------------------------- |
| jobids<mark style="color:red;">\*</mark> | array | Non-empty list of job ids to delete |

{% tabs %}
{% tab title="200 Returns the deleted and not found job ids" %}

```
{
   "deleted":[
      101,
      102
   ],
   "not_found":[
      999
   ]
}
```

{% endtab %}
{% endtabs %}

#### Body format

```
{
   "jobids":[
      101,
      102
   ]
}
```

A single id can alternatively be passed as `{"jobid": 101}`.
