You manage a VPG using the vpgSettings API by using multiple methods. This section outlines the basic use of the vpgSettings API to perform different VPG functions:
When creating a VPG the set of values are specified and saved as a VPG settings object in the API session. To update the Zerto Virtual Manager with the settings, you commit the object.
You create the VPG settings object by executing the vpgSettings API with the POST method and the necessary request body.
https://zvm_ip:port/v1/vpgsettings
The request body specifies all the details required for the VPG, details of which are in VPGs: POST.
You can create a skeleton VPG settings object by using the following request body:
{}
You can then edit the response body with the required values and pass the completed JSON as a new request body.
Executing this API creates the object settings and returns the vpgSettingsIdentifier in the response body. To create the VPG in the Zerto Virtual Manager, you have to commit the changes using the following API, with the POST method:
When editing a VPG, you first get the VPG settings as an object using the vpgIdentifier to create a new vpgSettingsIdentifier. The settings for the VPG are then modified as required and then the VPG settings object with the changes is committed to update the Zerto Virtual Manager with the changed settings. For example, the following URL with a GET method retrieves the VPG identifier that can then be used to generate a vpgSettingsIdentifier for the settings object for the VPG:
https://zvm_ip:port/v1/vpgs
Details of the VPG are returned including the VPG identifier, which is then used in the request body of the vpgSettings URL, using a POST method:
https://zvm_ip:port/v1/vpgsettings
The request body is similar to the following, in JSON format:
The vpgSettingsIdentifier is returned in the response body. You can use this identifier to retrieve the settings object for the VPG, using a GET method:
You update the VPG settings object by executing the relevant API. For example to update any of the basic settings, you use the vpgsettings/vpgSettingsIdentifier/basic API with the PUT method and the necessary request body.
In the following example, the request body specifies that the priority is changed to high and the journal history is changed to 10 hours:
{
"JournalHistoryInHours": 10,
"Priority": "High"
}
Executing this API changes the object settings. To update the Zerto Virtual Manager with the changed settings, you have to commit the changes using the following API, with the POST method:
The procedure to add a virtual machine to an existing VPG is the same as updating a VPG, described above, but a POST method is used instead of a PUT method to update the settings object. After the settings object is updated with the new information, the object must be committed, also using the POST method. For more details, refer to To add a virtual machine to the VPG:.
Resetting Values in a VPG Settings Object
To reset a value in a VPG settings object, do the following:
1. Get the object and save the response.
2. Delete the section of the VPG settings object, using the DELETE method.
3. Add the new value in the VPG settings object using the PUT method.
4. Commit the change using the POST method.
Note: Mandatory parameters that do not have a default value must be set using the PUT command.
Example 1: Resetting the Priority to the Default Value
1. Retrieve the basic settings in the VPG settings object using the following URL with the GET method:
The procedure to delete a virtual machine from an existing VPG requires that you first get the VPG settings as an object using the vpgIdentifier to create a new vpgSettingsIdentifier. The virtual machine identifier to remove from the VPG is then sent with the DELETE method to delete the virtual machine from the VPG settings:
Executing this API changes the object settings. To update the Zerto Virtual Manager with the changed settings, you have to commit the changes using the following API, with the POST method: