public void run() { if (username.contains(".")) { String[] pluginId = username.split(Pattern.quote(".")); if (pluginId.length == 3 && pluginId[0].equals("vim-drivers")) { String vimType = pluginId[1]; log.debug(String.format("Refreshing vims of type %s", vimType)); vimRepository .findByType(vimType) .stream() .parallel() .forEach( vim -> { try { vimManagement.refresh(vim, false).get(); } catch (VimException | PluginException | IOException | InterruptedException | ExecutionException e) { e.printStackTrace(); log.warn( String.format( "Error while refreshing vim %s of type %s after plugin registration", vim.getName(), vim.getType())); } }); } } } };
/** * Returns the refreshed Datacenter selected by id * * @param id: The Datacenter's id selected * @return Datacenter: The Datacenter selected */ @ApiOperation( value = "Refreshes the data about the Vim Instance", notes = "Refreshes the data about the Vim Instance and returns it") @RequestMapping(value = "{id}/refresh", method = RequestMethod.GET) public BaseVimInstance refresh( @PathVariable("id") String id, @RequestHeader(value = "project-id") String projectId) throws VimException, PluginException, IOException, NotFoundException, ExecutionException, InterruptedException { BaseVimInstance vimInstance = vimManagement.query(id, projectId); if (vimInstance == null) throw new NotFoundException("VIM Instance with ID " + id + " not found."); vimManagement.refresh(vimInstance, true).get(); return vimInstance; } }
vimInstance = vimManagement.refresh(vimInstance, true).get(); imageChecker.checkImageStatus(vimInstance);
log.info("Created new Flavor -> " + flavor); try { vimManagement.refresh(vimInstance, true).get(); } catch (Exception e) { throw new VimException(e.getMessage(), e);
vnfcInstance.getVim_id(), projectId); if (!vimInstance.getType().equals("test")) { vimManagement.refresh(vimInstance, false).get(); if (VimInstanceUtils.findActiveImagesByName(vimInstance, imageName).size() == 0) throw new NotFoundException(