当前位置: 首页>>代码示例>>Java>>正文


Java VirtualNetworkFunctionRecord.getVdu方法代码示例

本文整理汇总了Java中org.openbaton.catalogue.mano.record.VirtualNetworkFunctionRecord.getVdu方法的典型用法代码示例。如果您正苦于以下问题:Java VirtualNetworkFunctionRecord.getVdu方法的具体用法?Java VirtualNetworkFunctionRecord.getVdu怎么用?Java VirtualNetworkFunctionRecord.getVdu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.openbaton.catalogue.mano.record.VirtualNetworkFunctionRecord的用法示例。


在下文中一共展示了VirtualNetworkFunctionRecord.getVdu方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: delete

import org.openbaton.catalogue.mano.record.VirtualNetworkFunctionRecord; //导入方法依赖的package包/类
@Override
public void delete(String id, String projectId) throws NotFoundException, BadRequestException {

  BaseVimInstance vimInstance = vimRepository.findFirstByIdAndProjectId(id, projectId);
  if (vimInstance == null) {
    throw new NotFoundException("Vim Instance with id " + id + " was not found");
  }
  if (checkForVimInVnfr) {
    for (VirtualNetworkFunctionRecord vnfr : vnfrRepository.findByProjectId(projectId)) {
      for (VirtualDeploymentUnit vdu : vnfr.getVdu()) {
        if (vdu.getVimInstanceName().contains(vimInstance.getName())) {
          throw new BadRequestException(
              "Cannot delete VIM Instance " + vimInstance.getName() + " while it is in use.");
        }
      }
    }
  }
  vimRepository.delete(vimInstance);
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:20,代码来源:VimManagement.java

示例2: getLog

import org.openbaton.catalogue.mano.record.VirtualNetworkFunctionRecord; //导入方法依赖的package包/类
@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");
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:24,代码来源:LogManagement.java

示例3: getVnfcInstance

import org.openbaton.catalogue.mano.record.VirtualNetworkFunctionRecord; //导入方法依赖的package包/类
private VNFCInstance getVnfcInstance(
    VirtualNetworkFunctionRecord virtualNetworkFunctionRecord, VNFComponent component) {
  VNFCInstance vnfcInstance_new = null;
  boolean found = false;
  for (VirtualDeploymentUnit virtualDeploymentUnit : virtualNetworkFunctionRecord.getVdu()) {
    for (VNFCInstance vnfcInstance : virtualDeploymentUnit.getVnfc_instance()) {
      if (vnfcInstance.getVnfComponent().getId().equals(component.getId())) {
        vnfcInstance_new = vnfcInstance;
        fillProvidesVNFC(virtualNetworkFunctionRecord, vnfcInstance);
        found = true;
        log.debug("VNFComponentInstance FOUND : " + vnfcInstance_new.getVnfComponent());
        break;
      }
    }
    if (found) {
      break;
    }
  }
  return vnfcInstance_new;
}
 
开发者ID:openbaton,项目名称:openbaton-libs,代码行数:21,代码来源:AbstractVnfm.java

示例4: terminate

import org.openbaton.catalogue.mano.record.VirtualNetworkFunctionRecord; //导入方法依赖的package包/类
@Override
public VirtualNetworkFunctionRecord terminate(
    VirtualNetworkFunctionRecord virtualNetworkFunctionRecord) {
  log.debug("RELEASE_RESOURCES");
  log.info("Releasing resources for VNFR: " + virtualNetworkFunctionRecord.getName());
  log.trace("Verison is: " + virtualNetworkFunctionRecord.getHbVersion());
  List<Event> events = new ArrayList<>();

  for (LifecycleEvent event : virtualNetworkFunctionRecord.getLifecycle_event()) {
    events.add(event.getEvent());
  }

  if (events.contains(Event.RELEASE)) {
    for (VirtualDeploymentUnit vdu : virtualNetworkFunctionRecord.getVdu())
      log.debug("Removing vdu: " + vdu);

    try {
      Thread.sleep(1000 + ((int) (Math.random() * 4000)));
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
  }
  return virtualNetworkFunctionRecord;
}
 
开发者ID:openbaton,项目名称:dummy-vnfm-amqp,代码行数:25,代码来源:DummyAMQPVNFManager.java

示例5: terminate

import org.openbaton.catalogue.mano.record.VirtualNetworkFunctionRecord; //导入方法依赖的package包/类
@Override
public VirtualNetworkFunctionRecord terminate(
    VirtualNetworkFunctionRecord virtualNetworkFunctionRecord) {
  log.debug("RELEASE_RESOURCES");
  log.info("Releasing resources for VNFR: " + virtualNetworkFunctionRecord.getName());
  log.trace("Verison is: " + virtualNetworkFunctionRecord.getHb_version());
  List<Event> events = new ArrayList<>();

  for (LifecycleEvent event : virtualNetworkFunctionRecord.getLifecycle_event()) {
    events.add(event.getEvent());
  }

  if (events.contains(Event.RELEASE)) {
    for (VirtualDeploymentUnit vdu : virtualNetworkFunctionRecord.getVdu())
      log.debug("Removing vdu: " + vdu);

    try {
      Thread.sleep(1000 + ((int) (Math.random() * 4000)));
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
  }
  return virtualNetworkFunctionRecord;
}
 
开发者ID:openbaton,项目名称:dummy-vnfm-rest,代码行数:25,代码来源:DummyRestVNFManager.java

示例6: scaleOutTo

import org.openbaton.catalogue.mano.record.VirtualNetworkFunctionRecord; //导入方法依赖的package包/类
public void scaleOutTo(String projectId, VirtualNetworkFunctionRecord vnfr, int value)
    throws SDKException, NotFoundException, VimException {
  int vnfci_counter = 0;
  for (VirtualDeploymentUnit vdu : vnfr.getVdu()) {
    vnfci_counter += vdu.getVnfc_instance().size();
  }
  for (int i = vnfci_counter + 1; i <= value; i++) {
    scaleOut(projectId, vnfr, 1);
  }
}
 
开发者ID:openbaton,项目名称:autoscaling-engine,代码行数:11,代码来源:ExecutionEngine.java

示例7: scaleInTo

import org.openbaton.catalogue.mano.record.VirtualNetworkFunctionRecord; //导入方法依赖的package包/类
public void scaleInTo(String projectId, VirtualNetworkFunctionRecord vnfr, int value)
    throws SDKException, NotFoundException, VimException {
  int vnfci_counter = 0;
  for (VirtualDeploymentUnit vdu : vnfr.getVdu()) {
    vnfci_counter += vdu.getVnfc_instance().size();
  }
  for (int i = vnfci_counter; i > value; i--) {
    scaleIn(projectId, vnfr, 1);
  }
}
 
开发者ID:openbaton,项目名称:autoscaling-engine,代码行数:11,代码来源:ExecutionEngine.java

示例8: updateSoftware

import org.openbaton.catalogue.mano.record.VirtualNetworkFunctionRecord; //导入方法依赖的package包/类
@Override
public VirtualNetworkFunctionRecord updateSoftware(
    Script script, VirtualNetworkFunctionRecord virtualNetworkFunctionRecord) throws Exception {
  for (VirtualDeploymentUnit vdu : virtualNetworkFunctionRecord.getVdu()) {
    for (VNFCInstance vnfcInstance : vdu.getVnfc_instance()) {
      updateScript(script, virtualNetworkFunctionRecord, vnfcInstance);
    }
  }
  return virtualNetworkFunctionRecord;
}
 
开发者ID:openbaton,项目名称:generic-vnfm,代码行数:11,代码来源:GenericVNFM.java

示例9: terminate

import org.openbaton.catalogue.mano.record.VirtualNetworkFunctionRecord; //导入方法依赖的package包/类
@Override
public VirtualNetworkFunctionRecord terminate(
    VirtualNetworkFunctionRecord virtualNetworkFunctionRecord) throws Exception {
  log.debug("Termination of VNF: " + virtualNetworkFunctionRecord.getName());
  if (VnfmUtils.getLifecycleEvent(
          virtualNetworkFunctionRecord.getLifecycle_event(), Event.TERMINATE)
      != null) {
    StringBuilder output = new StringBuilder("\n--------------------\n--------------------\n");
    for (String result :
        lcm.executeScriptsForEvent(virtualNetworkFunctionRecord, Event.TERMINATE)) {
      output.append(JsonUtils.parse(result));
      output.append("\n--------------------\n");
    }
    output.append("\n--------------------\n");
    log.info("Executed script for TERMINATE. Output was: \n\n" + output);
  }

  for (VirtualDeploymentUnit vdu : virtualNetworkFunctionRecord.getVdu()) {
    for (VNFCInstance vnfci : vdu.getVnfc_instance()) {
      try {
        ems.removeRegistrationUnit(vnfci.getHostname());
      } catch (BadFormatException e) {
        e.printStackTrace();
      }
    }
  }

  return virtualNetworkFunctionRecord;
}
 
开发者ID:openbaton,项目名称:generic-vnfm,代码行数:30,代码来源:GenericVNFM.java

示例10: getVNFCHostname

import org.openbaton.catalogue.mano.record.VirtualNetworkFunctionRecord; //导入方法依赖的package包/类
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;
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:13,代码来源:RestNetworkServiceRecord.java

示例11: deleteVNFCInstance

import org.openbaton.catalogue.mano.record.VirtualNetworkFunctionRecord; //导入方法依赖的package包/类
@Override
public void deleteVNFCInstance(String id, String idVnf, String idVdu, String projectId)
    throws NotFoundException, WrongStatusException, InterruptedException, ExecutionException,
        VimException, PluginException, BadFormatException {
  log.info("Removing VNFCInstance from VNFR with id: " + idVnf + " in vdu: " + idVdu);
  NetworkServiceRecord networkServiceRecord = getNetworkServiceRecordInActiveState(id, projectId);
  VirtualNetworkFunctionRecord virtualNetworkFunctionRecord =
      getVirtualNetworkFunctionRecord(idVnf, networkServiceRecord);
  if (!virtualNetworkFunctionRecord.getProjectId().equals(projectId)) {
    throw new UnauthorizedUserException(
        "VNFR not under the project chosen, are you trying to hack us? Just kidding, it's a bug :)");
  }

  VirtualDeploymentUnit virtualDeploymentUnit = null;

  for (VirtualDeploymentUnit vdu : virtualNetworkFunctionRecord.getVdu()) {
    if (vdu.getId().equals(idVdu)
        && vdu.getProjectId() != null
        && vdu.getProjectId().equals(projectId)) {
      virtualDeploymentUnit = vdu;
    }
  }

  if (virtualDeploymentUnit == null) {
    throw new NotFoundException("No VirtualDeploymentUnit found");
  }

  if (virtualDeploymentUnit.getVnfc_instance().size() == 1) {
    throw new WrongStatusException(
        "The VirtualDeploymentUnit chosen has reached the minimum number of VNFCInstance");
  }

  VNFCInstance vnfcInstance = getVNFCInstance(virtualDeploymentUnit, null);

  networkServiceRecord.setStatus(Status.SCALING);
  networkServiceRecord = nsrRepository.saveCascade(networkServiceRecord);
  scaleIn(
      networkServiceRecord, virtualNetworkFunctionRecord, virtualDeploymentUnit, vnfcInstance);
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:40,代码来源:NetworkServiceRecordManagement.java

示例12: getVirtualDeploymentUnit

import org.openbaton.catalogue.mano.record.VirtualNetworkFunctionRecord; //导入方法依赖的package包/类
private VirtualDeploymentUnit getVirtualDeploymentUnit(
    String idVdu, VirtualNetworkFunctionRecord virtualNetworkFunctionRecord)
    throws NotFoundException {
  VirtualDeploymentUnit virtualDeploymentUnit = null;
  for (VirtualDeploymentUnit virtualDeploymentUnit1 : virtualNetworkFunctionRecord.getVdu()) {
    if (virtualDeploymentUnit1.getId().equals(idVdu)) {
      virtualDeploymentUnit = virtualDeploymentUnit1;
    }
  }
  if (virtualDeploymentUnit == null) {
    throw new NotFoundException("No VirtualDeploymentUnit found with id " + idVdu);
  }
  return virtualDeploymentUnit;
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:15,代码来源:NetworkServiceRecordManagement.java

示例13: fillVnfrVnfc

import org.openbaton.catalogue.mano.record.VirtualNetworkFunctionRecord; //导入方法依赖的package包/类
/**
 * Fill the Map vnfrVnfc.
 *
 * @param nsr
 */
private void fillVnfrVnfc(NetworkServiceRecord nsr) {
  for (VirtualNetworkFunctionRecord vnfr : nsr.getVnfr()) {
    List<VNFCRepresentation> representationList = new LinkedList<>();
    Configuration conf = vnfr.getConfigurations();
    Map<String, String> confMap = new HashMap<>();
    for (ConfigurationParameter confPar : conf.getConfigurationParameters()) {
      confMap.put(confPar.getConfKey(), confPar.getValue());
    }
    for (VirtualDeploymentUnit vdu : vnfr.getVdu()) {
      for (VNFCInstance vnfcInstance : vdu.getVnfc_instance()) {
        VNFCRepresentation vnfcRepresentation = new VNFCRepresentation();
        vnfcRepresentation.setVnfrName(vnfr.getName());
        vnfcRepresentation.setHostname(vnfcInstance.getHostname());
        vnfcRepresentation.setConfiguration(confMap);
        for (Ip ip : vnfcInstance.getIps()) {
          vnfcRepresentation.addNetIp(ip.getNetName(), ip.getIp());
        }
        for (Ip fIp : vnfcInstance.getFloatingIps()) {
          vnfcRepresentation.addNetFip(fIp.getNetName(), fIp.getIp());
        }
        representationList.add(vnfcRepresentation);
      }
    }
    if (!vnfrVnfc.containsKey(vnfr.getType())) {
      vnfrVnfc.put(vnfr.getType(), representationList);
    } else {
      List<VNFCRepresentation> l = vnfrVnfc.get(vnfr.getType());
      l.addAll(representationList);
    }
  }
}
 
开发者ID:openbaton,项目名称:integration-tests,代码行数:37,代码来源:GenericServiceTester.java

示例14: getNumberOfVNFCInstances

import org.openbaton.catalogue.mano.record.VirtualNetworkFunctionRecord; //导入方法依赖的package包/类
private int getNumberOfVNFCInstances(String nsrId, String vnfrId)
    throws IOException, SDKException, IntegrationTestException {
  int num = 0;
  NetworkServiceRecordAgent agent = requestor.getNetworkServiceRecordAgent();
  VirtualNetworkFunctionRecord vnfr = agent.getVirtualNetworkFunctionRecord(nsrId, vnfrId);

  for (VirtualDeploymentUnit vdu : vnfr.getVdu()) {
    num += vdu.getVnfc_instance().size();
  }
  return num;
}
 
开发者ID:openbaton,项目名称:integration-tests,代码行数:12,代码来源:ScalingTester.java

示例15: status

import org.openbaton.catalogue.mano.record.VirtualNetworkFunctionRecord; //导入方法依赖的package包/类
/**
 * Checks the lifecycle status of the NSR referenced by the occi-Id.
 * If the creation is completed all public and private ip's of the
 * vnfds are returned as well.
 *
 * @param response HttpServletResponse object containing to be returned header
 * @param headers HttpHeaders object containing the request headers
 * @return simple OK
 * @throws SDKException
 */
@RequestMapping(value = "/default", method = RequestMethod.GET)
@ResponseStatus(HttpStatus.OK)
public String status(HttpServletResponse response, @RequestHeader HttpHeaders headers) throws SDKException {
    String occiId = getOcciId(headers);
    log.debug("Received status request for instance " + occiId);

    if (occiId != null) {
        Stack stack = stacks.get(occiId);

        if (Objects.equals(stack.getStatus(), "CREATE_COMPLETE")) {
            for (VirtualNetworkFunctionRecord record : stack.getVirtualNFRs()) {
                // TODO: proper formatting, this may also go in the return header!
                String attributePrefix = occiProperties.getPrefix() + ".";
                String endpoint = "";

                for (VirtualDeploymentUnit vdu : record.getVdu()) {
                    for (VNFCInstance vnfc : vdu.getVnfc_instance()) {
                        // Get all private Ip's
                        for (Ip privateIp : vnfc.getIps()) {
                            response.addHeader("X-OCCI-Attribute", attributePrefix + record.getName() + "." +
                                    privateIp.getNetName() + ".private=\"" + privateIp.getIp() + "\"");
                            endpoint = "\"" + privateIp.getIp() + "\"";
                        }
                        // Get all public Ip's
                        for (Ip publicIp : vnfc.getFloatingIps()) {
                            response.addHeader("X-OCCI-Attribute", attributePrefix + record.getName() + "." +
                                    publicIp.getNetName() + ".public=\"" + publicIp.getIp() + "\"");
                            endpoint = "\"" + publicIp.getIp() + "\"";
                        }
                    }
                }
                // Set "endpoint" Ip, private if no public Ip's were found, public otherwise.
                response.addHeader("X-OCCI-Attribute", attributePrefix + record.getName() + "=" + endpoint);
            }
        }
        response.addHeader("X-OCCI-Attribute", "occi.stack.state=\"" + stack.getStatus() + "\"");
        response.addHeader("X-OCCI-Attribute", "occi.stack.id=\"" + stack.getCount() + "\"");
        response.addHeader("X-OCCI-Attribute", "occi.core.id=\"" + apiPath + "default\"");
    }
    return "OK";
}
 
开发者ID:MobileCloudNetworking,项目名称:OpenBaton-OCCI,代码行数:52,代码来源:OcciControler.java


注:本文中的org.openbaton.catalogue.mano.record.VirtualNetworkFunctionRecord.getVdu方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。