private String getVNFCHostname(NetworkServiceRecord nsr, String vnfcId) { for (VirtualNetworkFunctionRecord vnfr : nsr.getVnfr()) { for (VirtualDeploymentUnit vdu : vnfr.getVdu()) { for (VNFCInstance vnfcInstance : vdu.getVnfc_instance()) { if (vnfcInstance.getId().equals(vnfcId)) { return vnfcInstance.getHostname(); } } } } return null; }
@Override @Async public Future<Void> operate(VirtualDeploymentUnit vdu, String operation) throws PluginException, ExecutionException, InterruptedException, VimException { for (VNFCInstance vnfcInstance : vdu.getVnfc_instance()) { BaseVimInstance vimInstance = vimInstanceRepository.findFirstById(vnfcInstance.getVim_id()); org.openbaton.nfvo.vim_interfaces.resource_management.ResourceManagement vim = vimBroker.getVim(vimInstance.getType()); log.info("rebuilding vnfcInstance: " + vnfcInstance.getHostname()); vim.operate(vimInstance, vdu, vnfcInstance, operation).get(); } return new AsyncResult<>(null); }
@Override public VnfmOrLogMessage getLog(String nsrId, String vnfrName, String hostname) throws NotFoundException, InterruptedException, BadFormatException, ExecutionException { for (VirtualNetworkFunctionRecord virtualNetworkFunctionRecord : networkServiceRecordRepository.findFirstById(nsrId).getVnfr()) { if (virtualNetworkFunctionRecord.getName().equals(vnfrName)) { for (VirtualDeploymentUnit virtualDeploymentUnit : virtualNetworkFunctionRecord.getVdu()) { for (VNFCInstance vnfcInstance : virtualDeploymentUnit.getVnfc_instance()) { if (hostname.equals(vnfcInstance.getHostname())) { log.debug("Requesting log from VNFM"); Future<NFVMessage> futureMessage = vnfmManager.requestLog(virtualNetworkFunctionRecord, hostname); VnfmOrLogMessage vnfmOrLogMessage = (VnfmOrLogMessage) futureMessage.get(); return vnfmOrLogMessage; } } } } } throw new NotFoundException("Error something was not found"); } }
found = true; vnfcInstance_nfvo.setHostname(vnfcInstance_manager.getHostname()); vnfcInstance_nfvo.setVim_id(vnfcInstance_manager.getVim_id()); vnfcInstance_nfvo.setVc_id(vnfcInstance_manager.getVc_id());
+ vnfcInstance.getId() + " - HOSTNAME: " + vnfcInstance.getHostname() + " - STATE: " + vnfcInstance.getState() + vnfcInstanceToStartStop.getId() + " - " + vnfcInstanceToStartStop.getHostname()); break; case STOP: + vnfcInstanceToStartStop.getId() + " - " + vnfcInstanceToStartStop.getHostname()); break;
.get(vnfcInstance.getId()) .getParameters() .put("hostname", vnfcInstance.getHostname());
vnfcDP.getParameters().put("hostname", vnfcInstance.getHostname());
for (VirtualDeploymentUnit vdu : virtualNetworkFunctionRecord.getVdu()) { for (VNFCInstance vnfcInstanceTmp : vdu.getVnfc_instance()) { if (vnfcInstanceTmp.getHostname().equals(vnfcInstance.getHostname()) && vnfcInstanceTmp.getVim_id().equals(vnfcInstance.getVim_id())) { if (vnfcInstanceTmp.getState() == null vnfcDP.getParameters().put("hostname", vnfcInstance.getHostname());
for (VNFCInstance instanceInVNFR : vdu.getVnfc_instance()) { log.debug("VNFCInstance: " + instanceInVNFR.getHostname());
log.debug( "The vnfcInstance: " + vnfcInstance.getHostname() + " is set to '" + vnfcInstance.getState()