# Restores

## List Restores

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

Lists Restores with details

#### Path Parameters

| Name         | Type   | Description                                         |
| ------------ | ------ | --------------------------------------------------- |
| tvm\_address | string | IP or FQDN of Trilio service                        |
| tenant\_id   | string | ID of the Tenant/Project to fetch the Restores from |

#### Query Parameters

| Name         | Type   | Description                                   |
| ------------ | ------ | --------------------------------------------- |
| snapshot\_id | string | ID of the Snapshot to fetch the Restores from |

#### 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 Cake successfully retrieved." %}

```
HTTP/1.1 200 OK
Server: nginx/1.16.1
Date: Thu, 05 Nov 2020 11:28:43 GMT
Content-Type: application/json
Content-Length: 4308
Connection: keep-alive
X-Compute-Request-Id: req-0bc531b6-be6e-43b4-90bd-39ef26ef1463

{
   "restores":[
      {
         "id":"29fdc1f8-1d53-4a10-bb45-e539a64cdbfc",
         "created_at":"2020-11-05T10:17:40.000000",
         "updated_at":"2020-11-05T10:17:40.000000",
         "finished_at":"2020-11-05T10:27:20.000000",
         "user_id":"ccddc7e7a015487fa02920f4d4979779",
         "project_id":"c76b3355a164498aa95ddbc960adc238",
         "status":"available",
         "restore_type":"restore",
         "snapshot_id":"2e56d167-bad7-43c7-8ede-a613c3fe7844",
         "links":[
            {
               "rel":"self",
               "href":"http://wlm_backend/v1/c76b3355a164498aa95ddbc960adc238/restores/29fdc1f8-1d53-4a10-bb45-e539a64cdbfc"
            },
            {
               "rel":"bookmark",
               "href":"http://wlm_backend/c76b3355a164498aa95ddbc960adc238/restores/29fdc1f8-1d53-4a10-bb45-e539a64cdbfc"
            }
         ],
         "name":"OneClick Restore",
         "description":"-",
         "host":"TVM2",
         "size":2147483648,
         "uploaded_size":2147483648,
         "progress_percent":100,
         "progress_msg":"Restore from snapshot is complete",
         "warning_msg":null,
         "error_msg":null,
         "time_taken":580,
         "restore_options":{
            "name":"OneClick Restore",
            "oneclickrestore":true,
            "restore_type":"oneclick",
            "openstack":{
               "instances":[
                  {
                     "name":"cirros-2",
                     "id":"67d6a100-fee6-4aa5-83a1-66b070d2eabe",
                     "availability_zone":"nova"
                  },
                  {
                     "name":"cirros-1",
                     "id":"e33c1eea-c533-4945-864d-0da1fc002070",
                     "availability_zone":"nova"
                  }
               ]
            },
            "type":"openstack",
            "description":"-"
         },
         "metadata":[
            {
               "created_at":"2020-11-05T10:27:20.000000",
               "updated_at":null,
               "deleted_at":null,
               "deleted":false,
               "version":"4.0.115",
               "id":"91ab2495-1903-4d75-982b-08a4e480835b",
               "restore_id":"29fdc1f8-1d53-4a10-bb45-e539a64cdbfc",
               "key":"data_transfer_time",
               "value":"0"
            },
            {
               "created_at":"2020-11-05T10:27:20.000000",
               "updated_at":null,
               "deleted_at":null,
               "deleted":false,
               "version":"4.0.115",
               "id":"e0e01eec-24e0-4abd-9b8c-19993a320e9f",
               "restore_id":"29fdc1f8-1d53-4a10-bb45-e539a64cdbfc",
               "key":"object_store_transfer_time",
               "value":"0"
            },
            {
               "created_at":"2020-11-05T10:27:20.000000",
               "updated_at":null,
               "deleted_at":null,
               "deleted":false,
               "version":"4.0.115",
               "id":"eb909267-ba9b-41d1-8861-a9ec22d6fd84",
               "restore_id":"29fdc1f8-1d53-4a10-bb45-e539a64cdbfc",
               "key":"restore_user_selected_value",
               "value":"Oneclick Restore"
            }
         ]
      },
      {
         "id":"4673d962-f6a5-4209-8d3e-b9f2e9115f07",
         "created_at":"2020-11-04T14:37:31.000000",
         "updated_at":"2020-11-04T14:37:31.000000",
         "finished_at":"2020-11-04T14:45:27.000000",
         "user_id":"ccddc7e7a015487fa02920f4d4979779",
         "project_id":"c76b3355a164498aa95ddbc960adc238",
         "status":"error",
         "restore_type":"restore",
         "snapshot_id":"2e56d167-bad7-43c7-8ede-a613c3fe7844",
         "links":[
            {
               "rel":"self",
               "href":"http://wlm_backend/v1/c76b3355a164498aa95ddbc960adc238/restores/4673d962-f6a5-4209-8d3e-b9f2e9115f07"
            },
            {
               "rel":"bookmark",
               "href":"http://wlm_backend/c76b3355a164498aa95ddbc960adc238/restores/4673d962-f6a5-4209-8d3e-b9f2e9115f07"
            }
         ],
         "name":"OneClick Restore",
         "description":"-",
         "host":"TVM2",
         "size":2147483648,
         "uploaded_size":2147483648,
         "progress_percent":100,
         "progress_msg":"",
         "warning_msg":null,
         "error_msg":"Failed restoring snapshot: Error creating instance e271bd6e-f53e-4ebc-875a-5787cc4dddf7",
         "time_taken":476,
         "restore_options":{
            "name":"OneClick Restore",
            "oneclickrestore":true,
            "restore_type":"oneclick",
            "openstack":{
               "instances":[
                  {
                     "name":"cirros-2",
                     "id":"67d6a100-fee6-4aa5-83a1-66b070d2eabe",
                     "availability_zone":"nova"
                  },
                  {
                     "name":"cirros-1",
                     "id":"e33c1eea-c533-4945-864d-0da1fc002070",
                     "availability_zone":"nova"
                  }
               ]
            },
            "type":"openstack",
            "description":"-"
         },
         "metadata":[
            {
               "created_at":"2020-11-04T14:45:27.000000",
               "updated_at":null,
               "deleted_at":null,
               "deleted":false,
               "version":"4.0.115",
               "id":"be6dc7e2-1be2-476b-9338-aed986be3b55",
               "restore_id":"4673d962-f6a5-4209-8d3e-b9f2e9115f07",
               "key":"data_transfer_time",
               "value":"0"
            },
            {
               "created_at":"2020-11-04T14:45:27.000000",
               "updated_at":null,
               "deleted_at":null,
               "deleted":false,
               "version":"4.0.115",
               "id":"2e4330b7-6389-4e21-b31b-2503b5441c3e",
               "restore_id":"4673d962-f6a5-4209-8d3e-b9f2e9115f07",
               "key":"object_store_transfer_time",
               "value":"0"
            },
            {
               "created_at":"2020-11-04T14:45:27.000000",
               "updated_at":null,
               "deleted_at":null,
               "deleted":false,
               "version":"4.0.115",
               "id":"561c806b-e38a-496c-a8de-dfe96cb3e956",
               "restore_id":"4673d962-f6a5-4209-8d3e-b9f2e9115f07",
               "key":"restore_user_selected_value",
               "value":"Oneclick Restore"
            }
         ]
      }
   ]
}
```

