This is an archive version of the document. To get the most up-to-date information, see the current version.

Get Collection of EC2 Instances

You can get a list of all EC2 instances that can be protected by Veeam Backup for AWS.

Request

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

HTTP Request

GET https://<hostname>:<port>/api/v1/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

Sort

  • nameAsc
  • nameDesc
  • locationAsc
  • locationDesc

Specifies the order of items in the response. For more information, see Sort Parameter.

ProtectionStatus

  • Protected
  • Unprotected

Returns only EC2 instances with the specified protection status. For more information, see Filter Parameters.

BuckupDestination

  • Snapshot
  • AwsBlob
  • ManualSnapshot

Returns only EC2 instances with the specified backup destination. For more information, see Filter Parameters.

BackupState

  • OnlyBackedUp
  • OnlyNotBackedUp
  • All

Returns only EC2 instances with the specified backup state. For more information, see Filter Parameters.

Request Headers

The request contains the following headers.

Header

Required/Optional

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.

x-api-version

Required

1.0-rev0

Specifies the current revision of the Veeam Backup for AWS REST API.

Accept

Optional

  • application/json
  • application/problem+json

Specifies a media type of representation that is required in the response message. If the requested type is not supported, the server will return the response in the application/json media type.

Response

The server returns the following response to the client.

Response Code

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 AWS returns a representation of the /virtualMachines collection. The VirtualMachine schema is used for the collection representation.

Get Collection of Sessions_18Example

The following request returns a full list of EC2 instances that can be protected.

Request:

GET https://135.169.170.192:11005/api/v1/virtualMachines

 

Request Header:

Authorization: Bearer <Access-Token>

x-api-version: 1.0-rev0

 

Response:

200

 

Response Body:

{

 "results": [

   {

     "protectionStatus": "Unprotected",

     "id": "b0f0a520-dc84-4d3a-8362-fe6ca283c61d",

     "name": "srv45",

     "awsResourceId": "i-0535babba744ebdcb",

     "backupDestinations": [ManualSnapshot],

     "isDeleted": false,

     "_links": [

       {

         "method": "GET",

         "rel": "self",

         "href": "https://135.169.170.192:11005/api/v1/virtualMachines/b0f0a520-dc84-4d3a-8362-fe6ca283c61d"

       },

       {

         "method": "POST",

         "rel": "TakeSnapshot",

         "href": "https://135.169.170.192:11005/api/v1/virtualMachines/b0f0a520-dc84-4d3a-8362-fe6ca283c61d/takeSnapshot"

       }

     ]

   },

   {

     "protectionStatus": "Protected",

     "id": "4939b640-40ec-4cba-b5a9-684c3d230d80",

     "name": "win2045",

     "awsResourceId": "i-0dca9e0d25b1997c6",

     "backupDestinations": [Snapshot],

     "isDeleted": false,

     "_links": [

       {

         "method": "GET",

         "rel": "self",

         "href": "https://135.169.170.192:11005/api/v1/virtualMachines/4939b640-40ec-4cba-b5a9-684c3d230d80"

       },

       {

         "method": "POST",

         "rel": "TakeSnapshot",

         "href": "https://135.169.170.192:11005/api/v1/virtualMachines/4939b640-40ec-4cba-b5a9-684c3d230d80/takeSnapshot"

       },

       {

         "method": "POST",

         "rel": "DeleteBackups",

         "href": "https://135.169.170.192:11005/api/v1/virtualMachines/4939b640-40ec-4cba-b5a9-684c3d230d80/deleteBackups"

       }

     ]

   },

   {

     "protectionStatus": "Protected",

     "id": "51ee4beb-7cbb-4208-86a8-09f89308bbe5",

     "name": "accDept01",

     "awsResourceId": "i-0f9ce735dbb4b7e97",

     "backupDestinations": [AwsBlob],

     "isDeleted": false,

     "_links": [

       {

         "method": "GET",

         "rel": "self",

         "href": "https://135.169.170.192:11005/api/v1/virtualMachines/51ee4beb-7cbb-4208-86a8-09f89308bbe5"

       },

       {

         "method": "POST",

         "rel": "TakeSnapshot",

         "href": "https://135.169.170.192:11005/api/v1/virtualMachines/51ee4beb-7cbb-4208-86a8-09f89308bbe5/takeSnapshot"

       },

       {

         "method": "POST",

         "rel": "DeleteSnapshots",

         "href": "https://135.169.170.192:11005/api/v1/virtualMachines/51ee4beb-7cbb-4208-86a8-09f89308bbe5/deleteSnapshots"

       }

     ]

   },

   {

     "protectionStatus": "Unprotected",

     "id": "407cc6cd-54cc-45e6-bfc1-1ae505bdf4c2",

     "name": "2008x86abor",

     "awsResourceId": "i-0fee2006a560be6aa",

     "backupDestinations": [ManualSnapshot],

     "isDeleted": false,

     "_links": [

       {

         "method": "GET",

         "rel": "self",

         "href": "https://135.169.170.192:11005/api/v1/virtualMachines/407cc6cd-54cc-45e6-bfc1-1ae505bdf4c2"

       },

       {

         "method": "POST",

         "rel": "TakeSnapshot",

         "href": "https://135.169.170.192:11005/api/v1/virtualMachines/407cc6cd-54cc-45e6-bfc1-1ae505bdf4c2/takeSnapshot"

       }

     ]

   }

 ],

 "totalCount": 4,

 "_links": [

   {

     "method": "GET",

     "rel": "self",

     "href": "https://135.169.170.192:11005/api/v1/virtualMachines"

   }

 ]

}