@Test @SuppressWarnings(value = { "static-access" }) public void getCostTest() throws JAXBException { Deployment deployment = new Deployment(); deployment.setId(1); deployment.setSchema(3); VM vm1 = new VM(); vm1.setId(1); vm1.setProviderVmId("X1"); vm1.setProviderId("1"); deployment.addVM(vm1); VM vm2 = new VM(); vm2.setId(2); vm2.setProviderVmId("X2"); vm2.setProviderId("2"); deployment.addVM(vm2); PRClient prClient = mock(PRClient.class); DeploymentRest deploymentRest = new DeploymentRest(); deploymentRest.prClient = prClient; DeploymentDAO deploymentDAO = mock(DeploymentDAO.class); deploymentRest.deploymentDAO = deploymentDAO; when(deploymentDAO.getById(1)).thenReturn(deployment); VmManagerClient vmManagerClient1 = mock(VmManagerClient.class); VmManagerClient vmManagerClient2 = mock(VmManagerClient.class); when(prClient.getVMMClient(1)).thenReturn(vmManagerClient1); when(prClient.getVMMClient(2)).thenReturn(vmManagerClient2); List<String> ids = new ArrayList<String>(); ids.add("X1"); List<VmCost> vmCosts = new ArrayList<VmCost>(); vmCosts.add(new VmCost("X1", 2.1)); when(vmManagerClient1.getVMCosts(ids)).thenReturn(vmCosts); List<String> ids2 = new ArrayList<String>(); ids2.add("X2"); List<VmCost> vmCosts2 = new ArrayList<VmCost>(); vmCosts2.add(new VmCost("X2", 3.2)); when(vmManagerClient2.getVMCosts(ids2)).thenReturn(vmCosts2); PriceModellerClient pmClient = mock(PriceModellerClient.class); deploymentRest.priceModellerClient = pmClient; when(pmClient.getAppTotalCharges(1, 3, 5.300000000000001)).thenReturn(6.7); Response response = deploymentRest.getCost("111", "1"); String xml = (String) response.getEntity(); JAXBContext jaxbContext = JAXBContext.newInstance(Cost.class); Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); Cost cost = (Cost) jaxbUnmarshaller.unmarshal(new StringReader(xml)); assertEquals(6.7, cost.getCharges(), 0.0001); assertEquals(-1.0, cost.getPowerValue(), 0.0001); assertEquals(-1.0, cost.getEnergyValue(), 0.0001); }
@GET @Path("{deployment_id}/cost-consumption") @Produces(MediaType.APPLICATION_XML) public Response getCost(@PathParam("application_name") String applicationName, @PathParam("deployment_id") String deploymentId) { logger.info("GET request to path: /applications/" + applicationName + "/deployments/" + deploymentId + "/cost-consumption"); int deploymentIdInt = Integer.parseInt(deploymentId); Deployment deployment = deploymentDAO.getById(deploymentIdInt); Map<String, List<String>> providerVMIds = providerIdsAndItsVMIds(deployment); List<VmCost> vmCosts = new ArrayList<VmCost>(); try { for(Map.Entry<String, List<String>> entry : providerVMIds.entrySet()) { VmManagerClient vmManagerClient = prClient.getVMMClient(Integer.parseInt(entry.getKey())); logger.info("Asking for the costs of the VMs: " + entry.getValue() + " in provider: " + entry.getKey()); vmCosts.addAll(vmManagerClient.getVMCosts(entry.getValue())); } } catch(NullPointerException ex) { logger.warn("Null pointer exception getting IaaS Costs for VMs"); logger.warn(ex.getStackTrace()); logger.warn(ex.getMessage()); } double totalCost = 0.0; for(VmCost vmCost : vmCosts) { logger.info("IaaS Cost for VM: " + vmCost.getVmId() + " = " + vmCost.getCost()); totalCost = totalCost + vmCost.getCost(); } totalCost = getPriceModellerClient().getAppTotalCharges(deploymentIdInt, deployment.getSchema(), totalCost); Cost cost = new Cost(); cost.setCharges(totalCost); cost.setEnergyValue(-1.0); cost.setPowerValue(-1.0); String xml = XMLBuilder.getCostConsumptionForADeployment(cost, applicationName, deploymentId); return buildResponse(Status.OK, xml); }
DeploymentRest extends AbstractRest { @GET @Path("{deployment_id}/cost-consumption") @Produces(MediaType.APPLICATION_XML) public Response getCost(@PathParam("application_name") String applicationName, @PathParam("deployment_id") String deploymentId) { logger.info("GET request to path: /applications/" + applicationName + "/deployments/" + deploymentId + "/cost-consumption"); int deploymentIdInt = Integer.parseInt(deploymentId); Deployment deployment = deploymentDAO.getById(deploymentIdInt); Map<String, List<String>> providerVMIds = providerIdsAndItsVMIds(deployment); List<VmCost> vmCosts = new ArrayList<VmCost>(); try { for(Map.Entry<String, List<String>> entry : providerVMIds.entrySet()) { VmManagerClient vmManagerClient = prClient.getVMMClient(Integer.parseInt(entry.getKey())); logger.info("Asking for the costs of the VMs: " + entry.getValue() + " in provider: " + entry.getKey()); vmCosts.addAll(vmManagerClient.getVMCosts(entry.getValue())); } } catch(NullPointerException ex) { logger.warn("Null pointer exception getting IaaS Costs for VMs"); logger.warn(ex.getStackTrace()); logger.warn(ex.getMessage()); } double totalCost = 0.0; for(VmCost vmCost : vmCosts) { logger.info("IaaS Cost for VM: " + vmCost.getVmId() + " = " + vmCost.getCost()); totalCost = totalCost + vmCost.getCost(); } totalCost = getPriceModellerClient().getAppTotalCharges(deploymentIdInt, deployment.getSchema(), totalCost); Cost cost = new Cost(); cost.setCharges(totalCost); cost.setEnergyValue(-1.0); cost.setPowerValue(-1.0); String xml = XMLBuilder.getCostConsumptionForADeployment(cost, applicationName, deploymentId); return buildResponse(Status.OK, xml); } }
DeploymentRest extends AbstractRest { @GET @Path("{deployment_id}/cost-consumption") @Produces(MediaType.APPLICATION_XML) public Response getCost(@PathParam("application_name") String applicationName, @PathParam("deployment_id") String deploymentId) { logger.info("GET request to path: /applications/" + applicationName + "/deployments/" + deploymentId + "/cost-consumption"); int deploymentIdInt = Integer.parseInt(deploymentId); Deployment deployment = deploymentDAO.getById(deploymentIdInt); Map<String, List<String>> providerVMIds = providerIdsAndItsVMIds(deployment); List<VmCost> vmCosts = new ArrayList<VmCost>(); try { for(Map.Entry<String, List<String>> entry : providerVMIds.entrySet()) { VmManagerClient vmManagerClient = prClient.getVMMClient(Integer.parseInt(entry.getKey())); logger.info("Asking for the costs of the VMs: " + entry.getValue() + " in provider: " + entry.getKey()); vmCosts.addAll(vmManagerClient.getVMCosts(entry.getValue())); } } catch(NullPointerException ex) { logger.warn("Null pointer exception getting IaaS Costs for VMs"); logger.warn(ex.getStackTrace()); logger.warn(ex.getMessage()); } double totalCost = 0.0; for(VmCost vmCost : vmCosts) { logger.info("IaaS Cost for VM: " + vmCost.getVmId() + " = " + vmCost.getCost()); totalCost = totalCost + vmCost.getCost(); } totalCost = getPriceModellerClient().getAppTotalCharges(deploymentIdInt, deployment.getSchema(), totalCost); Cost cost = new Cost(); cost.setCharges(totalCost); cost.setEnergyValue(-1.0); cost.setPowerValue(-1.0); String xml = XMLBuilder.getCostConsumptionForADeployment(cost, applicationName, deploymentId); return buildResponse(Status.OK, xml); }  }
DeploymentRest extends AbstractRest { @GET @Path("{deployment_id}/cost-consumption") @Produces(MediaType.APPLICATION_XML) public Response getCost(@PathParam("application_name") String applicationName, @PathParam("deployment_id") String deploymentId) { logger.info("GET request to path: /applications/" + applicationName + "/deployments/" + deploymentId + "/cost-consumption"); int deploymentIdInt = Integer.parseInt(deploymentId); Deployment deployment = deploymentDAO.getById(deploymentIdInt); Map<String, List<String>> providerVMIds = providerIdsAndItsVMIds(deployment); List<VmCost> vmCosts = new ArrayList<VmCost>(); try { for(Map.Entry<String, List<String>> entry : providerVMIds.entrySet()) { VmManagerClient vmManagerClient = prClient.getVMMClient(Integer.parseInt(entry.getKey())); logger.info("Asking for the costs of the VMs: " + entry.getValue() + " in provider: " + entry.getKey()); vmCosts.addAll(vmManagerClient.getVMCosts(entry.getValue())); } } catch(NullPointerException ex) { logger.warn("Null pointer exception getting IaaS Costs for VMs"); logger.warn(ex.getStackTrace()); logger.warn(ex.getMessage()); } double totalCost = 0.0; for(VmCost vmCost : vmCosts) { logger.info("IaaS Cost for VM: " + vmCost.getVmId() + " = " + vmCost.getCost()); totalCost = totalCost + vmCost.getCost(); } totalCost = getPriceModellerClient().getAppTotalCharges(deploymentIdInt, deployment.getSchema(), totalCost); Cost cost = new Cost(); cost.setCharges(totalCost); cost.setEnergyValue(-1.0); cost.setPowerValue(-1.0); String xml = XMLBuilder.getCostConsumptionForADeployment(cost, applicationName, deploymentId); return buildResponse(Status.OK, xml); }  @GET @Produces(MediaType.APPLICATION_XML + ";qs=1") Response getDeployments(@PathParam("application_name") String applicationName, @DefaultValue("")@QueryParam("status") String status); @GET @Produces(MediaType.APPLICATION_JSON + ";qs=0.5") Response getDeploymentsJSON(@PathParam("application_name") String applicationName, @DefaultValue("")@QueryParam("status") String status); @POST @Consumes(MediaType.APPLICATION_XML) @Produces(MediaType.APPLICATION_XML) Response postDeployment(@PathParam("application_name") String applicationName, @QueryParam("negotiation") String negotiation,  @QueryParam("schema") String schema, String payload); @POST @Consumes(MediaType.APPLICATION_XML) @Produces(MediaType.APPLICATION_JSON) Response postDeploymentJSON(@PathParam("application_name") String applicationName, @QueryParam("negotiation") String negotiation,  @QueryParam("schema") String schema, String payload); @OPTIONS @Path("{deployment_id}") Response optionsForSpecificDeployment(); @GET @Path("{deployment_id}") @Produces(MediaType.APPLICATION_XML + ";qs=1") Response getDeployment(@PathParam("application_name") String applicationName, @PathParam("deployment_id") String deploymentId); @GET @Path("{deployment_id}") @Produces(MediaType.APPLICATION_JSON + ";qs=0.5") Response getDeploymentJSON(@PathParam("application_name") String applicationName, @PathParam("deployment_id") String deploymentId); @GET @Path("{deployment_id}/agreement") @Produces(MediaType.APPLICATION_XML) Response getDeploymentAgreement(@PathParam("application_name") String applicationName, @PathParam("deployment_id") String deploymentId); @GET @Path("{deployment_id}/ovf") @Produces(MediaType.APPLICATION_XML) Response getDeploymentOvf(@PathParam("application_name") String applicationName, @PathParam("deployment_id") String deploymentId); @PUT @Path("{deployment_id}/agreement") @Consumes(MediaType.APPLICATION_XML) @Produces(MediaType.APPLICATION_XML) Response putDeploymentAgreement(@PathParam("application_name") String applicationName, @PathParam("deployment_id") String deploymentId); @DELETE @Path("{deployment_id}") @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN }) Response deleteDeployment(@PathParam("application_name") String applicationName, @PathParam("deployment_id") String deploymentId); @GET @Path("{deployment_id}/cost-consumption") @Produces(MediaType.APPLICATION_XML) Response getCost(@PathParam("application_name") String applicationName, @PathParam("deployment_id") String deploymentId); @GET @Path("{deployment_id}/energy-consumption") @Produces(MediaType.APPLICATION_XML + ";qs=1") Response getEnergyConsumptionXML(@PathParam("application_name") String applicationName, 
										 @PathParam("deployment_id") String deploymentId,
										 @QueryParam("startTime") String startTime,
			                             @QueryParam("endTime") String endTime); @GET @Path("{deployment_id}/energy-consumption") @Produces(MediaType.APPLICATION_JSON + ";qs=0.5") Response getEnergyConsumptionJSON(@PathParam("application_name") String applicationName, @PathParam("deployment_id") String deploymentId, @QueryParam("startTime") String startTime,
            @QueryParam("endTime") String endTime); @GET @Path("{deployment_id}/power-consumption") @Produces(MediaType.APPLICATION_XML + ";qs=1") Response getPowerConsumptionXML(@PathParam("application_name") String applicationName, 
										@PathParam("deployment_id") String deploymentId,
										@QueryParam("startTime") String startTime,
			                            @QueryParam("endTime") String endTime); @GET @Path("{deployment_id}/power-consumption") @Produces(MediaType.APPLICATION_JSON + ";qs=0,5") Response getPowerConsumptionJSON(@PathParam("application_name") String applicationName, 
										@PathParam("deployment_id") String deploymentId,
										@QueryParam("startTime") String startTime,
			                            @QueryParam("endTime") String endTime); @GET @Path("{deployment_id}/energy-estimation") @Produces(MediaType.APPLICATION_XML) Response getEnergyEstimation(@PathParam("application_name") String applicationName, 
										@PathParam("deployment_id") String deploymentId,
										@QueryParam("duration") String durationQuery); @GET @Path("{deployment_id}/power-estimation") @Produces(MediaType.APPLICATION_XML) Response getPowerEstimation(@PathParam("application_name") String applicationName, 
									   @PathParam("deployment_id") String deploymentId,
										@QueryParam("duration") String durationQuery); @GET @Path("{deployment_id}/events/{event_id}/energy-estimation") @Produces(MediaType.APPLICATION_XML) Response getEnergyEstimationForEvent(@PathParam("application_name") String applicationName, 
												@PathParam("deployment_id") String deploymentId, 
												@PathParam("event_id") String eventId,
												@QueryParam("duration") String durationQuery); @GET @Path("{deployment_id}/events/{event_id}/power-estimation") @Produces(MediaType.APPLICATION_XML) Response getPowerEstimationForEvent(@PathParam("application_name") String applicationName, 
											   @PathParam("deployment_id") String deploymentId, 
											   @PathParam("event_id") String eventId,
											   @QueryParam("duration") String durationQuery); @GET @Path("{deployment_id}/events/{event_id}/energy-consumption") @Produces(MediaType.APPLICATION_XML) Response getEnergyMeasurementForEvent(@PathParam("application_name") String applicationName, 
												 @PathParam("deployment_id") String deploymentId, 
												 @PathParam("event_id") String eventId,
												 @QueryParam("startTime") String startTime,
					                             @QueryParam("endTime") String endTime); @GET @Path("{deployment_id}/events/{event_id}/power-consumption") @Produces(MediaType.APPLICATION_XML) Response getPowerConsumptionForEvent(@PathParam("application_name") String applicationName, 
												@PathParam("deployment_id") String deploymentId, 
												@PathParam("event_id") String eventId,
					                            @QueryParam("startTime") String startTime,
					                            @QueryParam("endTime") String endTime); @GET @Path("{deployment_id}/predicted-price-for-next-period") @Produces(MediaType.APPLICATION_XML) Response getPredictedPriceForNextPeriod(@PathParam("application_name") String applicationName, 
			                          @PathParam("deployment_id") String deploymentId,
			                          @QueryParam("duration") String duration); @GET @Path("{deployment_id}/events/{event_id}/cost-estimation") @Produces(MediaType.APPLICATION_XML) Response getCostEstimation(@PathParam("application_name") String applicationName, 
			                          @PathParam("deployment_id") String deploymentId,
			                          @PathParam("event_id") String eventId); @GET @Path("{deployment_id}/sla-limits") @Produces(MediaType.APPLICATION_XML) Response getSLALimits(@PathParam("application_name") String applicationName, @PathParam("deployment_id") String deploymentId); @POST @Path("{deployment_id}/renegotiate") @Consumes(MediaType.APPLICATION_XML) @Produces(MediaType.APPLICATION_XML) Response renegotiateWithPayload(@PathParam("application_name") String applicationName,@PathParam("deployment_id") String deploymentId, String payload); @GET @Path("{deployment_id}/renegotiate") @Produces(MediaType.APPLICATION_XML) Response renegotiate(@PathParam("application_name") String applicationName, @PathParam("deployment_id") String deploymentId); @GET @Path("{deployment_id}/predict-price-next-hour") @Produces(MediaType.APPLICATION_XML) Response predictPriceNextHour(@PathParam("application_name") String applicationName, @PathParam("deployment_id") String deploymentId); }
