@Test public void testGetVmTypesAvailableToAdd() { System.out.println("getVmTypesAvailableToAdd"); String applicationId = "davidgpTestApp"; String deploymentId = "453"; ActionRequester instance = new ActionRequester(); List<String> result = instance.getVmTypesAvailableToAdd(applicationId, deploymentId); System.out.println("Types Available to Add"); for (String type : result) { System.out.println(type); } System.out.println("Result Size" + result.size()); }
@Override public List<String> getVmTypesAvailableToAdd(String applicationId, String deploymentId) { ArrayList<String> answer = new ArrayList<>(); List<VM> vms = getVMs(applicationId, deploymentId); for (VM vm : vms) { if (vm.getNumberVMsMax() > 0 && getVmCountOfGivenType(vms, vm.getOvfId()) < vm.getNumberVMsMax() && !answer.contains(vm.getOvfId())) { answer.add(vm.getOvfId()); } } return answer; }
ActionRequester implements Runnable, ActuatorInvoker { @Override public List<String> getVmTypesAvailableToAdd(String applicationId, String deploymentId) { ArrayList<String> answer = new ArrayList<>(); List<VM> vms = getVMs(applicationId, deploymentId); for (VM vm : vms) { if (vm.getNumberVMsMax() > 0 && getVmCountOfGivenType(vms, vm.getOvfId()) < vm.getNumberVMsMax() && !answer.contains(vm.getOvfId())) { answer.add(vm.getOvfId()); } } return answer; } }
ActionRequester implements Runnable, ActuatorInvoker { @Override public List<String> getVmTypesAvailableToAdd(String applicationId, String deploymentId) { ArrayList<String> answer = new ArrayList<>(); List<VM> vms = getVMs(applicationId, deploymentId); for (VM vm : vms) { if (vm.getNumberVMsMax() > 0 && getVmCountOfGivenType(vms, vm.getOvfId()) < vm.getNumberVMsMax() && !answer.contains(vm.getOvfId())) { answer.add(vm.getOvfId()); } } return answer; }  }
ActionRequester implements Runnable, ActuatorInvoker { @Override public List<String> getVmTypesAvailableToAdd(String applicationId, String deploymentId) { ArrayList<String> answer = new ArrayList<>(); List<VM> vms = getVMs(applicationId, deploymentId); for (VM vm : vms) { if (vm.getNumberVMsMax() > 0 && getVmCountOfGivenType(vms, vm.getOvfId()) < vm.getNumberVMsMax() && !answer.contains(vm.getOvfId())) { answer.add(vm.getOvfId()); } } return answer; }  @Override String getOvf(String applicationId, String deploymentId); @Override VM getVM(String application, String deployment, String vmID); @Override List<String> getVmTypesAvailableToAdd(String applicationId, String deploymentId); @Override List<String> getVmTypesAvailableToRemove(String applicationId, String deploymentId); @Override List<Integer> getVmIdsAvailableToRemove(String applicationId, String deploymentId
    ); @Override int getVmCountOfGivenType(String applicationId, String deploymentId, String type); int getVmCountOfGivenType(List<VM> vms, String type); List<VM> getVMs(String applicationId, String deploymentId); @Override void addVM(String applicationId, String deploymentId, String ovfId); void addVM(String applicationId, String deploymentId, String ovfId, int cpuSize, String location); VM cloneVm(VM vm); @Override void deleteVM(String application, String deployment, String vmID); @Override void scaleUpVM(String application, String deployment, String vmID); @Override void scaleDownVM(String application, String deployment, String vmID); @Override double getPowerUsageVM(String applicationId, String deploymentId, String vmID); @Override double getAveragePowerUsage(String applicationId, String deploymentId, String vmType); @Override double getTotalPowerUsage(String applicationId, String deploymentId); @Override SLALimits getSlaLimits(String applicationId, String deploymentId); @Override List<Slot> getSlots(VmRequirements requirements); @Override List<Node> getProviderHostInfo(); @Override List<Slot> getSlots(); @Override void horizontallyScaleToNVms(String applicationId, String deploymentId, Response response); @Override void renegotiate(String applicationId, String deploymentId); @Override void hardShutdown(String applicationId, String deploymentId); @Override void run(); void stop(); @Override void actuate(Response response); }
ActionRequester implements Runnable, ActuatorInvoker { @Override public List<String> getVmTypesAvailableToAdd(String applicationId, String deploymentId) { ArrayList<String> answer = new ArrayList<>(); List<VM> vms = getVMs(applicationId, deploymentId); for (VM vm : vms) { if (vm.getNumberVMsMax() > 0 && getVmCountOfGivenType(vms, vm.getOvfId()) < vm.getNumberVMsMax() && !answer.contains(vm.getOvfId())) { answer.add(vm.getOvfId()); } } return answer; }  @Override String getOvf(String applicationId, String deploymentId); @Override VM getVM(String application, String deployment, String vmID); @Override List<String> getVmTypesAvailableToAdd(String applicationId, String deploymentId); @Override List<String> getVmTypesAvailableToRemove(String applicationId, String deploymentId); @Override List<Integer> getVmIdsAvailableToRemove(String applicationId, String deploymentId
    ); @Override int getVmCountOfGivenType(String applicationId, String deploymentId, String type); int getVmCountOfGivenType(List<VM> vms, String type); List<VM> getVMs(String applicationId, String deploymentId); @Override void addVM(String applicationId, String deploymentId, String ovfId); void addVM(String applicationId, String deploymentId, String ovfId, int cpuSize, String location); VM cloneVm(VM vm); @Override void deleteVM(String application, String deployment, String vmID); @Override void scaleUpVM(String application, String deployment, String vmID); @Override void scaleDownVM(String application, String deployment, String vmID); @Override double getPowerUsageVM(String applicationId, String deploymentId, String vmID); @Override double getAveragePowerUsage(String applicationId, String deploymentId, String vmType); @Override double getTotalPowerUsage(String applicationId, String deploymentId); @Override SLALimits getSlaLimits(String applicationId, String deploymentId); @Override List<Slot> getSlots(VmRequirements requirements); @Override List<Node> getProviderHostInfo(); @Override List<Slot> getSlots(); @Override void horizontallyScaleToNVms(String applicationId, String deploymentId, Response response); @Override void renegotiate(String applicationId, String deploymentId); @Override void hardShutdown(String applicationId, String deploymentId); @Override void run(); void stop(); @Override void actuate(Response response);  }