/** * Removes the Datacenter from the Datacenter repository * * @param id: The Datacenter's id to be deleted */ @ApiOperation( value = " Removing a Vim Instance", notes = "Deletes the Vim Instance belonging to the id specified in the URL") @RequestMapping(value = "{id}", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.NO_CONTENT) public void delete( @PathVariable("id") String id, @RequestHeader(value = "project-id") String projectId) throws NotFoundException, BadRequestException { vimManagement.delete(id, projectId); }
/** * Removes multiple VIM Instances * * @param ids: the list of VIM Instance IDs * @throws NotFoundException if one of the VIM Instances was not found * @throws BadRequestException if something is wrong with the request */ @RequestMapping( value = "/multipledelete", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE) @ApiOperation( value = "Removing multiple VIM Instances", notes = "Delete Request takes a list of VIM Instance IDs") @ResponseStatus(HttpStatus.NO_CONTENT) public void multipleDelete( @RequestBody @Valid List<String> ids, @RequestHeader(value = "project-id") String projectId) throws NotFoundException, BadRequestException { for (String id : ids) vimManagement.delete(id, projectId); }
@Test public void deleteVimInstance() throws NotFoundException, BadRequestException { mock.delete("123", "pi"); restVimInstances.delete("123", "pi"); } }