curl -D responseHeader -H "Content-Type: application/json" –H "Accept: application/json -H "x-zerto-session: 9UDQD6RG7YF33QJLWQXGJV8C453N277NA22P7FSNWVZCJTWCBRHQ" https://127.0.0.1:9669/v1/vms |
/* * Example - get all protected virtual machines, filtering is not used */ private void GetVMs() { Console.WriteLine("\nRequest the list of protected virtual machines:"); Console.WriteLine("================================================"); string apiAddress = m_baseAddress + "vms"; string result = ExecuteHttpGet(apiAddress, m_format, m_sessionId); List<VmApi> vms = (List<VmApi>)DeserializeObjectFromJson(result, typeof(List<VmApi>)); Console.WriteLine("Found " + vms.Count + " protected virtual machines."); // Go Over all virtual machines fetching them one by one for (int i = 0;i < vms.Count;i++) { Console.WriteLine((i+1) + ". " + vms[i].Description); } } |