{% endtab %}
{% endtabs %}

## Get Restore

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

Provides all details about the specified Restore

#### Path Parameters

| Name         | Type   | Description                                        |
| ------------ | ------ | -------------------------------------------------- |
| tvm\_address | string | IP or FQDN of Trilio service                       |
| tenant\_id   | string | ID of the Tenant/Project to fetch the restore from |
| restore\_id  | string | ID of the restore to show                          |

#### Headers

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

{% tabs %}
{% tab title="200 Gives all details about the Restore" %}

```
HTTP/1.1 200 OK
Server: nginx/1.16.1
Date: Thu, 05 Nov 2020 14:04:45 GMT
Content-Type: application/json
Content-Length: 2639
Connection: keep-alive
X-Compute-Request-Id: req-30640219-e94e-4651-9b9e-49f5574e2a7f

{
   "restore":{
      "id":"29fdc1f8-1d53-4a10-bb45-e539a64cdbfc",
      "created_at":"2020-11-05T10:17:40.000000",
      "updated_at":"2020-11-05T10:17:40.000000",
      "finished_at":"2020-11-05T10:27:20.000000",
      "user_id":"ccddc7e7a015487fa02920f4d4979779",
      "project_id":"c76b3355a164498aa95ddbc960adc238",
      "status":"available",
      "restore_type":"restore",
      "snapshot_id":"2e56d167-bad7-43c7-8ede-a613c3fe7844",
      "snapshot_details":{
         "created_at":"2020-11-04T13:58:37.000000",
         "updated_at":"2020-11-05T10:27:22.000000",
         "deleted_at":null,
         "deleted":false,
         "version":"4.0.115",
         "id":"2e56d167-bad7-43c7-8ede-a613c3fe7844",
         "user_id":"ccddc7e7a015487fa02920f4d4979779",
         "project_id":"c76b3355a164498aa95ddbc960adc238",
         "workload_id":"18b809de-d7c8-41e2-867d-4a306407fb11",
         "snapshot_type":"full",
         "display_name":"API taken 2",
         "display_description":"API taken description 2",
         "size":44171264,
         "restore_size":2147483648,
         "uploaded_size":44171264,
         "progress_percent":100,
         "progress_msg":"Creating Instance: cirros-2",
         "warning_msg":null,
         "error_msg":null,
         "host":"TVM1",
         "finished_at":"2020-11-04T14:06:03.000000",
         "data_deleted":false,
         "pinned":false,
         "time_taken":428,
         "vault_storage_id":null,
         "status":"available"
      },
      "workload_id":"18b809de-d7c8-41e2-867d-4a306407fb11",
      "instances":[
         {
            "id":"1fb104bf-7e2b-4cb6-84f6-96aabc8f1dd2",
            "name":"cirros-2",
            "status":"available",
            "metadata":{
               "config_drive":"",
               "instance_id":"67d6a100-fee6-4aa5-83a1-66b070d2eabe",
               "production":"1"
            }
         },
         {
            "id":"b083bb70-e384-4107-b951-8e9e7bbac380",
            "name":"cirros-1",
            "status":"available",
            "metadata":{
               "config_drive":"",
               "instance_id":"e33c1eea-c533-4945-864d-0da1fc002070",
               "production":"1"
            }
         }
      ],
      "networks":[
         
      ],
      "subnets":[
         
      ],
      "routers":[
         
      ],
      "links":[
         {
            "rel":"self",
            "href":"http://wlm_backend/v1/c76b3355a164498aa95ddbc960adc238/restores/29fdc1f8-1d53-4a10-bb45-e539a64cdbfc"
         },
         {
            "rel":"bookmark",
            "href":"http://wlm_backend/c76b3355a164498aa95ddbc960adc238/restores/29fdc1f8-1d53-4a10-bb45-e539a64cdbfc"
         }
      ],
      "name":"OneClick Restore",
      "description":"-",
      "host":"TVM2",
      "size":2147483648,
      "uploaded_size":2147483648,
      "progress_percent":100,
      "progress_msg":"Restore from snapshot is complete",
      "warning_msg":null,
      "error_msg":null,
      "time_taken":580,
      "restore_options":{
         "name":"OneClick Restore",
         "oneclickrestore":true,
         "restore_type":"oneclick",
         "openstack":{
            "instances":[
               {
                  "name":"cirros-2",
                  "id":"67d6a100-fee6-4aa5-83a1-66b070d2eabe",
                  "availability_zone":"nova"
               },
               {
                  "name":"cirros-1",
                  "id":"e33c1eea-c533-4945-864d-0da1fc002070",
                  "availability_zone":"nova"
               }
            ]
         },
         "type":"openstack",
         "description":"-"
      },
      "metadata":[
         
      ]
   }
}
```

