PUT /cdpPolicies/{ID}

Edits a CDP policy having the specified ID.

Request

To edit a CDP policy, send the PUT HTTP request to the /cdpPolicies/{ID} URL.

HTTP Request

PUT https://<Enterprise-Manager>:9398/api/cdpPolicies/{ID}

Request Headers

The request contains the following headers:

Header

Required

Description

X-RestSvcSessionId

True

The request requires authorization. In the header, the client must send a session ID copied from the server reply to the request creating a new logon session. For details, see Authentication and Security.

Content-Type

True

Identifies the format of the request body message. Possible values:

  • application/xml
  • application/json

Accept

False

Identifies the format of the response. Possible values:

  • application/xml — the client can send this value in the header to accept response in the XML format.
  • application/json — the client must send this value in the header to accept the request in the JSON format.

If the request does not contain the header, the server will return the response in the XML format.

Request Body

In the request body, the client must send the parameters for the edited CDP policy. The body of the request must conform to the XML Schema Definitionem_rest_ of Veeam Backup Enterprise Manager REST API.

Note

In the request body, you can send all resource properties or only those properties that you want to edit.

The request body must contain the elements you want to edit. You can define the following general parameters for the CDP policy:

Element

Type

Description

Modifiable

Min/Max Occurrence

Description

String

Description provided for the CDP policy.

Yes

0/1

ScheduleConfigured

Boolean

Defines whether scheduling options are configured for the CDP policy.

Yes

0/1

ScheduleEnabled

Boolean

Defines whether scheduling options are enabled for the CDP policy. If you set this option to True, you need to specify the PolicyScheduleOptions element.

Yes

0/1

NextRun

DateTime

Date and time of the next CDP policy run. The parameter accepts only UTC-formatted DateTime values.

Yes

0/1

PolicyScheduleOptions

PolicyScheduleOptions
Type

Defines scheduling options for the CDP policy. For details, see CDP Policy Scheduling Options.

Yes

0/1

For example:

XML Representation

<?xml version="1.0" encoding="utf-8"?>
<CdpPolicy xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Href="https://localhost:9398/api/cdpPolicies/145f3365-6ec0-44e9-9538-8c8c34ebdcce?format=Entity" Type="CdpPolicy" Name="CDP Policy 1" UID="urn:veeam:CdpPolicy:145f3365-6ec0-44e9-9538-8c8c34ebdcce" xmlns="http://www.veeam.com/ent/v1.0">
 <Description>Created by TECH\sheila.d.cory</Description>
 <ScheduleConfigured>true</ScheduleConfigured>
 <ScheduleEnabled>true</ScheduleEnabled>
</CdpPolicy>

JSON Representation

{

 "Href": "https://localhost:9398/api/cdpPolicies/145f3365-6ec0-44e9-9538-8c8c34ebdcce?format=Entity",

 "Type": "CdpPolicy",

 "Name": "CDP Policy 1",

 "UID": "urn:veeam:CdpPolicy:145f3365-6ec0-44e9-9538-8c8c34ebdcce",

 "xmlns": "http://www.veeam.com/ent/v1.0",

 "Description": "Created by TECH\\sheila.d.cory",

 "ScheduleConfigured": "true",

 "ScheduleEnabled": "true"

}

 

CDP Policy Scheduling Options

You can define the following scheduling options for the CDP policy:

Element

Type

Description

Modifiable

Min/Max Occurrence

RecoveryPointObjectiveSeconds

Int64

Recovery point objective in seconds.

Yes

0/1

RecoveryPointObjectiveMinutes

Int64

Recovery point objective in minutes.

Yes

0/1

RPOSchedule

RPOSchedule
Type

Time intervals that define when the CDP policy is allowed to create a replicated state of the source VMs. For details, see RPO Schedule Options.

Yes

0/1

RPOReporting

RPOReporting
Type

Defines RPO reporting settings. For details, see RPO Reporting Options.

Yes

0/1

ShortTermRetentionMinutes

Int64

Time period for which short-term restore points must be stored, in minutes.

 

 

ShortTermRetentionHours

Int64

Time period for which short-term restore points must be stored, in hours.

 

 

LongTermRetentionHours

Int64

Defines how often new long-term restore points must be created, in hours.

 

 

LongTermRetentionKeepDays

Int64

Defines for how long the long-term restore points must be retained, in days.

Yes

0/1

LongTermRetentionSchedule

LongTermRetentionSchedule
Type

Time intervals that define when the CDP policy must create application-consistent and when crash-consistent long-term restore points. For details, see Long-Term Retention Schedule Options.

Yes

0/1

 

RPO Schedule Options

RPO schedule options are provided in the following format:

