@Test public void testGetVmList() { System.out.println("getVmList"); ZabbixDataSourceAdaptor instance = new ZabbixDataSourceAdaptor(); List<VmDeployed> result = instance.getVmList(); assert (result != null); assert (!result.isEmpty()); for (VmDeployed vmDeployed : result) { assert (vmDeployed.getName() != null); assert (vmDeployed.getId() > 0); System.out.println("VM name: " + vmDeployed.getName()); System.out.println("VM id: " + vmDeployed.getId()); System.out.println("VM Ram: " + vmDeployed.getRamMb()); System.out.println("VM Disk: " + vmDeployed.getDiskGb()); } }
@Override public List<VmDeployed> getVmList() { List<Host> hostsList = client.getAllHosts(); ArrayList<VmDeployed> vms = new ArrayList<>(); for (Host host : hostsList) { if (!hostFilter.isHost(host)) { vms.add(convertToVm(host, client.getItemsFromHost(host.getHost()), hostsList)); } } return vms; }
ZabbixDataSourceAdaptor implements HostDataSource { @Override public List<VmDeployed> getVmList() { List<Host> hostsList = client.getAllHosts(); ArrayList<VmDeployed> vms = new ArrayList<>(); for (Host host : hostsList) { if (!hostFilter.isHost(host)) { vms.add(convertToVm(host, client.getItemsFromHost(host.getHost()), hostsList)); } } return vms; } }
ZabbixDataSourceAdaptor implements HostDataSource { @Override public List<VmDeployed> getVmList() { List<Host> hostsList = client.getAllHosts(); ArrayList<VmDeployed> vms = new ArrayList<>(); for (Host host : hostsList) { if (!hostFilter.isHost(host)) { vms.add(convertToVm(host, client.getItemsFromHost(host.getHost()), hostsList)); } } return vms; }  }
ZabbixDataSourceAdaptor implements HostDataSource { @Override public List<VmDeployed> getVmList() { List<Host> hostsList = client.getAllHosts(); ArrayList<VmDeployed> vms = new ArrayList<>(); for (Host host : hostsList) { if (!hostFilter.isHost(host)) { vms.add(convertToVm(host, client.getItemsFromHost(host.getHost()), hostsList)); } } return vms; }  static void main(String[] args); @Override eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host getHostByName(String hostname); @Override GeneralPurposePowerConsumer getGeneralPowerConsumerByName(String hostname); @Override VmDeployed getVmByName(String name); @Override List<eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host> getHostList(); List<eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host> getHostList(String groupName); @Override List<GeneralPurposePowerConsumer> getGeneralPowerConsumerList(); @Override List<VmDeployed> getVmList(); List<VmDeployed> getVmList(String groupName); @Override List<EnergyUsageSource> getHostAndVmList(); @Override List<HostMeasurement> getHostData(); @Override HostMeasurement getHostData(eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host host); @Override List<HostMeasurement> getHostData(List<eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host> hostList); @Override List<VmMeasurement> getVmData(); @Override VmMeasurement getVmData(VmDeployed vm); @Override List<VmMeasurement> getVmData(List<VmDeployed> vmList); ZabbixClient getClient(); void setClient(ZabbixClient client); @Override CurrentUsageRecord getCurrentEnergyUsage(eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host host); @Override double getLowestHostPowerUsage(eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host host); @Override double getHighestHostPowerUsage(eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host host); @Override double getCpuUtilisation(eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host host, int lastNSeconds); ZabbixHostVMFilter getHostFilter(); void setHostFilter(ZabbixHostVMFilter hostFilter); }
ZabbixDataSourceAdaptor implements HostDataSource { @Override public List<VmDeployed> getVmList() { List<Host> hostsList = client.getAllHosts(); ArrayList<VmDeployed> vms = new ArrayList<>(); for (Host host : hostsList) { if (!hostFilter.isHost(host)) { vms.add(convertToVm(host, client.getItemsFromHost(host.getHost()), hostsList)); } } return vms; }  static void main(String[] args); @Override eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host getHostByName(String hostname); @Override GeneralPurposePowerConsumer getGeneralPowerConsumerByName(String hostname); @Override VmDeployed getVmByName(String name); @Override List<eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host> getHostList(); List<eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host> getHostList(String groupName); @Override List<GeneralPurposePowerConsumer> getGeneralPowerConsumerList(); @Override List<VmDeployed> getVmList(); List<VmDeployed> getVmList(String groupName); @Override List<EnergyUsageSource> getHostAndVmList(); @Override List<HostMeasurement> getHostData(); @Override HostMeasurement getHostData(eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host host); @Override List<HostMeasurement> getHostData(List<eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host> hostList); @Override List<VmMeasurement> getVmData(); @Override VmMeasurement getVmData(VmDeployed vm); @Override List<VmMeasurement> getVmData(List<VmDeployed> vmList); ZabbixClient getClient(); void setClient(ZabbixClient client); @Override CurrentUsageRecord getCurrentEnergyUsage(eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host host); @Override double getLowestHostPowerUsage(eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host host); @Override double getHighestHostPowerUsage(eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host host); @Override double getCpuUtilisation(eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host host, int lastNSeconds); ZabbixHostVMFilter getHostFilter(); void setHostFilter(ZabbixHostVMFilter hostFilter);  }