{% endtab %}
{% endtabs %}

## Delete Restore

<mark style="color:red;">`DELETE`</mark> `https://$(tvm_address):8780/v1/$(tenant_id)/restores/<restore_id>`

Deletes the specified Restore

#### Path Parameters

| Name         | Type   | Description                                        |
| ------------ | ------ | -------------------------------------------------- |
| tvm\_address | string | IP or FQDN of Trilio service                       |
| tenant\_id   | string | ID of the Tenant/Project to fetch the Restore from |
| restore\_id  | string | ID of the Restore to be deleted                    |

#### Headers

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

{% tabs %}
{% tab title="200 " %}

```
HTTP/1.1 200 OK
Server: nginx/1.16.1
Date: Thu, 05 Nov 2020 14:21:07 GMT
Content-Type: application/json
Content-Length: 0
Connection: keep-alive
X-Compute-Request-Id: req-0e155b21-8931-480a-a749-6d8764666e4d
```

{% endtab %}
{% endtabs %}

## Cancel Restore

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

Cancels an ongoing Restore

#### Path Parameters

| Name         | Type   | Description                                        |
| ------------ | ------ | -------------------------------------------------- |
| tvm\_address | string | IP or FQDN of the Trilio service                   |
| tenant\_id   | string | ID of the Tenant/Project to fetch the Restore from |
| restore\_id  | string | ID of the Restore to cancel                        |

