/** * This operation is used to remove a Network Service Record * * @param id : the id of Network Service Record */ @ApiOperation( value = "Remove a Network Service Record", notes = "Removes the Network Service Record that has 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 InterruptedException, ExecutionException, NotFoundException, BadFormatException, WrongStatusException { networkServiceRecordManagement.delete(id, projectId); }
/** * Removes multiple Network Service Descriptor from the NSDescriptors repository * * @param ids: the id list of Network Service Descriptors * @throws NotFoundException * @throws InterruptedException * @throws ExecutionException * @throws WrongStatusException * @throws VimException */ @ApiOperation( value = "Removing multiple Network Service Records", notes = "The list of ids in the Request Body specify the Network Service Records that will be deleted") @RequestMapping( value = "/multipledelete", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.NO_CONTENT) public void multipleDelete( @RequestBody @Valid List<String> ids, @RequestHeader(value = "project-id") String projectId) throws InterruptedException, ExecutionException, WrongStatusException, NotFoundException, BadFormatException { for (String id : ids) { networkServiceRecordManagement.delete(id, projectId); } }
private void deleteRecord(String line) throws NotFoundException, WrongStatusException, BadFormatException, ExecutionException, InterruptedException { String id = extractIdFromLine(line); if (id.equals("")) return; nsrManagement.delete(id, nsrRepository.findFirstById(id).getProjectId()); }