A First Time Tutorial
This walk-through uses cURL installed with SSL. The username and password supplied for authentication to start a session is the hypervisor manager, vCenter Server or Microsoft SCVMM accessed by the Zerto Virtual Manager.
To start a session and run some queries, do the following:
1. Enter the following code to start a session using cURL, where the response is headers.
curl -D responseHeader -H "Content-Type: application/json" -H "Accept: application/json" --user user:password https://zvm_ip:9669/v1/session/add -d "{\"AuthenticationMethod\":1}" -k |
where zvm_ip is the IP of the Zerto Virtual Manager where the API will run and user:password are the username and password that access the vCenter Server or the Microsoft SCVMM hypervisor management tool.
The 1 in -d "{\"AuthenticationMethod\":1}", indicates that vCenter Server or the Microsoft SCVMM hypervisor management tool credentials are being used.
The -k option at the end of the command indicates that certificate verification has been turned off.
The responseHeader file that is returned is written to the folder in which the cURL executable is located. It is similar to the following:
HTTP/1.1 200 OK Content-Length: 0 Server: Microsoft-HTTPAPI/2.0 x-zerto-session: 9UDQD6RG7YF33QJLWQXGJV8C453N277NA22P7FSNWVZCJTWCBRHQ Date: Mon, 29 Jun 2015 08:50:58 GMT |
The fourth line contains the value of x-zerto-session, which is used in all subsequent calls.
2. To retrieve information about all VPGs, run:
curl -D responseHeader -H "Content-Type: application/json" -H "Accept: application/json" -H "x-zerto-session: 9UDQD6RG7YF33QJLWQXGJV8C453N277NA22P7FSNWVZCJTWCBRHQ" https://zvm_ip:9669/v1/vpgs -k |
where zvm_ip is the IP of the Zerto Virtual Manager where the API will run.
The response to this command is a list of VPGs with information about each VPG, in JSON format.
The following example shows the result when one VPG, named VPGA, is returned.
For additional cURL examples, see
cURL Code.
After 30 minutes of inactivity, the session automatically ends.