This walk-through uses the URLs that are passed to create a session and then edit an existing VPG. The examples were tested using a REST client, such as Postman, used in Google Chrome, and available from http://www.getpostman.com/.
In all the example code, the zvm_ip is the IP of the Zerto Virtual Manager where the API will run and both the content type and accept type is application/json.
To start a session:
■ Use the following URL with a POST method and basic authentication to access the hypervisor management tool, vCenter Server or the Microsoft SCVMM.
https://zvm_ip:9669/v1/session/add
The Response Header that is returned is similar to the following:
Where 3864850e-1580-4518-95d1-f88a4d97c677 is the vpgSettingsIdentifier returned in step 1.
3. Set in the basic parameters as required, at least the following fields:
■ JournalHistoryInHours
■ Name
■ Priority
■ ProtectedSiteIdentifier
■ RecoverySiteIdentifier
■ RpoInSeconds
■ TestIntervalInMinutes.
Get the RecoverySiteIdentifier by running the virtualizationsites API, using the following URL with the GET method:
https://zvm_ip:9669/v1/virtualizationsites
Note: If required, the ServiceProfileIdentifier can be retrieved using the /v1/serviceprofiles API with the GET method and the ZorgIdentifier can be retrieved using the /v1/zorgs API with the GET method.
4. Get the structures for the Journal, Networks and Recovery sections in the skeleton by copying the Json request bodies from the examples in the help, accessed by running the following URL:
5. Use the virtualizationsites API to get the following values from the recovery site to add to the skeleton settings:
■ DatastoreIdentifier for both the journal and recovery storage
■ DefaultNetworkIdentifier, for both the failover and move network and for the test failover network
■ DefaultFolderIdentifier
■ DefaultHostClusterIdentifier or DefaultHostIdentifier or ResourcePoolIdentifier
6. Set the journal limitations as required. A zero, 0, value means unlimited.
7. Get the identifiers for the virtual machines that are not protected, with the virtualizationsites/vms API and add the list of virtual machines you want protected in the VPG, as in the following example
The task identifier is returned which can then be used with the /v1/tasks/{taskIdentifier} API to monitor the task progress. The settings object for this VPG is also destroyed.
1. Use the following URL with a GET method and the x-zerto-session added to the header to retrieve the VPG identifiers for existing VPGs. A VPG identifier is then used to create the VPG settings object:
https://zvm_ip:9669/v1/vpgs
The response to this command is a list of VPGs with information about each VPG.
2. Copy the relevant VpgIdentifier from the response to use in the request body of another API, and create a VPG settings object for this VPG. The request body contains code similar to the following:
Where 3864850e-1580-4518-95d1-f88a4d97c677 is the vpgSettingsIdentifier returned in step 2.
4. Updating the VPG is done using the following steps:
a) Get the current settings for the part of the VPG you want to update. For example, to update the basic values, use the following URL with a GET method:
b) Use the response body from step 4 to create the request body for the update with the required changes and then use this request body with the following URL with a PUT method:
The task identifier is returned which can then be used with the /v1/tasks/{taskIdentifier} API to monitor the task progress. The settings object for this VPG is also destroyed.
To add a virtual machine to the VPG:
1. Get the identifier for the protected site, for the virtual machines that are not protected, with the /v1/virtualizationsites or /v1/localsite API. For example, using the following URL with a GET method:
https://zvm_ip:9669/v1/localsite
The API must be run on the protected site.
2. Get the identifiers for the virtual machines that are not protected, with the /v1/virtualizationsites/vms API, using the following URL with a GET method:
3. Updating the VPG to include the virtual machine you want to add, by first creating the VPG settings object as described in steps 1 to 3 in To update an existing VPG:, above and then using the following URL with a POST method:
The task identifier is returned which can then be used with the /v1/tasks/{taskIdentifier} API to monitor the task progress. The settings object for this VPG is also destroyed.