# Workload Import and Migration

## import Workload list

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

Provides the list of all importable workloads

#### 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                               |
| ----------- | ------ | ----------------------------------------- |
| project\_id | string | restricts the output to the given project |

#### 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                          |
| User-Agent        | string | python-workloadmgrclient                  |

{% tabs %}
{% tab title="200 Identified Workloads with their details are returned" %}

```
HTTP/1.1 200 OK
Server: nginx/1.16.1
Date: Tue, 17 Nov 2020 10:34:10 GMT
Content-Type: application/json
Content-Length: 7888
Connection: keep-alive
X-Compute-Request-Id: req-9d73e5e6-ca5a-4c07-bdf2-ec2e688fc339

{
   "workloads":[
      {
         "created_at":"2020-11-02T13:40:06.000000",
         "updated_at":"2020-11-09T09:53:30.000000",
         "id":"18b809de-d7c8-41e2-867d-4a306407fb11",
         "user_id":"ccddc7e7a015487fa02920f4d4979779",
         "project_id":"c76b3355a164498aa95ddbc960adc238",
         "availability_zone":"nova",
         "workload_type_id":"f82ce76f-17fe-438b-aa37-7a023058e50d",
         "name":"Workload_1",
         "description":"no-description",
         "interval":null,
         "storage_usage":null,
         "instances":null,
         "metadata":[
            {
               "created_at":"2020-11-09T09:57:23.000000",
               "updated_at":null,
               "deleted_at":null,
               "deleted":false,
               "version":"4.0.115",
               "id":"ee27bf14-e460-454b-abf5-c17e3d484ec2",
               "workload_id":"18b809de-d7c8-41e2-867d-4a306407fb11",
               "key":"63cd8d96-1c4a-4e61-b1e0-3ae6a17bf533",
               "value":"c8468146-8117-48a4-bfd7-49381938f636"
            },
            {
               "created_at":"2020-11-05T10:27:06.000000",
               "updated_at":null,
               "deleted_at":null,
               "deleted":false,
               "version":"4.0.115",
               "id":"22d3e3d6-5a37-48e9-82a1-af2dda11f476",
               "workload_id":"18b809de-d7c8-41e2-867d-4a306407fb11",
               "key":"67d6a100-fee6-4aa5-83a1-66b070d2eabe",
               "value":"1fb104bf-7e2b-4cb6-84f6-96aabc8f1dd2"
            },
            {
               "created_at":"2020-11-09T09:37:20.000000",
               "updated_at":"2020-11-09T09:57:23.000000",
               "deleted_at":null,
               "deleted":false,
               "version":"4.0.115",
               "id":"61615532-6165-45a2-91e2-fbad9eb0b284",
               "workload_id":"18b809de-d7c8-41e2-867d-4a306407fb11",
               "key":"b083bb70-e384-4107-b951-8e9e7bbac380",
               "value":"c8468146-8117-48a4-bfd7-49381938f636"
            },
            {
               "created_at":"2020-11-02T13:40:24.000000",
               "updated_at":null,
               "deleted_at":null,
               "deleted":false,
               "version":"4.0.115",
               "id":"5a53c8ee-4482-4d6a-86f2-654d2b06e28c",
               "workload_id":"18b809de-d7c8-41e2-867d-4a306407fb11",
               "key":"backup_media_target",
               "value":"10.10.2.20:/upstream"
            },
            {
               "created_at":"2020-11-05T10:27:14.000000",
               "updated_at":"2020-11-09T09:57:23.000000",
               "deleted_at":null,
               "deleted":false,
               "version":"4.0.115",
               "id":"5cb4dc86-a232-4916-86bf-42a0d17f1439",
               "workload_id":"18b809de-d7c8-41e2-867d-4a306407fb11",
               "key":"e33c1eea-c533-4945-864d-0da1fc002070",
               "value":"c8468146-8117-48a4-bfd7-49381938f636"
            },
            {
               "created_at":"2020-11-02T13:40:06.000000",
               "updated_at":"2020-11-02T14:10:30.000000",
               "deleted_at":null,
               "deleted":false,
               "version":"4.0.115",
               "id":"506cd466-1e15-416f-9f8e-b9bdb942f3e1",
               "workload_id":"18b809de-d7c8-41e2-867d-4a306407fb11",
               "key":"hostnames",
               "value":"[\"cirros-1\", \"cirros-2\"]"
            },
            {
               "created_at":"2020-11-02T13:40:06.000000",
               "updated_at":null,
               "deleted_at":null,
               "deleted":false,
               "version":"4.0.115",
               "id":"093a1221-edb6-4957-8923-cf271f7e43ce",
               "workload_id":"18b809de-d7c8-41e2-867d-4a306407fb11",
               "key":"pause_at_snapshot",
               "value":"0"
            },
            {
               "created_at":"2020-11-02T13:40:06.000000",
               "updated_at":null,
               "deleted_at":null,
               "deleted":false,
               "version":"4.0.115",
               "id":"79baaba8-857e-410f-9d2a-8b14670c4722",
               "workload_id":"18b809de-d7c8-41e2-867d-4a306407fb11",
               "key":"policy_id",
               "value":"b79aa5f3-405b-4da4-96e2-893abf7cb5fd"
            },
            {
               "created_at":"2020-11-02T13:40:06.000000",
               "updated_at":null,
               "deleted_at":null,
               "deleted":false,
               "version":"4.0.115",
               "id":"4e23fa3d-1a79-4dc8-86cb-dc1ecbd7008e",
               "workload_id":"18b809de-d7c8-41e2-867d-4a306407fb11",
               "key":"preferredgroup",
               "value":"[]"
            },
            {
               "created_at":"2020-11-02T14:10:30.000000",
               "updated_at":null,
               "deleted_at":null,
               "deleted":false,
               "version":"4.0.115",
               "id":"ed06cca6-83d8-4d4c-913b-30c8b8418b80",
               "workload_id":"18b809de-d7c8-41e2-867d-4a306407fb11",
               "key":"topology",
               "value":"\"\\\"\\\"\""
            },
            {
               "created_at":"2020-11-02T13:40:23.000000",
               "updated_at":null,
               "deleted_at":null,
               "deleted":false,
               "version":"4.0.115",
               "id":"4b6a80f7-b011-48d4-b5fd-f705448de076",
               "workload_id":"18b809de-d7c8-41e2-867d-4a306407fb11",
               "key":"workload_approx_backup_size",
               "value":"6"
            }
         ],
         "jobschedule":"(dp0\nVfullbackup_interval\np1\nV-1\np2\nsVretention_policy_type\np3\nVNumber of Snapshots to Keep\np4\nsVend_date\np5\nVNo End\np6\nsVstart_time\np7\nV01:45 PM\np8\nsVinterval\np9\nV5\np10\nsVenabled\np11\nI00\nsVretention_policy_value\np12\nV10\np13\nsVtimezone\np14\nVUTC\np15\nsVstart_date\np16\nV11/02/2020\np17\nsVappliance_timezone\np18\nVUTC\np19\ns.",
         "status":"locked",
         "error_msg":null,
         "links":[
            {
               "rel":"self",
               "href":"http://wlm_backend/v1/4dfe98a43bfa404785a812020066b4d6/workloads/18b809de-d7c8-41e2-867d-4a306407fb11"
            },
            {
               "rel":"bookmark",
               "href":"http://wlm_backend/4dfe98a43bfa404785a812020066b4d6/workloads/18b809de-d7c8-41e2-867d-4a306407fb11"
            }
         ],
         "scheduler_trust":null
      }
   ]
}
```

