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

Get Collection of Azure SQL Backup Policies

You can get all Azure SQL 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/sql endpoint.

HTTP Request

GET https://<hostname>/api/v3/policies/sql

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.

DatabaseId

string($uuid)

Returns only backup policies that protect an Azure SQL database 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/sql collection. The PolicySQLV3 schema is used for the collection representation.

Get Collection of Azure SQL Backup PoliciesExample

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

Request:

GET https://51.11.247.127/api/v3/policies/sql

 

Request Header:

Authorization: Bearer <Access-Token>

 

Response:

200

 

Response Body:

{

 "offset": 0,

 "limit": 200,

 "totalCount": 14,

 "results": [

   {

     "id": "8cd8d65f-e774-4a3d-a87a-f77f5d2d445b",

     "priority": 1,

     "excludedItemsCount": 0,

     "tenantId": "97438793-c913-4a51-8485-d33056db7b9b",

     "serviceAccountId": "0655c811-1141d-43ce-a84e-aff90c48d40d",

     "usn": 26848,

     "backupStatus": "Success",

     "nextExecutionTime": "2021-09-13T20:00:00Z",

     "_links": {

       "self": {

         "href": "https://51.11.247.127/api/v3/policies/sql/8cd8d89f-e774-4a3d-a87a-f77f5d2d432b"

       }

     },

     "name": "permissionsAbuse",

     "description": "",

     "retrySettings": {

       "retryCount": 3

     },

     "policyNotificationSettings": {

       "recipient": "tomas.anders@gmail.com",

       "notifyOnSuccess": false,

       "notifyOnWarning": false,

       "notifyOnFailure": false

     },

     "isEnabled": true,

     "backupType": "SelectedItems",

     "dailySchedule": {

       "dailyType": "SelectedDays",

       "selectedDays": [

         "Monday"

       ],

       "backupSchedule": {

         "hours": [

           22

         ],

         "retention": {

           "timeRetentionDuration": 14,

           "retentionDurationType": "Days"

         },

         "targetRepositoryId": "2"

       }

     }

   },

   {

     "id": "b212b5d3-73b6-4fbe-b56c-34f3bea2d83c",

     "priority": 2,

     "excludedItemsCount": 0,

     "tenantId": "97438793-c913-4a51-8485-d33056db7b9b",

     "serviceAccountId": "0245c811-101d-43ce-a84e-aff90c48d40d",

     "usn": 26844,

     "backupStatus": "Error",

     "nextExecutionTime": "2021-09-07T20:00:00Z",

     "_links": {

       "self": {

         "href": "https://51.11.247.127/api/v3/policies/sql/b218b5d3-73b6-4fbe-b29c-34f3bea2d83c"

       }

     },

     "name": "Azure SQL policy",

     "description": "a",

     "retrySettings": {

       "retryCount": 3

     },

     "policyNotificationSettings": {

       "recipient": "tomas.anders@gmail.com",

       "notifyOnSuccess": false,

       "notifyOnWarning": false,

       "notifyOnFailure": false

     },

     "isEnabled": true,

     "backupType": "SelectedItems",

     "dailySchedule": {

       "dailyType": "Everyday",

       "backupSchedule": {

         "hours": [

           22

         ],

         "retention": {

           "timeRetentionDuration": 14,

           "retentionDurationType": "Days"

         },

         "targetRepositoryId": "2"

       }

     }

   },

 ],

 "_links": {

   "self": {

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

   }

 }

}