POST /cdpReplicas/{ID}/vms/{ID}?action=failover
Starts the failover process of the specified VM to its CDP replica.
Request
To start the VM replica failover process, send the POST HTTP request to the /cdpReplicas/{ID}/vms/{ID}?action=failover URL.
HTTP Request
POST https://<Enterprise-Manager>:9398/api/cdpReplicas/{ID}/vms/{ID}?action=failover |
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. |
Accept | False | Identifies the format of the response. Possible values:
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 failover. The body of the request must conform to the XML Schema Definitionem_rest_ of Veeam Backup Enterprise Manager REST API.
Important |
If you use the XML media type, make sure that the order of parameters in the request body is correct. For details, see request body examples in this section. |
The request body must contain the elements you want to specify. You can define the following general parameters:
Element | Type | Description | Modifiable | Min/Max Occurrence |
---|---|---|---|---|
RestoreCurrent | Boolean | Defines whether Veeam Backup & Replication will fail over the VM to their latest crush-consistent restore point. Possible values:
| Yes | 1/1 |
RestoreCurrentVss | Boolean | Defines whether Veeam Backup & Replication will fail over the VM to their latest long-term application-consistent restore points. Possible values:
| Yes | 1/1 |
RestoreAtInterval | DateTime | If you specify this parameter, Veeam Backup & Replication will fail over the VM to the most recent restore point in the interval that includes the selected date. The parameter accepts only UTC-formatted DateTime values. | Yes | 0/1 |
RestoreAtPointinTime | DateTime | If you specify this parameter, Veeam Backup & Replication will fail over the VM to the most recent replicated state that was created prior to the selected date. The parameter accepts only UTC-formatted DateTime values. | Yes | 0/1 |
For example:
XML Representation
<?xml version="1.0" encoding="utf-8"?> |
JSON Representation
{ "RestoreCurrent": true, "RestoreCurrentVss": false, "RestoreAtPointInTime": "2021-02-17T15:31:40" } |
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:
|
Response Body
In the response body, the REST API returns a task that has been created to perform the requested operation. To track the status of the operation, send the GET /tasks/{ID} request.
The task resource also contains a link to the task deletion operation. To stop the task execution, send the DELETE /task/{ID} request to the URL in the link.
Example
The example below starts the failover process for the VM that has ID e809a086-2562-4a0f-a9a8-9c115ff8f0ba and that is included in the CDP replica with ID 7665222c-2e99-4a3f-b892-1827ba8d1eee.
Request: POST https://localhost:9398/api/cdpReplicas/7665222c-2e99-4a3f-b892-1827ba8d1eee/vms/e809a086-2562-4a0f-a9a8-9c115ff8f0ba?action=failover
Request Header: X-RestSvcSessionId NDRjZmJkYmUtNWE5NS00MTU2LTg4NjctOTFmMDY5YjdjMmNj
Request Body: <?xml version="1.0" encoding="utf-8"?>
Response: 202 Accepted
Response Body:
|
To track 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-1
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-1"> |