XML Representation

<RPOSchedule Enabled="true">
 <TimePeriods>
   <Day Name="Sunday">1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1</Day>
   <Day Name="Monday">1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1</Day>
   <Day Name="Tuesday">1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1</Day>
   <Day Name="Wednesday">1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1</Day>
   <Day Name="Thursday">1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1</Day>
   <Day Name="Friday">1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1</Day>
   <Day Name="Saturday">1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1</Day>
 </TimePeriods>
</RPOSchedule>

JSON Representation

"RPOSchedule": {

 "Enabled": "true",

 "TimePeriods": {

   "Day": [

     {

       "Name": "Sunday",

       "#text": "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"

     },

     {

       "Name": "Monday",

       "#text": "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"

     },

     {

       "Name": "Tuesday",

       "#text": "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"

     },

     {

       "Name": "Wednesday",

       "#text": "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"

     },

     {

       "Name": "Thursday",

       "#text": "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"

     },

     {

       "Name": "Friday",

       "#text": "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"

     },

     {

       "Name": "Saturday",

       "#text": "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"

     }

   ]

 }

}

You can define the following RPO schedule options for the CDP policy:

Element

Type

Description

Modifiable

Min/Max Occurrence

Enabled

Boolean

Defines whether RPO schedule options are specified for the CDP policy.

Yes

1/1

TimePeriods

TimePeriods
Type

Defines an hourly scheme by which the CDP policy must run. The schedule scheme is constructed by the following pattern:

<Day Name ="Sunday"> 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1</Day>

where 1 means the CDP policy must run, 0 means the CDP policy must not run.

Yes

0/unbounded

RPO Reporting Options

RPO reporting options are provided in the following format:

XML Representation

<RPOReporting>
 <MarkAsWarning>
   <Enabled>true</Enabled>
   <RPOThresholdSeconds>2</RPOThresholdSeconds>
   <RPOThresholdMinutes>0</RPOThresholdMinutes>
 </MarkAsWarning>
 <MarkAsFailed>
   <Enabled>true</Enabled>
   <RPOThresholdSeconds>3</RPOThresholdSeconds>
   <RPOThresholdMinutes>0</RPOThresholdMinutes>
 </MarkAsFailed>
</RPOReporting>

JSON Representation

"RPOReporting": {

 "MarkAsWarning": {

   "Enabled": "true",

   "RPOThresholdSeconds": "2",

   "RPOThresholdMinutes": "0"

 },

 "MarkAsFailed": {

   "Enabled": "true",

   "RPOThresholdSeconds": "3",

   "RPOThresholdMinutes": "0"

 }

}

You can define the following RPO reporting options for the CDP policy:

Element

Type

Description

Modifiable

Min/Max Occurrence

Enabled

Boolean

Defines whether RPO reporting options are specified for the job.

Yes

MarkAsWarning

CDPReplicaRPOReporting
WarningOptionsType

Time interval in seconds or minutes before Veeam Backup & Replication sends a notification with a warning if a newly created restore point is not transferred to the target within the set RPO. For details, see Warning Settings.

Yes

0/1

MarkAsFailed

CDPReplicaRPOReporting
FailedOptionsType

Time interval in seconds or minutes before Veeam Backup & Replication sends a notification with an error if a newly created restore point is not transferred to the target within the set RPO. For details, see Error Settings.

Yes

0/1

Warning Settings:

Element

Type

Description

Modifiable

Min/Max Occurrence

Enabled

Boolean

Defines whether warning notifications are enabled.

Yes

RPOThresholdSeconds

Int

Time interval in seconds before Veeam Backup & Replication sends a notification with a warning if a newly created restore point is not transferred to the target within the set RPO.

Yes

0/1

RPOThresholdMinutes

Int

Time interval in minutes before Veeam Backup & Replication sends a notification with a warning if a newly created restore point is not transferred to the target within the set RPO.

Yes

0/1

Error Settings:

Element

Type

Description

Modifiable

Min/Max Occurrence

Enabled

Boolean

Defines whether error notifications are enabled.

Yes

RPOThresholdSeconds

Int

Time interval in seconds before Veeam Backup & Replication sends a notification with an error if a newly created restore point is not transferred to the target within the set RPO.

Yes

0/1

RPOThresholdMinutes

Int

Time interval in minutes before Veeam Backup & Replication sends a notification with an error if a newly created restore point is not transferred to the target within the set RPO.

Yes

0/1

Long-Term Retention Schedule Options

Long-term retention schedule options are provided in the following format:

XML Representation

