Zerto Virtual Replication APIs : VPGs API : https://zvm_ip:port/v1/vpgs – POST Methods
  
https://zvm_ip:port/v1/vpgs – POST Methods
Creates a VPG or performs actions on a specific VPG.
URI
Create VPG (vSphere only)
https://zvm_ip:port/v1/vpgs
Clone VPG
https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/CloneStart
Abort VPG clone
https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/CloneAbort
Failover VPG (vSphere and Hyper-V only)
https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/Failover
Commit VPG failover
https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/FailoverCommit
Rollback VPG failover
https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/FailoverRollback
Test VPG (vSphere and Hyper-V only)
https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/failoverTest
Stop VPG test
https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/failoverTestStop
Force synchronize a VPG
https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/forcesync
Pause VPG protection
https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/pause
Resume VPG protection
https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/resume
Where:
zvm_ip
The IP address of the Zerto Virtual Manager where the API is run.
port
The port to access the Zerto Virtual Manager. The default port is 9669.
protectionGroupIdentifier
The identifier of the VPG for which an action is executed, such as a clone, failover or failover test.
Json Request Format
The following is an example request Json body for https://zvm_ip:port/v1/vpgs.
{
  "DatastoreIdentifier": "String content",
  "OrgVdcIdentifier": "String content",
  "Priority":0,
  "ResourcePoolIdentifier": "String content",
  "ServiceProfileIdentifier": "String content",
  "SourceSiteIdentifier": "String content",
  "TargetSiteIdentifier": "String content",
  "VcVappIdentifier": "String content",
  "VcdVappIdentifier": "String content",
  "VmsIdentifiers": [
    "String content",
    ...
  ],
  "VpgName": "String content",
  "ZorgIdentifier": "String content"
}
The following is an example request Json body for https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/CloneStart.
{
  "CheckpointId":"String content"
}
The following is an example request Json body for https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/Failover.
{
  "CheckpointIdentifier":"String content",
  "CommitPolicy":0,
  "ShutdownPolicy":0,
  "TimeToWaitBeforeShutdownInSec":2147483647
}
The following is an example request Json body for https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/FailoverTest.
{
  "CheckpointId":"String content"
}
The following is an example request Json body for https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/FailoverTestStop.
{
  "FailoverTestSuccess":true,
  "FailoverTestSummary":"String content"
}
The request bodies for the other VPGs POST APIs, such as https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/FailoverCommit, is empty.
XML Request Format
For the XML request format, see VPGs API POST Method Request and Response Formats.
Request Values
Create a VPG (vSphere only)
Request values for https://zvm_ip:port/v1/vpgs/{VpgIdentifier}.
Parameter
Description
DatastoreIdentifier
Optional: The identifier of the datastore for the recovered virtual machine disks. Get the identifier using Datastores. If a datastore is not specified, the datastore used is the datastore with the most free space, or the first datastore accessible by the ZORG, if specified. The identifier comprises the server identifier and the storage moref, with the format, serverid.moref.
OrgVdcIdentifier
Optional: The OrgvCD identifier when recovering to vCD. Get the identifier using Org vDCs (vSphere only).
Priority
Optional: The priority to assign to the VPG. Possible values are (Json/XML):
0/Low – The VPG has a low priority for transferring data.
1/Medium – The VPG has a medium priority for transferring data.
2/High – The VPG has a high priority for transferring data.
ResourcePoolIdentifier
Optional: The identifier of the resource pool for the recovered virtual machines. Get the identifier using Resource Pools (vSphere only).
ServiceProfileIdentifier
Optional: The identifier of the service profile to use for the VPG when a Zerto Cloud Manager is used. Get the identifier using Service Profiles API.
SourceSiteIdentifier
Optional: The identifier of the protected site. Get the identifier using Virtualization sites. If a source site is not specified, the site where the API runs is used as the source site.
TargetSiteIdentifier
Optional: The identifier of the target site. Get the identifier using Virtualization sites. If a target site is not specified, the target site is the same as the source site, and enabling replication to the same vCenter Server must be set in the Zerto user interface.
VcVappIdentifier
The identifier of the vCenter Server vApp to protect. When a vCenter Server vApp is not being protected, this value is null. Get the identifier using vCenter Server vApps (vSphere only).
VcdVappIdentifier
The identifier of the vCD vApp to protect. When protecting virtual machines in a vCenter Server, this value is null. Get the identifier using vCD vApps (vSphere only).
VmsIdentifier
The identifiers of the virtual machines to protect. When protecting a vCenter Server vApp or a vCD vApp, this value is null. Get the identifiers using Unprotected VMs.
VpgName
The name to identify the VPG. This name must be unique for a specific ZORG.
ZorgIdentifier
Optional: The identifier of the ZORG, Zerto organization, defined in the Zerto Cloud Manager. Get the identifier using ZORGs API.
Note: Only one of VcVappIdentifier, VcdVappIdentifier and VmsIdentifier is required. If a value is not specified in the request, a null value is used. Nulls are specified in Json as null, all lowercase. For example, the following Json object is to protect two virtual machines to a recovery site, with the site where the API is run being the protected site:
{"DatastoreIdentifier":null,"OrgVdcIdentifier":null,"ResourcePoolIdentifier":null,"ServiceProfileIdentifier":null,"SourceSiteIdentifier":null,"TargetSiteIdentifier":"a9cc87d9-1a97-41c0-a91f-9ef306097d40","VcVappIdentifier":null,"VcdVappIdentifier":null,"VmsIdentifier":["598e5def-3500-4409-a691-d25b5cd10d22.vm-51","598e5def-3500-4409-a691-d25b5cd10d22.vm-50"],"VpgName":"Reports","ZorgIdentifier":null}
The above Json can be shortened to the following, as the values are defaulted to null when not specified:
{"TargetSite":"a9cc87d9-1a97-41c0-a91f-9ef306097d40","Vms":["598e5def-3500-4409-a691-d25b5cd10d22.vm-51","598e5def-3500-4409-a691-d25b5cd10d22.vm-50"],"VpgName":"Reports"}
Clone a VPG
Request values for https://zvm_ip:port/v1/vpgs/{VpgIdentifier}/CloneStart.
Parameter
Description
checkpointId
Optional: The identifier of the checkpoint to use for cloning. If a checkpoint is not specified, the latest checkpoint is used.
Note: The storage used for the cloned virtual machine is the datastore (vSphere)/storage (Hyper-V) with the most free space.
Aborting a Clone
Request body for https://zvm_ip:port/v1/vpgs/{VpgIdentifier}/CloneAbort is empty.
Failover a VPG (vSphere and Hyper-V only)
Request values for https://zvm_ip:port/v1/vpgs/{VpgIdentifier}/failover.
Parameter
Description
checkpointIdentifier
The identifier of the checkpoint to use for the failover. A checkpoint must be specified.
commitPolicy
The policy to use after the failover enters a Before Commit state. Possible values are (Json/XML):
0/rollback – After the seconds specified in the commitValue setting have elapsed, the failover is rolled back.
1/commit – After the seconds specified in the commitValue setting have elapsed, the failover continue, committing the virtual machines in the recovery site.
2/none – The virtual machines in the VPG being failed over remain in the Before Commit state until either they are committed with Commit a failover, or rolled back with Roll back a failover.
commitValue
The amount of time in seconds the failover waits in a Before Commit state to enable checking that the failover is as required before performing the commitPolicy setting.
shutdownPolicy
The shutdown policy to apply to the virtual machines on the protected site that are being failed over Possible values are (Json/XML):
0/None – The protected virtual machines are not touched before starting the failover. This assumes that you do not have access to the protected virtual machines.
1/shutdown – If the protected virtual machines have VMware Tools or Microsoft Integration Services available, the virtual machines are gracefully shut down, otherwise the failover operation fails. This is similar to performing a Move operation to a specified checkpoint.
2/forceshutdown – The protected virtual machines are forcibly shut down before starting the failover. If the protected virtual machines have VMware Tools or Microsoft Integration Services available, the procedure waits five minutes for the virtual machines to be gracefully shut down before forcibly powering them off. This is similar to performing a Move operation to a specified checkpoint.
TimeToWaitBeforeShutdownInSec
The amount of time in seconds the failover waits in a Before Commit state to enable checking that the failover is as required before performing the commitPolicy setting.
Commit a failover
Request body for https://zvm_ip:port/v1/vpgs/{VpgIdentifier}/FailoverCommit is empty.
Note: Attempting to commit a failover during the initial stage, before it is ready to commit or roll back, throws an exception.
Roll back a failover
Request body for https://zvm_ip:port/v1/vpgs/{VpgIdentifier}/FailoverRollback is empty.
Note: Attempting to rollback a failover during the initial stage, before it is ready to commit or roll back, throws an exception.
Test a failover (vSphere and Hyper-V only)
Request values for https://zvm_ip:port/v1/vpgs/{VpgIdentifier}/FailoverTest.
Parameter
Description
checkpointId
Optional: The identifier of the checkpoint to use for testing. If a checkpoint is not specified, the latest checkpoint is used.
Stopping a failover test
Request values for https://zvm_ip:port/v1/vpgs/{VpgIdentifier}/FailoverTestStop.
Parameter
Description
FailoverTestSuccess
Optional. The default is true.
true – The test was successful.
false – The test was not successful.
FailoverTestSummary
Optional: Free text describing the test.
Force synchronize a VPG
Request body for https://zvm_ip:port/v1/vpgs/{VpgIdentifier}/forcesync is empty.
Pause VPG protection
Request body for https://zvm_ip:port/v1/vpgs/{VpgIdentifier}/pause is empty.
Resume VPG protection
Request body for https://zvm_ip:port/v1/vpgs/{VpgIdentifier}/resume is empty.
Json Response Format
The following is an example response Json body for https://zvm_ip:port/v1/vpgs, https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/CloneStart, https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/Failover, https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/FailoverCommit, https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/FailoverRollback, https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/FailoverTest, https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/FailoverTestStop, https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/forcesync, https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/pause, and for https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/resume.
"String content"
XML Response Format
For the XML response format, see VPGs API POST Method Request and Response Formats.
Response values
The response value is the task identifier that can be used with the Tasks API to monitor the delete action.