Get Collection of Backup Policies

You can get all backup policies created in Veeam Backup for Microsoft Azure.

Request

To retrieve a representation of a collection of backup policies, send the HTTP GET request to the /policies endpoint.

HTTP Request

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

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

PolicyName

string

Returns only the specified backup policies.

VirtualMachineId

string($uuid)

Returns only backup policies that protect an Azure VM with the specified ID. For more information, see Filter Parameters.

LastJobStatus

  • Canceled
  • Canceling
  • Error
  • NeverExecuted
  • Pending
  • Running
  • RunningWithError
  • RunningWithWarning
  • Success
  • Warning

Returns only backup policies with the specified most recent backup session status. For more information, see Filter Parameters.

PolicyStatus

  • Enabled
  • Disabled

Returns only enabled or disabled backup policies. For more information, see Filter Parameters.

RepositoryId

string($uuid)

Returns only backup policies with a backup repository the specified ID. For more information, see Filter Parameters.

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 /policies collection. The PolicyV2 schema is used for the collection representation.

Get Collection of Backup PoliciesExample

The following request returns a full list of backup policies created in Veeam Backup for Microsoft Azure.

Request:

GET https://51.11.247.127/api/v2/policies

 

Request Header:

Authorization: Bearer <Access-Token>

 

Response:

200

 

Response Body:

{

 "offset": 0,

 "limit": 200,

 "totalCount": 2,

 "results": [

   {

     "id": "a1c3b4cb-29d4-4615-b4d8-d1e1b7f3bf55",

     "priority": 1,

     "excludedItemsCount": 0,

     "snapshotStatus": "Success",

     "backupStatus": "Error",

     "nextExecutionTime": "2020-11-24T10:00:00Z",

     "isBackupConfigured": true,

     "isScheduleConfigured": true,

     "_links": {

       "self": {

         "href": "https://51.11.247.127/api/v2/policies/a1c3b4cb-29d4-4615-b4d8-d1e1b7f3bf55"

       },

       "selecteditems": {

         "href": "https://51.11.247.127/api/v2/policies/a1c3b4cb-29d4-4615-b4d8-d1e1b7f3bf55/selectedItems"

       },

       "excludeditems": {

         "href": "https://51.11.247.127/api/v2/policies/a1c3b4cb-29d4-4615-b4d8-d1e1b7f3bf55/excludedItems"

       },

       "dailyschedulerepository": {

         "href": "https://51.11.247.127/api/v2/repositories/1"

       }

     },

     "name": "Backup Policy",

     "description": "Created by administrator",

     "tenantId": "3e924ba9-93bc-40d5-8a47-33f07b239a52",

     "retrySettings": {

       "retryCount": 3

     },

     "policyNotificationSettings": {

       "recipient": "admin@tech.com",

       "notifyOnSuccess": true,

       "notifyOnWarning": true,

       "notifyOnFailure": true

     },

     "isEnabled": true,

     "backupType": "AllSubscriptions",

     "snapshotSettings": {

       "additionalTags": [],

       "copyOriginalTags": false,

       "applicationAwareSnapshot": false,

       "userScripts": {

         "windows": {

           "scriptsEnabled": false,

           "repositorySnapshotsOnly": false,

           "ignoreExitCodes": false,

           "ignoreMissingScripts": false

         },

         "linux": {

           "scriptsEnabled": false,

           "repositorySnapshotsOnly": false,

           "ignoreExitCodes": false,

           "ignoreMissingScripts": false

         }

       }

     },

     "dailySchedule": {

       "dailyType": "Everyday",

       "runsPerHour": 1,

       "snapshotSchedule": {

         "hours": [

           0,

           1,

           2,

           3,

           4,

           5,

           6,

           7,

           8,

           9,

           10,

           11,

           12,

           13,

           14,

           15,

           16,

           17,

           18,

           19,

           20,

           21,

           22,

           23

         ],

         "snapshotsToKeep": 24

       },

       "backupSchedule": {

         "hours": [

           22

         ],

         "retention": {

           "timeRetentionDuration": 14,

           "retentionDurationType": "Days"

         },

         "targetRepositoryId": "1"

       }

     }

   },

   {

     "id": "4913c56e-85b9-4d8e-b424-15ce7a1a4ac9",

     "priority": 2,

     "excludedItemsCount": 0,

     "usn": 1197,

     "snapshotStatus": "Warning",

     "backupStatus": "Warning",

     "nextExecutionTime": "2020-11-24T10:00:00Z",

     "isBackupConfigured": true,

     "isScheduleConfigured": true,

     "_links": {

       "self": {

         "href": "https://51.11.247.127/api/v2/policies/4913c56e-85b9-4d8e-b424-15ce7a1a4ac9"

       },

       "selecteditems": {

         "href": "https://51.11.247.127/api/v2/policies/4913c56e-85b9-4d8e-b424-15ce7a1a4ac9/selectedItems"

       },

       "excludeditems": {

         "href": "https://51.11.247.127/api/v2/policies/4913c56e-85b9-4d8e-b424-15ce7a1a4ac9/excludedItems"

       },

       "dailyschedulerepository": {

         "href": "https://51.11.247.127/api/v2/repositories/4"

       }

     },

     "name": "new",

     "description": "Created by Default Admin",

     "tenantId": "3e924ba9-93bc-40d5-8a47-33f07b239a52",

     "retrySettings": {

       "retryCount": 3

     },

     "policyNotificationSettings": {

       "recipient": "admin@tech.com",

       "notifyOnSuccess": true,

       "notifyOnWarning": true,

       "notifyOnFailure": true

     },

     "isEnabled": true,

     "backupType": "AllSubscriptions",

     "snapshotSettings": {

       "additionalTags": [],

       "copyOriginalTags": false,

       "applicationAwareSnapshot": false,

       "userScripts": {

         "windows": {

           "scriptsEnabled": false,

           "repositorySnapshotsOnly": false,

           "ignoreExitCodes": false,

           "ignoreMissingScripts": false

         },

         "linux": {

           "scriptsEnabled": false,

           "repositorySnapshotsOnly": false,

           "ignoreExitCodes": false,

           "ignoreMissingScripts": false

         }

       }

     },

     "dailySchedule": {

       "dailyType": "Everyday",

       "runsPerHour": 1,

       "snapshotSchedule": {

         "hours": [

           0,

           1,

           2,

           3,

           4,

           5,

           6,

           7,

           8,

           9,

           10,

           11,

           12,

           13,

           14,

           15,

           16,

           17,

           18,

           19,

           20,

           21,

           22,

           23

         ],

         "snapshotsToKeep": 24

       },

       "backupSchedule": {

         "hours": [

           22

         ],

         "retention": {

           "timeRetentionDuration": 14,

           "retentionDurationType": "Days"

         },

         "targetRepositoryId": "4"

       }

     }

   }

 ],

 "_links": {

   "self": {

     "href": "https://51.11.247.127/api/v2/policies?offset=0&limit=200"

   }

 }

}

I want to report a typo

There is a misspelling right here:

 

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