DeploymentRest extends AbstractRest { @GET @Path("{deployment_id}/cost-consumption") @Produces(MediaType.APPLICATION_XML) public Response getCost(@PathParam("application_name") String applicationName, @PathParam("deployment_id") String deploymentId) { logger.info("GET request to path: /applications/" + applicationName + "/deployments/" + deploymentId + "/cost-consumption"); int deploymentIdInt = Integer.parseInt(deploymentId); Deployment deployment = deploymentDAO.getById(deploymentIdInt); Map<String, List<String>> providerVMIds = providerIdsAndItsVMIds(deployment); List<VmCost> vmCosts = new ArrayList<VmCost>(); try { for(Map.Entry<String, List<String>> entry : providerVMIds.entrySet()) { VmManagerClient vmManagerClient = prClient.getVMMClient(Integer.parseInt(entry.getKey())); logger.info("Asking for the costs of the VMs: " + entry.getValue() + " in provider: " + entry.getKey()); vmCosts.addAll(vmManagerClient.getVMCosts(entry.getValue())); } } catch(NullPointerException ex) { logger.warn("Null pointer exception getting IaaS Costs for VMs"); logger.warn(ex.getStackTrace()); logger.warn(ex.getMessage()); } double totalCost = 0.0; for(VmCost vmCost : vmCosts) { logger.info("IaaS Cost for VM: " + vmCost.getVmId() + " = " + vmCost.getCost()); totalCost = totalCost + vmCost.getCost(); } totalCost = getPriceModellerClient().getAppTotalCharges(deploymentIdInt, deployment.getSchema(), totalCost); Cost cost = new Cost(); cost.setCharges(totalCost); cost.setEnergyValue(-1.0); cost.setPowerValue(-1.0); String xml = XMLBuilder.getCostConsumptionForADeployment(cost, applicationName, deploymentId); return buildResponse(Status.OK, xml); }  @GET @Produces(MediaType.APPLICATION_XML + ";qs=1") Response getDeployments(@PathParam("application_name") String applicationName, @DefaultValue("")@QueryParam("status") String status); @GET @Produces(MediaType.APPLICATION_JSON + ";qs=0.5") Response getDeploymentsJSON(@PathParam("application_name") String applicationName, @DefaultValue("")@QueryParam("status") String status); @POST @Consumes(MediaType.APPLICATION_XML) @Produces(MediaType.APPLICATION_XML) Response postDeployment(@PathParam("application_name") String applicationName, @QueryParam("negotiation") String negotiation,  @QueryParam("schema") String schema, String payload); @POST @Consumes(MediaType.APPLICATION_XML) @Produces(MediaType.APPLICATION_JSON) Response postDeploymentJSON(@PathParam("application_name") String applicationName, @QueryParam("negotiation") String negotiation,  @QueryParam("schema") String schema, String payload); @OPTIONS @Path("{deployment_id}") Response optionsForSpecificDeployment(); @GET @Path("{deployment_id}") @Produces(MediaType.APPLICATION_XML + ";qs=1") Response getDeployment(@PathParam("application_name") String applicationName, @PathParam("deployment_id") String deploymentId); @GET @Path("{deployment_id}") @Produces(MediaType.APPLICATION_JSON + ";qs=0.5") Response getDeploymentJSON(@PathParam("application_name") String applicationName, @PathParam("deployment_id") String deploymentId); @GET @Path("{deployment_id}/agreement") @Produces(MediaType.APPLICATION_XML) Response getDeploymentAgreement(@PathParam("application_name") String applicationName, @PathParam("deployment_id") String deploymentId); @GET @Path("{deployment_id}/ovf") @Produces(MediaType.APPLICATION_XML) Response getDeploymentOvf(@PathParam("application_name") String applicationName, @PathParam("deployment_id") String deploymentId); @PUT @Path("{deployment_id}/agreement") @Consumes(MediaType.APPLICATION_XML) @Produces(MediaType.APPLICATION_XML) Response putDeploymentAgreement(@PathParam("application_name") String applicationName, @PathParam("deployment_id") String deploymentId); @DELETE @Path("{deployment_id}") @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN }) Response deleteDeployment(@PathParam("application_name") String applicationName, @PathParam("deployment_id") String deploymentId); @GET @Path("{deployment_id}/cost-consumption") @Produces(MediaType.APPLICATION_XML) Response getCost(@PathParam("application_name") String applicationName, @PathParam("deployment_id") String deploymentId); @GET @Path("{deployment_id}/energy-consumption") @Produces(MediaType.APPLICATION_XML + ";qs=1") Response getEnergyConsumptionXML(@PathParam("application_name") String applicationName, 
										 @PathParam("deployment_id") String deploymentId,
										 @QueryParam("startTime") String startTime,
			                             @QueryParam("endTime") String endTime); @GET @Path("{deployment_id}/energy-consumption") @Produces(MediaType.APPLICATION_JSON + ";qs=0.5") Response getEnergyConsumptionJSON(@PathParam("application_name") String applicationName, @PathParam("deployment_id") String deploymentId, @QueryParam("startTime") String startTime,
            @QueryParam("endTime") String endTime); @GET @Path("{deployment_id}/power-consumption") @Produces(MediaType.APPLICATION_XML + ";qs=1") Response getPowerConsumptionXML(@PathParam("application_name") String applicationName, 
										@PathParam("deployment_id") String deploymentId,
										@QueryParam("startTime") String startTime,
			                            @QueryParam("endTime") String endTime); @GET @Path("{deployment_id}/power-consumption") @Produces(MediaType.APPLICATION_JSON + ";qs=0,5") Response getPowerConsumptionJSON(@PathParam("application_name") String applicationName, 
										@PathParam("deployment_id") String deploymentId,
										@QueryParam("startTime") String startTime,
			                            @QueryParam("endTime") String endTime); @GET @Path("{deployment_id}/energy-estimation") @Produces(MediaType.APPLICATION_XML) Response getEnergyEstimation(@PathParam("application_name") String applicationName, 
										@PathParam("deployment_id") String deploymentId,
										@QueryParam("duration") String durationQuery); @GET @Path("{deployment_id}/power-estimation") @Produces(MediaType.APPLICATION_XML) Response getPowerEstimation(@PathParam("application_name") String applicationName, 
									   @PathParam("deployment_id") String deploymentId,
										@QueryParam("duration") String durationQuery); @GET @Path("{deployment_id}/events/{event_id}/energy-estimation") @Produces(MediaType.APPLICATION_XML) Response getEnergyEstimationForEvent(@PathParam("application_name") String applicationName, 
												@PathParam("deployment_id") String deploymentId, 
												@PathParam("event_id") String eventId,
												@QueryParam("duration") String durationQuery); @GET @Path("{deployment_id}/events/{event_id}/power-estimation") @Produces(MediaType.APPLICATION_XML) Response getPowerEstimationForEvent(@PathParam("application_name") String applicationName, 
											   @PathParam("deployment_id") String deploymentId, 
											   @PathParam("event_id") String eventId,
											   @QueryParam("duration") String durationQuery); @GET @Path("{deployment_id}/events/{event_id}/energy-consumption") @Produces(MediaType.APPLICATION_XML) Response getEnergyMeasurementForEvent(@PathParam("application_name") String applicationName, 
												 @PathParam("deployment_id") String deploymentId, 
												 @PathParam("event_id") String eventId,
												 @QueryParam("startTime") String startTime,
					                             @QueryParam("endTime") String endTime); @GET @Path("{deployment_id}/events/{event_id}/power-consumption") @Produces(MediaType.APPLICATION_XML) Response getPowerConsumptionForEvent(@PathParam("application_name") String applicationName, 
												@PathParam("deployment_id") String deploymentId, 
												@PathParam("event_id") String eventId,
					                            @QueryParam("startTime") String startTime,
					                            @QueryParam("endTime") String endTime); @GET @Path("{deployment_id}/predicted-price-for-next-period") @Produces(MediaType.APPLICATION_XML) Response getPredictedPriceForNextPeriod(@PathParam("application_name") String applicationName, 
			                          @PathParam("deployment_id") String deploymentId,
			                          @QueryParam("duration") String duration); @GET @Path("{deployment_id}/events/{event_id}/cost-estimation") @Produces(MediaType.APPLICATION_XML) Response getCostEstimation(@PathParam("application_name") String applicationName, 
			                          @PathParam("deployment_id") String deploymentId,
			                          @PathParam("event_id") String eventId); @GET @Path("{deployment_id}/sla-limits") @Produces(MediaType.APPLICATION_XML) Response getSLALimits(@PathParam("application_name") String applicationName, @PathParam("deployment_id") String deploymentId); @POST @Path("{deployment_id}/renegotiate") @Consumes(MediaType.APPLICATION_XML) @Produces(MediaType.APPLICATION_XML) Response renegotiateWithPayload(@PathParam("application_name") String applicationName,@PathParam("deployment_id") String deploymentId, String payload); @GET @Path("{deployment_id}/renegotiate") @Produces(MediaType.APPLICATION_XML) Response renegotiate(@PathParam("application_name") String applicationName, @PathParam("deployment_id") String deploymentId); @GET @Path("{deployment_id}/predict-price-next-hour") @Produces(MediaType.APPLICATION_XML) Response predictPriceNextHour(@PathParam("application_name") String applicationName, @PathParam("deployment_id") String deploymentId);  }