logger.error("Unexpected exception ", e);
}
}
public void testListCall() {
CloudStackClient client = new CloudStackClient("192.168.130.22", 8080, false);
CloudStackCommand command = new CloudStackCommand("listVirtualMachines");
command.setParam("domainid", "1");
command.setParam("account", "admin");
command.setParam("page", "1");
command.setParam("pagesize", "20");
try {
List<CloudStackUserVm> vms = client.listCall(command, API_KEY, SECRET_KEY,
"listvirtualmachinesresponse", "virtualmachine", new TypeToken<List<CloudStackUserVm>>() {}.getType());
for(CloudStackUserVm vm : vms) {
logger.info("id: " + vm.getId() + ", name: " + vm.getName());
}