Editing Backup Policy by Backup Policy ID
This section explains how to edit the settings of the specified backup policy.
Request
PUT https://<hostname>/api/v1/policies/{policyId} |
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 |
policyId | The identification numbers of the backup policy. Can be obtained as described in Getting Backup Policies. |
Request Body
Property | Type | Description |
name | string | Sets the name of the backup policy. |
description | string | Sets the description of the backup policy. |
isEnabled | boolean | Defines if the backup policy must be enabled upon creation. |
priority | integer | Sets the priority for the backup policy. |
tenantId | string | Sets the tenant identification number. |
backupType | string | Sets the backup type. |
regions | string | Sets the regions in which to look up resources. |
selectedItems | string | Sets the selected items. Possible types:
|
excludedItems | string | Sets the selected items. |
snapshotSettings | Sets the PolicySnapshotSettingsFromClient object. | |
backupSettings | Sets the PolicyBackupSettingsFromClient object. | |
retrySettings | Sets the RetrySettings object. | |
policyNotificationSettings | Sets the PolicyNotificationSettings object. |
PolicySnapshotSettingsFromClient Object
Property | Type | Description |
|---|---|---|
generationsToSave | integer | Sets the number of snapshots to be saved by the backup policy. |
schedule | integer | Sets schedule parameters. |
PolicyBackupSettingsFromClient Object
Property | Type | Description |
|---|---|---|
targetRepositoryId | integer | Sets the identification number of the backup repository to which backups are going to be saved. |
retentionSettings | Sets the RepositoryRetentionSettings object. | |
schedule | string | Sets schedule parameters. |
Property | Type | Description |
|---|---|---|
retryCount | integer | Sets the retry attempts number. |
PolicyNotificationSettings Object
Property | Type | Description |
|---|---|---|
recipient | string | Sets the email address to which notifications about backup policy results muse be sent. |
notifyOnSuccess | boolean | Defines if a notification must be sent on Success. |
notifyOnWarning | boolean | Defines if a notification must be sent on Warning. |
notifyOnFailure | boolean | Defines if a notification must be sent on Failure. |
Request Example
Request: POST https://<hostname>/api/v1/policies/
Request Header: Authorization: Bearer <Access-Token>
Request Body: { "name":"Backup Policy via REST", "description":"", "isEnabled":true, "priority":0, "tenantId":"3e924ba9-93bc-40d5-8a47-33f07b239a52", "backupType":"SelectedItems", "regions":[ { "regionId":"northeurope" }, { "regionId":"ukwest" }, { "regionId":"westeurope" } ], "selectedItems":{ "subscriptions":[
], "resourceGroups":[
], "tags":[
], "virtualMachines":[ { "id":"ej43ifg58cgjs8e9cod74ye6cbwm5nttf6ijzk64rshqoip1abqy" }, { "id":"g344t5o8hgxgyp9r5bxqsn1aom88kjsc3hjnk3o8umzdptc3w3ey" } ] }, "excludedItems":{ "virtualMachines":[ { "id":"g344t5o8hgxgyp9r5bxqsn1aom88kjsc3hjnk3o8umzdptc3w3ey" } ] }, "snapshotSettings":{ "generationsToSave":7, "schedule":{ "frequencyType":"Monthly", "monthlyTime":"20:00:00", "monthlyType":"First", "monthlyDayOfWeek":"Monday", "monthlyLastDay":false, "monthlyDay":1, "selectedMonths":[ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ] } }, "backupSettings":{ "targetRepositoryId":1, "retentionSettings":{ "retentionDurationType":"Daily", "timeRetentionDuration":21 }, "schedule":{ "frequencyType":"Monthly", "monthlyTime":"20:00:00", "monthlyType":"First", "monthlyDayOfWeek":"Monday", "monthlyLastDay":false, "monthlyDay":1, "selectedMonths":[ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ] } }, "retrySettings":{ "retryCount":3 }, "policyNotificationSettings":{ "recipient":"@tech.local", "notifyOnSuccess":true, "notifyOnWarning":true, "notifyOnFailure":true } } |
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: EDIT https://<hostname>/api/v1/policies/d4ec0e97-8ce4-455c-a699-c1b3635886ae
Request Header: Authorization: Bearer <Access-Token>
Response: 200 OK |