<LongTermRetentionSchedule Enabled="true">
 <TimePeriods>
   <Day Name="Sunday">1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1</Day>
   <Day Name="Monday">2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</Day>
   <Day Name="Tuesday">2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</Day>
   <Day Name="Wednesday">2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</Day>
   <Day Name="Thursday">2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</Day>
   <Day Name="Friday">2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</Day>
   <Day Name="Saturday">1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1</Day>
 </TimePeriods>
</LongTermRetentionSchedule>

JSON Representation

"LongTermRetentionSchedule": {

 "Enabled": "true",

 "TimePeriods": {

   "Day": [

     {

       "Name": "Sunday",

       "#text": "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"

     },

     {

       "Name": "Monday",

       "#text": "2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2"

     },

     {

       "Name": "Tuesday",

       "#text": "2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2"

     },

     {

       "Name": "Wednesday",

       "#text": "2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2"

     },

     {

       "Name": "Thursday",

       "#text": "2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2"

     },

     {

       "Name": "Friday",

       "#text": "2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2"

     },

     {

       "Name": "Saturday",

       "#text": "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"

     }

   ]

 }

}

You can define the following periodic scheduling options for the CDP policy:

Element

Type

Description

Modifiable

Min/Max Occurrence

Enabled

Boolean

Defines whether long-term retention schedule options are specified for the job.

Yes

Schedule

TimePeriods
Type

Defines an hourly scheme when the CDP policy must create application-consistent and when crash-consistent long-term restore points. The scheduling scheme is constructed by the following pattern:

<Day Name ="Sunday"> 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1</Day>

where 1 means the CDP policy must create crash-consistent long-term restore points, 2 means the CDP policy must create application-consistent long-term restore points.

Yes

0/1

Response

The server returns the following response to the client.

Response Codes

A successfully completed operation returns response code 202 Accepted.

Response Headers

The response to this request contains the following headers. The response may also include additional standard HTTP headers.

Header

Description

Content-length

The length of the response body.

Content-type

The media type and syntax of the request body message. Possible values:

  • application/xml
  • application/json

Response Body

In the response body, Veeam Backup Enterprise Manager returns an ID of the task that has been created to perform the requested action, and the task state. You can check the operation results by sending the GET HTTP request to the URL of the task resource.

Additionally, Veeam Backup Enterprise Manager returns a link to the task deletion operation. You can send the DELETE HTTP request to the URL in the link to stop the task execution.

Example

The example below changes the number of retries to 5 for the job having ID 78c3919c-54d7-43fe-b047-485d3566f11f.

Request:

PUT https://localhost:9398/api/jobs/78c3919c-54d7-43fe-b047-485d3566f11f?action=edit

 

Request Headers:

X-RestSvcSessionId   NDRjZmJkYmUtNWE5NS00MTU2LTg4NjctOTFmMDY5YjdjMmNj
Content-Type         application/xml

 

Request Body:

<?xml version="1.0" encoding="utf-8"?>
<Job Type="Job" Href="https://localhost:9398/api/jobs/6c86549b-154f-4566-a76e-52bd64a33aea?format=Entity" Name="SQL Backup HV" UID="urn:veeam:Job:d1b85018-2769-45be-89bc-03f66b60e6cb" xmlns="http://www.veeam.com/ent/v1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <JobScheduleOptions>
   <Standart>
     <RetryOptions>
     <RetryTimes>5</RetryTimes>
     </RetryOptions>
   </Standart>
 </JobScheduleOptions>
</Job>

 

Response:

202 Accepted

 

Response Body:

<Task xmlns="http://www.veeam.com/ent/v1.0" Type="Task" Href="https://localhost:9398/api/tasks/task-3">
 <Links>
   <Link Rel="Delete" Type="Task" Href="https://localhost:9398/api/tasks/task-3" />
 </Links>
 <TaskId>task-3</TaskId>
 <State>Running</State>
 <Operation>EditCdpPolicy</Operation>
</Task>

To trace the status of the operation, send the GET HTTP request to the URL of the received task resource:

Request:

GET https://localhost:9398/api/tasks/task-3

 

Request Header:

X-RestSvcSessionId   NDRjZmJkYmUtNWE5NS00MTU2LTg4NjctOTFmMDY5YjdjMmNj

 

Response:

200 OK

 

Response Body:

<Task xmlns="http://www.veeam.com/ent/v1.0" Type="Task" Href="https://localhost:9398/api/tasks/task-3">
 <Links>
   <Link Rel="Delete" Href="https://localhost:9398/api/tasks/task-3" />
 </Links>
 <TaskId>task-3</TaskId>
 <State>Finished</State>
 <Operation>EditCdpPolicy</Operation>
 <Result Success="true">
   <Message>Ok</Message>
 </Result>
</Task>