Restoring Azure Virtual Machines
This section explains how to restore a VM.
Request
POST https://<hostname>/api/v1/restorePoints/{restorePointId}/restoreVm/{vmId} |
Request Headers
The request header must contain an authorization token of the current session.
Request Parameters
The following parameters must be posted as URL.
Parameter | Description |
restorePointId | The identification number of the restore point. Can be obtained as described in Getting Restore Points. |
vmId | The identification number of the virtual machine. Can be obtained as described in Getting Virtual Machines. |
Request Body
Parameter | Type | Description |
reason | string | Sets the reason of the restore. |
toAlternative | Contains the VirtualMachineToAlternativeRestoreOptions object. |
VirtualMachineToAlternativeRestoreOptions Object
Parameter | Type | Description |
name | string | Sets the name of the VM. |
subscription | AzureSubscription Object | Sets the AzureSubscription object. For more information about properties of this object, see Getting Subscriptions. |
resourceGroup | ResourceGroup Object | Sets the ResourceGroup object. For more information about properties of this object, see Getting Resource Groups. |
region | Region Object | Sets the Region object. For more information about properties of this object, see Getting Regions. |
vmSize | VmSize Object | Sets the VmSize object. For more information about properties of this object, see Getting Virtual Machine Sizes. |
virtualNetwork | VirtualNetwork Object | Sets the VirtualNetwork object. For more information about properties of this object, see Getting Virtual Networks. |
subnet | string | Sets the subnet. |
networkSecurityGroup | NetworkSecurityGroup Object | Sets the NetworkSecurityGroup object. For more information about properties of this object, see Getting Network Security Groups. |
diskType | string | Sets the disk type. |
osDisk | DiskRestoreOptionsBase Object | Sets the OS disks object which consists of the following:
|
dataDisks | DiskRestoreOptionsBase Object | Sets the OS disks object which consists of the following:
|
Request Example
Request: POST https://<hostname>/api/v1/restorePoints/8cf8d0ee-73fd-4a4e-833e-68e2c5b2bda5/restoreVm?vmId=oqedma7doo56krcqzp15xbdffenfpgcjzxpekgqnmw6dx65rnyxo
Request Header: Authorization: Bearer <Access-Token>
Request Body: { "reason":"", "toAlternative":{ "name":"abc", "subscription":{ "id":"3a9a4330-7bac-4b83-9c68-15d674fbc801", "environment":"Global", "tenantId":"3e224ba9-93bc-40d5-8a47-33f07b139d52", "name":"Visual Studio Premium MSDN", "status":"Active" }, "resourceGroup":{ "id":"1yb941zuh6ze8bmfsnqcwot7i8wi8p5ufy34nc7mxiaq5z6mmc6y", "resourceId":"/subscriptions/3a9a4330-7bac-4b83-9c68-15d674fbc801/resourcegroups/abc", "name":"abc", "azureEnvironment":"Global", "subscriptionId":"3a9a4330-7bac-4b83-9c68-15d674fbc801", "regionId":"ukwest" }, "region":{ "id":"ukwest", "name":"UK West" }, "vmSize":{ "name":"Standard_DS3_v2", "subscriptionId":"3a9a4330-7bac-4b83-9c68-15d674fbc801", "maxDataDiskCount":16, "memoryInMB":14336, "numberOfCores":4, "osDiskSizeInMB":1047552, "resourceDiskSizeInMB":28672, "pricePerHour":{ "value":0.351, "currency":"USD" }, "_links":{ "subscription":{ "href":"https://blueghost.ukwest.cloudapp.azure.com/api/v1/cloudInfrastructure/subscriptions/3a9a4330-7bac-4b83-9c68-15d674fbc801" } } }, "virtualNetwork":{ "id":"/subscriptions/3a9a4330-7bac-4b83-9c68-15d674fbc801/resourceGroups/abc/providers/Microsoft.Network/virtualNetworks/abc-Network", "name":"abc-Network", "regionName":"ukwest", "_links":{
} }, "subnet":{ "name":"abc-Subnet" }, "networkSecurityGroup":{ "id":"/subscriptions/3a9a4330-7bac-4b83-9c68-15d674fbc801/resourcegroups/abc/providers/microsoft.network/networksecuritygroups/abc-nsg", "name":"abc-nsg", "regionId":"ukwest", "resourceGroupName":"abc" }, "diskType":"Managed", "osDisk":{ "diskId":"zut5o4j5dmxxgxp7p9sczta6b1n6837dmwkheu41qg8enrizbjfo", "name":"abc_disk1_813f0657e5fa4661aaceb53564eba021", "resourceGroup":{ "id":"1yb941zuh6ze8bmfsnqcwot7i8wi8p5ufy34nc7mxiaq5z6mmc6y", "resourceId":"/subscriptions/3a9a4330-7bac-4b83-9c68-15d674fbc801/resourcegroups/abc", "name":"abc", "azureEnvironment":"Global", "subscriptionId":"3a9a4330-7bac-4b83-9c68-15d674fbc801", "regionId":"ukwest" } }, "dataDisks":[
] } } |
Response
The server returns the following response to the client.
Response Codes
A successfully completed operation returns a response code 200 (OK).
Response Headers
The response to this request contains the following headers. The response may also include additional standard HTTPS headers.
Header | Description |
Content-length | The length of the response body. |
Content-type | The media type and syntax of the response body message: application/json; charset=utf-8 |
Response Body
None.
Example
Request Header: Authorization: Bearer <Access-Token>
Response: 200 OK |