#### Headers

| Name              | Type   | Description                     |
| ----------------- | ------ | ------------------------------- |
| X-Auth-Project-Id | string | Project to authenticate against |
| X-Auth-Token      | string | Authentication token to use     |
| Accept            | string | application/json                |
| User-Agent        | string | python-workloadmgrclient        |

{% tabs %}
{% tab title="200 Restore cancel request is received and cancel process started" %}

```
HTTP/1.1 200 OK
Server: nginx/1.16.1
Date: Thu, 05 Nov 2020 15:13:30 GMT
Content-Type: application/json
Content-Length: 0
Connection: keep-alive
X-Compute-Request-Id: req-98d4853c-314c-4f27-bd3f-f81bda1a2840
```

{% endtab %}
{% endtabs %}

## One Click Restore

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

Starts a restore according to the provided information

#### Path Parameters

| Name         | Type   | Description                                   |
| ------------ | ------ | --------------------------------------------- |
| tvm\_address | string | IP or FQDN of Trilio service                  |
| tenant\_id   | string | ID of the Tenant/Project to do the restore in |
| snapshot\_id | string | ID of the snapshot to restore                 |

#### Headers

| Name              | Type   | Description                     |
| ----------------- | ------ | ------------------------------- |
| X-Auth-Project-Id | string | Project to authenticate 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="202 Restore request accepted and started. Returns information about started Restore." %}

```
HTTP/1.1 202 Accepted
Server: nginx/1.16.1
Date: Thu, 05 Nov 2020 14:30:56 GMT
Content-Type: application/json
Content-Length: 992
Connection: keep-alive
X-Compute-Request-Id: req-7e18c309-19e5-49cb-a07e-90dd368fddae

{
   "restore":{
      "id":"3df1d432-2f76-4ebd-8f89-1275428842ff",
      "created_at":"2020-11-05T14:30:56.048656",
      "updated_at":"2020-11-05T14:30:56.048656",
      "finished_at":null,
      "user_id":"ccddc7e7a015487fa02920f4d4979779",
      "project_id":"c76b3355a164498aa95ddbc960adc238",
      "status":"restoring",
      "restore_type":"restore",
      "snapshot_id":"2e56d167-bad7-43c7-8ede-a613c3fe7844",
      "links":[
         {
            "rel":"self",
            "href":"http://wlm_backend/v1/c76b3355a164498aa95ddbc960adc238/restores/3df1d432-2f76-4ebd-8f89-1275428842ff"
         },
         {
            "rel":"bookmark",
            "href":"http://wlm_backend/c76b3355a164498aa95ddbc960adc238/restores/3df1d432-2f76-4ebd-8f89-1275428842ff"
         }
      ],
      "name":"One Click Restore",
      "description":"One Click Restore",
      "host":"",
      "size":0,
      "uploaded_size":0,
      "progress_percent":0,
      "progress_msg":null,
      "warning_msg":null,
      "error_msg":null,
      "time_taken":0,
      "restore_options":{
         "openstack":{
            
         },
         "type":"openstack",
         "oneclickrestore":true,
         "vmware":{
            
         },
         "restore_type":"oneclick"
      },
      "metadata":[
         
      ]
   }
}
```

{% endtab %}
{% endtabs %}

### Body Format

The One-Click restore requires a body to provide all necessary information in json format.

```
{
   "restore":{
      "options":{
         "openstack":{
            
         },
         "type":"openstack",
         "oneclickrestore":true,
         "vmware":{},
         "restore_type":"oneclick"
      },
      "name":"One Click Restore",
      "description":"One Click Restore"
   }
}
```

## Selective Restore

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

Starts a restore according to the provided information.

#### Path Parameters

| Name         | Type   | Description                                   |
| ------------ | ------ | --------------------------------------------- |
| tvm\_address | string | IP or FQDN of Trilio service                  |
| tenant\_id   | string | ID of the Tenant/Project to do the restore in |
| snapshot\_id | string | ID of the snapshot to restore                 |

#### Headers

| Name              | Type   | Description                     |
| ----------------- | ------ | ------------------------------- |
| X-Auth-Project-Id | string | Project to authenticate 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="202 Restore request accepted and started. Returns information about started Restore." %}

