This operation performs a planned or an unplanned failover operation to power on the disaster recovery (DR) virtual machine (VM). If this operation is performed without a payload, then by default a planned failover is run.
Request
Syntax
POST <webservice>/v2/vsa/vm/{vmGuid}/failover HTTP/1.1
Host: <host name>
Accept: {application/json}
Content-type: application/json
{
"replicationGroupId":"",
"failoverType":"",
}
where <webservice> is the root path used to route the API requests to the Web Server.
For more information, see Available Web Services for REST API.
Request Parameters
A JSON message is required. The following table displays the parameters for the request body.
Name | Description |
---|---|
vmGuid | The globally unique identifier for the virtualization client. If the vmGuid is not known, use the GET vmGuid API to retrieve it. |
Request Headers
Name | Description |
---|---|
Host | The host name of the Web Server or Web Console used in the API request. |
Accept | The format of the response. Valid value is application/json. |
Content-type | The media type contained in the request body. Valid value is application/json. |
Request Body
A JSON message is required. See Syntax. The following table displays the parameters for the request body.
Parameter | Description |
---|---|
replicationGroupId | The ID of the specific DR site where the replication groups of VMs are replicated to. |
failoverType | The parameter can have anyone of the following values: unplanned or planned. |
Response
Response Parameters
Parameter | Description |
---|---|
taskId | The system-generated ID assigned to the task. |
jobIds | The job IDs of the current job accessing the drive. |
Examples
Sample Request
This request is for unplanned failover.
POST <webservice>/v2/vsa/vm/521/failover HTTP/1.1
Host: client.mydomain.com
Accept: application/json
Content-type: application/json
{
"replicationGroupId": 33,
"failoverType": "unplanned"
}
This request is for planned failover.
POST <webservice>/v2/vsa/vm/521/failover HTTP/1.1
Host: client.mydomain.com
Accept: application/json
Content-type: application/json
{
"replicationGroupId": 33,
"failoverType": "planned"
}
Sample Response
{
"taskId": 9358,
"jobIds": [
"153543"
]
}