@Test public void testGetSlots() { System.out.println("getSlots"); VmRequirements requirements = new VmRequirements(1, 1024, 20, 2); requirements.toString(); ActionRequester instance = new ActionRequester(); List<Slot> result = instance.getSlots(requirements); assert(result != null); assert(!result.isEmpty()); for (Slot item : result) { System.out.println("Host: " + item.getHostname() + " CPU: " + item.getFreeCpus() + " Memory: " + item.getFreeMemoryMb() + " Disk: " + item.getFreeDiskGb()); } }
@Override public List<Slot> getSlots(VmRequirements requirements) { ProviderSlotClient client = new ProviderSlotClient("1"); Gson gson = new Gson(); String reqs = gson.toJson(requirements); ClientResponse clientResponse = client.postSlots(reqs); String response = clientResponse.getEntity(String.class); Type listType = new TypeToken<ArrayList<Slot>>() { }.getType(); ArrayList<Slot> output = gson.fromJson(response, listType); return output; }
ActionRequester implements Runnable, ActuatorInvoker { @Override public List<Slot> getSlots(VmRequirements requirements) { ProviderSlotClient client = new ProviderSlotClient("1"); Gson gson = new Gson(); String reqs = gson.toJson(requirements); ClientResponse clientResponse = client.postSlots(reqs); String response = clientResponse.getEntity(String.class); Type listType = new TypeToken<ArrayList<Slot>>() { }.getType(); ArrayList<Slot> output = gson.fromJson(response, listType); return output; } }
ActionRequester implements Runnable, ActuatorInvoker { @Override public List<Slot> getSlots(VmRequirements requirements) { ProviderSlotClient client = new ProviderSlotClient("1"); Gson gson = new Gson(); String reqs = gson.toJson(requirements); ClientResponse clientResponse = client.postSlots(reqs); String response = clientResponse.getEntity(String.class); Type listType = new TypeToken<ArrayList<Slot>>() { }.getType(); ArrayList<Slot> output = gson.fromJson(response, listType); return output; }  }
ActionRequester implements Runnable, ActuatorInvoker { @Override public List<Slot> getSlots(VmRequirements requirements) { ProviderSlotClient client = new ProviderSlotClient("1"); Gson gson = new Gson(); String reqs = gson.toJson(requirements); ClientResponse clientResponse = client.postSlots(reqs); String response = clientResponse.getEntity(String.class); Type listType = new TypeToken<ArrayList<Slot>>() { }.getType(); ArrayList<Slot> output = gson.fromJson(response, listType); return output; }  @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<Slot> getSlots(VmRequirements requirements) { ProviderSlotClient client = new ProviderSlotClient("1"); Gson gson = new Gson(); String reqs = gson.toJson(requirements); ClientResponse clientResponse = client.postSlots(reqs); String response = clientResponse.getEntity(String.class); Type listType = new TypeToken<ArrayList<Slot>>() { }.getType(); ArrayList<Slot> output = gson.fromJson(response, listType); return output; }  @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);  }