@DELETE @Path("action/deallocate") public synchronized void deallocate( @PathParam(VirtualApplianceResource.VIRTUAL_APPLIANCE) Integer virtualApplianceId, @PathParam(VirtualMachineResource.VIRTUAL_MACHINE) Integer virtualMachineId, @Context IRESTBuilder restBuilder) throws Exception { service.deallocateVirtualMachine(virtualMachineId); }
@PUT @Path("action/allocate") public synchronized VirtualMachineDto allocate( @PathParam(VirtualApplianceResource.VIRTUAL_APPLIANCE) Integer virtualApplianceId, @PathParam(VirtualMachineResource.VIRTUAL_MACHINE) Integer virtualMachineId, String forceEnterpriseLimitsStr, @Context IRESTBuilder restBuilder) throws Exception { Boolean forceEnterpriseLimits = Boolean.parseBoolean(forceEnterpriseLimitsStr); // get user form the authentication layer // User user = userService.getCurrentUser(); VirtualMachine vmachine = service.allocateVirtualMachine(virtualMachineId, virtualApplianceId, forceEnterpriseLimits); service.updateVirtualMachineUse(virtualApplianceId, vmachine); return ModelTransformer.transportFromPersistence(VirtualMachineDto.class, vmachine); }
@PUT @Path("action/checkedit") public synchronized void checkEditAllocate( @PathParam(VirtualApplianceResource.VIRTUAL_APPLIANCE) Integer virtualApplianceId, @PathParam(VirtualMachineResource.VIRTUAL_MACHINE) Integer virtualMachineId, VirtualMachineDto vmachine, @Context IRESTBuilder restBuilder) throws Exception { // Boolean forceEnterpriseLimits = Boolean.parseBoolean(forceEnterpriseLimitsStr); // get user form the authentication layer // User user = userService.getCurrentUser(); service.checkAllocate(virtualApplianceId, virtualMachineId, vmachine, true); }