```
HTTP/1.1 202 Accepted
Server: nginx/1.16.1
Date: Mon, 09 Nov 2020 09:53:31 GMT
Content-Type: application/json
Content-Length: 1713
Connection: keep-alive
X-Compute-Request-Id: req-84f00d6f-1b12-47ec-b556-7b3ed4c2f1d7

{
   "restore":{
      "id":"778baae0-6c64-4eb1-8fa3-29324215c43c",
      "created_at":"2020-11-09T09:53:31.037588",
      "updated_at":"2020-11-09T09:53:31.037588",
      "finished_at":null,
      "user_id":"ccddc7e7a015487fa02920f4d4979779",
      "project_id":"c76b3355a164498aa95ddbc960adc238",
      "status":"restoring",
      "restore_type":"restore",
      "snapshot_id":"2e56d167-bad7-43c7-8ede-a613c3fe7844",
      "links":[
         {
            "rel":"self",
            "href":"http://wlm_backend/v1/c76b3355a164498aa95ddbc960adc238/restores/778baae0-6c64-4eb1-8fa3-29324215c43c"
         },
         {
            "rel":"bookmark",
            "href":"http://wlm_backend/c76b3355a164498aa95ddbc960adc238/restores/778baae0-6c64-4eb1-8fa3-29324215c43c"
         }
      ],
      "name":"API",
      "description":"API Created",
      "host":"",
      "size":0,
      "uploaded_size":0,
      "progress_percent":0,
      "progress_msg":null,
      "warning_msg":null,
      "error_msg":null,
      "time_taken":0,
      "restore_options":{
         "openstack":{
            "instances":[
               {
                  "vdisks":[
                     {
                        "new_volume_type":"iscsi",
                        "id":"365ad75b-ca76-46cb-8eea-435535fd2e22",
                        "availability_zone":"nova"
                     }
                  ],
                  "name":"cirros-1-selective",
                  "availability_zone":"nova",
                  "nics":[
                     
                  ],
                  "flavor":{
                     "vcpus":1,
                     "disk":1,
                     "swap":"",
                     "ram":512,
                     "ephemeral":0,
                     "id":"1"
                  },
                  "include":true,
                  "id":"e33c1eea-c533-4945-864d-0da1fc002070"
               },
               {
                  "include":false,
                  "id":"67d6a100-fee6-4aa5-83a1-66b070d2eabe"
               }
            ],
            "restore_topology":false,
            "networks_mapping":{
               "networks":[
                  {
                     "snapshot_network":{
                        "subnet":{
                           "id":"b7b54304-aa82-4d50-91e6-66445ab56db4"
                        },
                        "id":"5fb7027d-a2ac-4a21-9ee1-438c281d2b26"
                     },
                     "target_network":{
                        "subnet":{
                           "id":"b7b54304-aa82-4d50-91e6-66445ab56db4"
                        },
                        "id":"5fb7027d-a2ac-4a21-9ee1-438c281d2b26",
                        "name":"internal"
                     }
                  }
               ]
            }
         },
         "restore_type":"selective",
         "type":"openstack",
         "oneclickrestore":false
      },
      "metadata":[
         
      ]
   }
}
```

{% endtab %}
{% endtabs %}

### Body Format

The One-Click restore requires a body to provide all necessary information in json format.

```
{
   "restore":{
    "name":"<restore name>",
    "description":"<restore description>",
	  "options":{
         "openstack":{
            "instances":[
               {
                  "name":"<new name of instance>",
                  "include":<true/false>,
                  "id":"<original id of instance to be restored>"
				  "availability_zone":"<availability zone>",
				  "vdisks":[
                     {
                        "id":"<original ID of Volume>",
                        "new_volume_type":"<new volume type>",
                        "availability_zone":"<Volume availability zone>"
                     }
                  ],
                  "nics":[
                     {
                         'mac_address':'<mac address of the pre-created port>',
                         'ip_address':'<IP of the pre-created port>',
                         'id':'<ID of the pre-created port>',
                         'network':{
                            'subnet':{
                               'id':'<ID of the subnet of the pre-created port>'
                            },
                         'id':'<ID of the network of the pre-created port>'
                      }
                  ],
                  "flavor":{
                     "vcpus":<Integer>,
                     "disk":<Integer>,
                     "swap":<Integer>,
                     "ram":<Integer>,
                     "ephemeral":<Integer>,
                     "id":<Integer>
                  }
               }
            ],
            "restore_topology":<true/false>,
            "networks_mapping":{
               "networks":[
                  {
                     "snapshot_network":{
                        "subnet":{
                           "id":"<ID of the original Subnet ID>"
                        },
                        "id":"<ID of the original Network ID>"
                     },
                     "target_network":{
                        "subnet":{
                           "id":"<ID of the target Subnet ID>"
                        },
                        "id":"<ID of the target Network ID>",
                        "name":"<name of the target network>"
                     }
                  }
               ]
            }
         },
         "restore_type":"selective",
         "type":"openstack",
         "oneclickrestore":false
      }
   }
}
```

