Get Collection of Virtual Machines

You can get a list of all Azure VMs that can be protected by Veeam Backup for Microsoft Azure.

Request

To retrieve a representation of a collection of protected Azure VMs, send the HTTP GET request to the /virtualMachines endpoint.

HTTP Request

GET https://<hostname>/api/v2/virtualMachines

Query Parameters

To control the amount and order of data in the response, you can use Offset, Limit, SearchPattern and the following query parameters:

Query Parameter

Value

Description

SubscriptionId

string($uuid)

Returns only Azure VMs that belong to the specified subscription. For more information, see Filter Parameters.

ResourceGroupId

string

Returns only Azure VMs that belong to the specified resource group. For more information, see Filter Parameters.

TenantId

string

Returns only Azure VMs that belong to the specified tenant. For more information, see Filter Parameters.

RegionIds

array[string]

Returns only Azure VMs that reside in the specified Azure regions. For more information, see Filter Parameters.

ProtectionStatus

  • Protected
  • Unprotected

Returns only Azure VMs with the specified protection status. For more information, see Filter Parameters.

BuckupDestination

  • Snapshot
  • AzureBlob
  • ManualSnapshot

Returns only Azure VMs with the specified backup destination. For more information, see Filter Parameters.

Sync

boolean

Defines whether Veeam Backup for Microsoft Azure database is synchronized with the Azure resources.

ExistsState

  • OnlyExists
  • OnlyDeleted
  • All

Returns only Azure VMs with the specified state. For more information, see Filter Parameters.

VmFromProtectedRegions

boolean

Defines whether an Azure VM resides in the protected region.

Request Headers

The request contains the following headers.

Header

Required

Value

Description

Authorization

Required

Bearer <Access-Token>

Authenticates a client who sends the request to the server. Must contain the access token for the current logon session in the Bearer <Access-Token> format.

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 HTTP headers.

Header

Value

Description

Content-length

integer

Identifies the length of the response body message, in bytes.

Content-type

  • application/json
  • application/problem+json

Identifies the media type of the response body message.

Response Body

In the response body, Veeam Backup for Microsoft Azure returns a representation of the /virtualMachines collection. The VirtualMachineV2 schema is used for the collection representation.

Get Collection of Virtual MachinesExample

The following request returns a full list of Azure VMs that can be protected.

Request:

GET https://51.11.247.127/api/v2/virtualMachines

 

Request Header:

Authorization: Bearer <Access-Token>

 

Response:

200

 

Response Body:

{

 "offset": 0,

 "limit": 2,

 "totalCount": 73,

 "results": [

   {

     "id": "b45yr8nr5zj684pdjoejkmadcrezdjp8esz63tc6iqd9eq6rfcby",

     "azureId": "/subscriptions/3a9a4930-7bbc-4b83-9c68-15d674fbc803/resourcegroups/cpm-backup-martin/providers/microsoft.compute/virtualmachines/000000000000000y",

     "name": "000000000000000y",

     "azureEnvironment": "Global",

     "osType": "Linux",

     "regionName": "ukwest",

     "totalSizeInGB": 30,

     "vmSize": "Standard_B1ls",

     "virtualNetwork": "cpmbackupmartinvnet218",

     "subnet": "default",

     "privateIP": "10.2.20.4",

     "hasEphemeralOsDisk": false,

     "isController": false,

     "isDeleted": false,

     "_links": {

       "subscription": {

         "href": "https://51.11.247.127/api/v2/cloudInfrastructure/subscriptions/3a9a4930-7bbc-4b83-9c68-15d674fbc803"

       },

       "resourcegroup": {

         "href": "https://51.11.247.127/api/v2/cloudInfrastructure/resourceGroups/e4znpesnkxs8gzmbw76gkm8crze3dx1anjqc5g8a6t5joikkjfbo"

       },

       "policies": {

         "href": "https://51.11.247.127/api/v2/policies?virtualMachineId=b45yr8nr5zj684pdjoejkmadcrezdjp8esz63tc6iqd9eq6rfcby"

       },

       "restorepoints": {

         "href": "https://51.11.247.127/api/v2/restorePoints?virtualMachineId=b45yr8nr5zj684pdjoejkmadcrezdjp8esz63tc6iqd9eq6rfcby&onlyLatest=False"

       },

       "self": {

         "href": "https://51.11.247.127/api/v2/virtualMachines/b45yr8nr5zj684pdjoejkmadcrezdjp8esz63tc6iqd9eq6rfcby"

       }

     }

   },

   {

     "id": "c8jw1hbbe3qcadtqf4a417mpcu8wz16mmgjwxacpmkpy448mqugo",

     "azureId": "/subscriptions/1142bdc7-8797-42bc-aa23-9f1fc1411946/resourcegroups/tc-integrationtests-infrastructure/providers/microsoft.compute/virtualmachines/05d3d8c1-b0d2-4029-8a7b-ecfc4c23b840",

     "name": "05d3d8c1-b0d2-4029-8a7b-ecfc4c23b840",

     "azureEnvironment": "Global",

     "osType": "Linux",

     "regionName": "eastasia",

     "totalSizeInGB": 32,

     "vmSize": "Standard_B1s",

     "virtualNetwork": "3d51edc4-f385-4903-b6e1-5e54b636666e",

     "subnet": "subnet1",

     "publicIP": "13.70.22.233",

     "privateIP": "10.4.15.4",

     "hasEphemeralOsDisk": false,

     "isController": false,

     "isDeleted": false,

     "_links": {

       "subscription": {

         "href": "https://51.11.247.127/api/v2/cloudInfrastructure/subscriptions/1142bdc7-8797-42bc-aa23-9f1fc1411946"

       },

       "resourcegroup": {

         "href": "https://51.11.247.127/api/v2/cloudInfrastructure/resourceGroups/xzyp43ypge9r7bu8m81cijpga8p4xk3fnjj6bkiqyfceuk5tkx8y"

       },

       "policies": {

         "href": "https://51.11.247.127/api/v2/policies?virtualMachineId=c8jw1hbbe3qcadtqf4a417mpcu8wz16mmgjwxacpmkpy448mqugo"

       },

       "restorepoints": {

         "href": "https://51.11.247.127/api/v2/restorePoints?virtualMachineId=c8jw1hbbe3qcadtqf4a417mpcu8wz16mmgjwxacpmkpy448mqugo&onlyLatest=False"

       },

       "self": {

         "href": "https://51.11.247.127/api/v2/virtualMachines/c8jw1hbbe3qcadtqf4a417mpcu8wz16mmgjwxacpmkpy448mqugo"

       }

     }

   }

 ],

 "_links": {

   "self": {

     "href": "https://51.11.247.127api/v2/virtualMachines?offset=0&limit=2"

   },

   "next": {

     "href": "https://51.11.247.127/api/v2/virtualMachines?offset=2&limit=2"

   }

 }

}

I want to report a typo

There is a misspelling right here:

 

I want to let the Veeam Documentation Team know about that.