Zerto Virtual Replication APIs : Peer Sites API : Code Examples
  
Code Examples
For complete code examples, see Code Samples.
/v1/peersites cURL Code Example
Retrieve the list of all peer sites.
curl -D responseHeader -H "Content-Type: application/json" –H "Accept: application/json -H "x-zerto-session: 9UDQD6RG7YF33QJLWQXGJV8C453N277NA22P7FSNWVZCJTWCBRHQ" https://127.0.0.1:9669/v1/peersites
For a more code examples, see cURL Code.
/v1/peersites C# Code Example
Retrieve the list of all peer sites. For a full code example, including setting up a session, see C# Code.
/*
 * Example - get all peer sites, filtering is not used
 */
private void GetPeerSites() {
  Console.WriteLine("\nRequest the list of peersites:");
  Console.WriteLine("==============================");
  string apiAddress = m_baseAddress + "peersites";
  string result = ExecuteHttpGet(apiAddress, m_format, m_sessionId);
  List<PeerSiteApi> peersites = (List<PeerSiteApi>)DeserializeObjectFromJson(result, typeof(List<PeerSiteApi>));
  Console.WriteLine("Found " + peersites.Count + " peer sites.");
  // Go Over all peersites fetching them one by one
  for (int i = 0;i < peersites.Count;i++) {
    Console.WriteLine((i+1) + ". " + peersites[i].Description);
  }
}