## Inplace Restore

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

Starts a restore according to the provided information

#### Path Parameters

| Name         | Type   | Description                                   |
| ------------ | ------ | --------------------------------------------- |
| tvm\_address | string | IP or FQDN of Trilio service                  |
| tenant\_id   | string | ID of the Tenant/Project to do the restore in |
| snapshot\_id | string | ID of the snapshot to restore                 |

#### Headers

| Name              | Type   | Description                     |
| ----------------- | ------ | ------------------------------- |
| X-Auth-Project-Id | string | Project to authenticate 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="202 Restore request accepted and started. Returns information about started Restore." %}

```
HTTP/1.1 202 Accepted
Server: nginx/1.16.1
Date: Mon, 09 Nov 2020 12:53:03 GMT
Content-Type: application/json
Content-Length: 1341
Connection: keep-alive
X-Compute-Request-Id: req-311fa97e-0fd7-41ed-873b-482c149ee743

{
   "restore":{
      "id":"0bf96f46-b27b-425c-a10f-a861cc18b82a",
      "created_at":"2020-11-09T12:53:02.726757",
      "updated_at":"2020-11-09T12:53:02.726757",
      "finished_at":null,
      "user_id":"ccddc7e7a015487fa02920f4d4979779",
      "project_id":"c76b3355a164498aa95ddbc960adc238",
      "status":"restoring",
      "restore_type":"restore",
      "snapshot_id":"ed4f29e8-7544-4e1c-af8a-a76031211926",
      "links":[
         {
            "rel":"self",
            "href":"http://wlm_backend/v1/c76b3355a164498aa95ddbc960adc238/restores/0bf96f46-b27b-425c-a10f-a861cc18b82a"
         },
         {
            "rel":"bookmark",
            "href":"http://wlm_backend/c76b3355a164498aa95ddbc960adc238/restores/0bf96f46-b27b-425c-a10f-a861cc18b82a"
         }
      ],
      "name":"API",
      "description":"API description",
      "host":"",
      "size":0,
      "uploaded_size":0,
      "progress_percent":0,
      "progress_msg":null,
      "warning_msg":null,
      "error_msg":null,
      "time_taken":0,
      "restore_options":{
         "restore_type":"inplace",
         "type":"openstack",
         "oneclickrestore":false,
         "openstack":{
            "instances":[
               {
                  "restore_boot_disk":true,
                  "include":true,
                  "id":"7c1bb5d2-aa5a-44f7-abcd-2d76b819b4c8",
                  "vdisks":[
                     {
                        "restore_cinder_volume":true,
                        "id":"f6b3fef6-4b0e-487e-84b5-47a14da716ca"
                     }
                  ]
               },
               {
                  "restore_boot_disk":true,
                  "include":true,
                  "id":"08dab61c-6efd-44d3-a9ed-8e789d338c1b",
                  "vdisks":[
                     {
                        "restore_cinder_volume":true,
                        "id":"53204f34-019d-4ba8-ada1-e6ab7b8e5b43"
                     }
                  ]
               }
            ]
         }
      },
      "metadata":[
         
      ]
   }
}
```

{% endtab %}
{% endtabs %}

### Body Format

The One-Click restore requires a body to provide all necessary information in json format.

```
{
   "restore":{
      "name":"<restore-name>",
      "description":"<restore-description>",
      "options":{
         "restore_type":"inplace",
         "type":"openstack",
         "oneclickrestore":false,
         "openstack":{
            "instances":[
               {
                  "restore_boot_disk":<Boolean>,
                  "include":<Boolean>,
                  "id":"<ID of the instance the volumes are attached to>",
                  "vdisks":[
                     {
                        "restore_cinder_volume":<boolean>,
                        "id":"<ID of the Volume to restore>"
                     }
                  ]
               }
            ]
         }
      }
   }
}
```


---

# 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/tvo-4.2/api-guide/restores.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.
