@Override public void addVnfr( NetworkServiceRecord networkServiceRecord, VirtualNetworkFunctionDescriptor vnfd, DeployNSRBody body, Map<String, Set<String>> vduVimInstances, String monitoringIp) throws NotFoundException, InterruptedException, BadFormatException, ExecutionException { NetworkServiceDescriptor nsd = nsdRepository.findFirstByIdAndProjectId( networkServiceRecord.getDescriptor_reference(), networkServiceRecord.getProjectId()); vnfStateHandler.handleVNF(nsd, networkServiceRecord, body, vduVimInstances, vnfd, monitoringIp); }
/** * Trigger the restart of the NSR after the upgrade of the VNFR * * @param nsrId * @param vnfrId * @param projectId * @throws NotFoundException * @throws BadFormatException * @throws ExecutionException * @throws InterruptedException */ @Override public void upgradeVnfr(String nsrId, String vnfrId, String projectId) throws NotFoundException, BadFormatException, ExecutionException, InterruptedException { NetworkServiceRecord nsr = nsrRepository.findFirstByIdAndProjectId(nsrId, projectId); NetworkServiceDescriptor nsd = nsdRepository.findFirstById(nsr.getDescriptor_reference()); setNsrRestartRequired(projectId, nsrId); // Create ordered list of VNFR to be restarted vnfrNames.put(nsrId, new HashMap<>()); Map<String, Integer> vnfrNamesWeighted = vnfrNames.get(nsrId); fillVnfrNames(nsd, vnfrNamesWeighted); vnfrNames.put(nsrId, sortByValue(vnfrNamesWeighted)); log.debug("VNFRs ordered by dependencies: " + vnfrNames.get(nsrId)); }
log.debug("looking for NSD with id: " + networkServiceRecord.getDescriptor_reference()); if (virtualNetworkFunctionRecord.getStatus().ordinal() != Status.TERMINATED.ordinal() && nsdRepository .findFirstById(networkServiceRecord.getDescriptor_reference()) .getVnfd() .size() .findFirstById(networkServiceRecord.getDescriptor_reference()) .getVnfd() .size()
networkServiceRecord.getDescriptor_reference(), projectId);
NetworkServiceDescriptor networkServiceDescriptor = networkServiceDescriptorRepository.findFirstById( networkServiceRecord.getDescriptor_reference());
if (nsr.getDescriptor_reference().equals(id)) { if (nsr.getStatus().ordinal() != Status.ACTIVE.ordinal()) { throw new WrongStatusException(