{% endtab %}
{% endtabs %}

## orphaned Workload list

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

Provides the list of all orphaned workloads

#### 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 shows 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                          |
| User-Agent        | string | python-workloadmgrclient                  |

{% tabs %}
{% tab title="200 Returns the list of identified workloads together with their details" %}

```
HTTP/1.1 200 OK
Server: nginx/1.16.1
Date: Tue, 17 Nov 2020 10:42:01 GMT
Content-Type: application/json
Content-Length: 120143
Connection: keep-alive
X-Compute-Request-Id: req-b443f6e7-8d8e-413f-8d91-7c30ba166e8c

{
   "workloads":[
      {
         "created_at":"2019-04-24T14:09:20.000000",
         "updated_at":"2019-05-16T09:10:17.000000",
         "id":"0ed39f25-5df2-4cc5-820f-2af2cde6aa67",
         "user_id":"6ef8135faedc4259baac5871e09f0044",
         "project_id":"863b6e2a8e4747f8ba80fdce1ccf332e",
         "availability_zone":"nova",
         "workload_type_id":"f82ce76f-17fe-438b-aa37-7a023058e50d",
         "name":"comdirect_test",
         "description":"Daily UNIX Backup 03:15 PM Full 7D Keep 8",
         "interval":null,
         "storage_usage":null,
         "instances":null,
         "metadata":[
            {
               "workload_id":"0ed39f25-5df2-4cc5-820f-2af2cde6aa67",
               "deleted":false,
               "created_at":"2019-05-16T09:13:54.000000",
               "updated_at":null,
               "value":"ca544215-1182-4a8f-bf81-910f5470887a",
               "version":"3.2.46",
               "key":"40965cbb-d352-4618-b8b0-ea064b4819bb",
               "deleted_at":null,
               "id":"5184260e-8bb3-4c52-abfa-1adc05fe6997"
            },
            {
               "workload_id":"0ed39f25-5df2-4cc5-820f-2af2cde6aa67",
               "deleted":true,
               "created_at":"2019-04-24T14:09:30.000000",
               "updated_at":"2019-05-16T09:01:23.000000",
               "value":"10.10.2.20:/upstream",
               "version":"3.2.46",
               "key":"backup_media_target",
               "deleted_at":"2019-05-16T09:01:23.000000",
               "id":"02dd0630-7118-485c-9e42-b01d23aa882c"
            },
            {
               "workload_id":"0ed39f25-5df2-4cc5-820f-2af2cde6aa67",
               "deleted":false,
               "created_at":"2019-05-16T09:13:51.000000",
               "updated_at":null,
               "value":"51693eca-8714-49be-b409-f1f1709db595",
               "version":"3.2.46",
               "key":"eb7d6b13-21e4-45d1-b888-d3978ab37216",
               "deleted_at":null,
               "id":"4b79a4ef-83d6-4e5a-afb3-f4e160c5f257"
            },
            {
               "workload_id":"0ed39f25-5df2-4cc5-820f-2af2cde6aa67",
               "deleted":true,
               "created_at":"2019-04-24T14:09:20.000000",
               "updated_at":"2019-05-16T09:01:23.000000",
               "value":"[\"Comdirect_test-2\", \"Comdirect_test-1\"]",
               "version":"3.2.46",
               "key":"hostnames",
               "deleted_at":"2019-05-16T09:01:23.000000",
               "id":"0cb6a870-8f30-4325-a4ce-e9604370198e"
            },
            {
               "workload_id":"0ed39f25-5df2-4cc5-820f-2af2cde6aa67",
               "deleted":false,
               "created_at":"2019-04-24T14:09:20.000000",
               "updated_at":"2019-05-16T09:01:23.000000",
               "value":"0",
               "version":"3.2.46",
               "key":"pause_at_snapshot",
               "deleted_at":null,
               "id":"5d4f109c-9dc2-48f3-a12a-e8b8fa4f5be9"
            },
            {
               "workload_id":"0ed39f25-5df2-4cc5-820f-2af2cde6aa67",
               "deleted":true,
               "created_at":"2019-04-24T14:09:20.000000",
               "updated_at":"2019-05-16T09:01:23.000000",
               "value":"[]",
               "version":"3.2.46",
               "key":"preferredgroup",
               "deleted_at":"2019-05-16T09:01:23.000000",
               "id":"9a223fbc-7cad-4c2c-ae8a-75e6ee8a6efc"
            },
            {
               "workload_id":"0ed39f25-5df2-4cc5-820f-2af2cde6aa67",
               "deleted":true,
               "created_at":"2019-04-24T14:11:49.000000",
               "updated_at":"2019-05-16T09:01:23.000000",
               "value":"\"\\\"\\\"\"",
               "version":"3.2.46",
               "key":"topology",
               "deleted_at":"2019-05-16T09:01:23.000000",
               "id":"77e436c0-0921-4919-97f4-feb58fb19e06"
            },
            {
               "workload_id":"0ed39f25-5df2-4cc5-820f-2af2cde6aa67",
               "deleted":true,
               "created_at":"2019-04-24T14:09:30.000000",
               "updated_at":"2019-05-16T09:01:23.000000",
               "value":"121",
               "version":"3.2.46",
               "key":"workload_approx_backup_size",
               "deleted_at":"2019-05-16T09:01:23.000000",
               "id":"79aa04dd-a102-4bd8-b672-5b7a6ce9e125"
            }
         ],
         "jobschedule":"(dp1\nVfullbackup_interval\np2\nV7\nsVretention_policy_type\np3\nVNumber of days to retain Snapshots\np4\nsVend_date\np5\nV05/31/2019\np6\nsVstart_time\np7\nS'02:15 PM'\np8\nsVinterval\np9\nV24 hrs\np10\nsVenabled\np11\nI01\nsVretention_policy_value\np12\nI8\nsS'appliance_timezone'\np13\nS'UTC'\np14\nsVtimezone\np15\nVAfrica/Porto-Novo\np16\nsVstart_date\np17\nS'04/24/2019'\np18\ns.",
         "status":"locked",
         "error_msg":null,
         "links":[
            {
               "rel":"self",
               "href":"http://wlm_backend/v1/4dfe98a43bfa404785a812020066b4d6/workloads/orphan_workloads/4dfe98a43bfa404785a812020066b4d6/workloads/0ed39f25-5df2-4cc5-820f-2af2cde6aa67"
            },
            {
               "rel":"bookmark",
               "href":"http://wlm_backend/4dfe98a43bfa404785a812020066b4d6/workloads/orphan_workloads/4dfe98a43bfa404785a812020066b4d6/workloads/0ed39f25-5df2-4cc5-820f-2af2cde6aa67"
            }
         ],
         "scheduler_trust":null
      }
   ]
}
```

{% endtab %}
{% endtabs %}

## Import Workload

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

Imports all or the provided workloads

#### Path Parameters

| Name         | Type   | Description                                      |
| ------------ | ------ | ------------------------------------------------ |
| tvm\_address | string | IP or FQDN of the Trilio Service                 |
| tenant\_id   | string | ID of the Tenant/Project to take the Snapshot 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                      |
| User-Agent        | string | python-workloadmgrclient              |

{% tabs %}
{% tab title="200 Returns the list of successfully imported and failed Workloads" %}

```
HTTP/1.1 200 OK
Server: nginx/1.16.1
Date: Tue, 17 Nov 2020 11:03:55 GMT
Content-Type: application/json
Content-Length: 100
Connection: keep-alive
X-Compute-Request-Id: req-0e58b419-f64c-47e1-adb9-21ea2a255839

{
   "workloads":{
      "imported_workloads":[
         "faa03-f69a-45d5-a6fc-ae0119c77974"        
      ],
      "failed_workloads":[
 
      ]
   }
}
```

{% endtab %}
{% endtabs %}

### Body format

```
{
   "workload_ids":[
      "<workload_id>"
   ],
   "upgrade":true
}
```


---

# 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/workload-import-and-migration.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.
