• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java VirtualDeploymentUnit类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.openbaton.catalogue.mano.descriptor.VirtualDeploymentUnit的典型用法代码示例。如果您正苦于以下问题:Java VirtualDeploymentUnit类的具体用法?Java VirtualDeploymentUnit怎么用?Java VirtualDeploymentUnit使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



VirtualDeploymentUnit类属于org.openbaton.catalogue.mano.descriptor包,在下文中一共展示了VirtualDeploymentUnit类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getVNFCInstance

import org.openbaton.catalogue.mano.descriptor.VirtualDeploymentUnit; //导入依赖的package包/类
/**
 * Returns the VNFCInstance with the passed ID from a specific VDU. If null is passed for the
 * VNFCInstance ID, the first VNFCInstance in the VDU is returned.
 *
 * @param virtualDeploymentUnit the VDU holding the VNFCinstance
 * @param idVNFCI the id of the VNFCInstance
 * @return the VNFCinstance
 * @throws NotFoundException if not found
 */
private VNFCInstance getVNFCInstance(VirtualDeploymentUnit virtualDeploymentUnit, String idVNFCI)
    throws NotFoundException {

  for (VNFCInstance vnfcInstance : virtualDeploymentUnit.getVnfc_instance()) {
    if (idVNFCI == null || idVNFCI.equals(vnfcInstance.getId())) {
      return vnfcInstance;
    }
  }

  if (idVNFCI != null) {
    throw new NotFoundException(
        "VNFCInstance with ID "
            + idVNFCI
            + " was not found in VDU with ID "
            + virtualDeploymentUnit.getId());
  } else {
    throw new NotFoundException(
        "No VNFCInstance found in VDU with ID " + virtualDeploymentUnit.getId());
  }
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:30,代码来源:NetworkServiceRecordManagement.java


示例2: getRuntimeDeploymentInfo

import org.openbaton.catalogue.mano.descriptor.VirtualDeploymentUnit; //导入依赖的package包/类
private Set<String> getRuntimeDeploymentInfo(DeployNSRBody body, VirtualDeploymentUnit vdu)
    throws MissingParameterException {
  Set<String> instanceNames;

  if (body == null
      || body.getVduVimInstances() == null
      || body.getVduVimInstances().get(vdu.getName()) == null
      || body.getVduVimInstances().get(vdu.getName()).isEmpty()) {
    if (vdu.getVimInstanceName() == null) {
      throw new MissingParameterException(
          "No VimInstance specified for vdu with name: " + vdu.getName());
    }
    instanceNames = vdu.getVimInstanceName();
  } else {
    instanceNames = body.getVduVimInstances().get(vdu.getName());
  }
  return instanceNames;
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:19,代码来源:NetworkServiceRecordManagement.java


示例3: delete

import org.openbaton.catalogue.mano.descriptor.VirtualDeploymentUnit; //导入依赖的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


示例4: add

import org.openbaton.catalogue.mano.descriptor.VirtualDeploymentUnit; //导入依赖的package包/类
@Override
public VirtualNetworkFunctionDescriptor add(
    VirtualNetworkFunctionDescriptor virtualNetworkFunctionDescriptor, String projectId)
    throws NotFoundException, NetworkServiceIntegrityException {
  SimpleDateFormat format = new SimpleDateFormat("yyyy.MM.dd 'at' HH:mm:ss z");
  virtualNetworkFunctionDescriptor.setCreatedAt(format.format(new Date()));
  virtualNetworkFunctionDescriptor.setUpdatedAt(format.format(new Date()));
  virtualNetworkFunctionDescriptor.setProjectId(projectId);
  if (virtualNetworkFunctionDescriptor.getVdu() == null
      || virtualNetworkFunctionDescriptor.getVdu().size() == 0)
    throw new NotFoundException("You should specify at least one VDU in each VNFD!");
  for (VirtualDeploymentUnit vdu : virtualNetworkFunctionDescriptor.getVdu()) {
    if (vdu.getVnfc() == null || vdu.getVnfc().size() == 0)
      throw new NotFoundException("You should specify at least one VNFC in each VDU!");
  }
  nsdUtils.checkIntegrity(virtualNetworkFunctionDescriptor);
  return vnfdRepository.save(virtualNetworkFunctionDescriptor);
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:19,代码来源:VirtualNetworkFunctionManagement.java


示例5: checkIntegrityVDU

import org.openbaton.catalogue.mano.descriptor.VirtualDeploymentUnit; //导入依赖的package包/类
private void checkIntegrityVDU(VirtualNetworkFunctionDescriptor virtualNetworkFunctionDescriptor)
    throws NetworkServiceIntegrityException {
  int i = 1;
  for (VirtualDeploymentUnit vdu : virtualNetworkFunctionDescriptor.getVdu()) {
    if (vdu.getVnfc() == null || vdu.getVnfc().size() == 0) {
      log.warn("Not found any VNFC in VDU of VNFD " + virtualNetworkFunctionDescriptor.getName());
    }
    if (vdu.getName() == null || vdu.getName().isEmpty()) {
      vdu.setName(virtualNetworkFunctionDescriptor.getName() + "-" + i);
      i++;
    }
    if (vdu.getVm_image() == null || vdu.getVm_image().isEmpty()) {
      throw new NetworkServiceIntegrityException(
          "At least one VDU in the VNFD "
              + virtualNetworkFunctionDescriptor.getName()
              + " does not contain an image.");
    }
    if (vdu.getName() == null || vdu.getName().equalsIgnoreCase("")) {
      vdu.setName("vdu" + i);
    }
    vdu.setProjectId(virtualNetworkFunctionDescriptor.getProjectId());
  }
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:24,代码来源:NSDUtils.java


示例6: checkIntegrityScaleInOut

import org.openbaton.catalogue.mano.descriptor.VirtualDeploymentUnit; //导入依赖的package包/类
private void checkIntegrityScaleInOut(
    VirtualNetworkFunctionDescriptor virtualNetworkFunctionDescriptor,
    VirtualDeploymentUnit virtualDeploymentUnit)
    throws NetworkServiceIntegrityException {
  if (virtualDeploymentUnit.getScale_in_out() < 1) {
    throw new NetworkServiceIntegrityException(
        "Regarding the VirtualNetworkFunctionDescriptor "
            + virtualNetworkFunctionDescriptor.getName()
            + ": in one of the VirtualDeploymentUnit, the scale_in_out"
            + " parameter ("
            + virtualDeploymentUnit.getScale_in_out()
            + ") must be at least 1");
  }
  if (virtualDeploymentUnit.getScale_in_out() < virtualDeploymentUnit.getVnfc().size()) {
    throw new NetworkServiceIntegrityException(
        "Regarding the VirtualNetworkFunctionDescriptor "
            + virtualNetworkFunctionDescriptor.getName()
            + ": in one of the VirtualDeploymentUnit, the scale_in_out"
            + " parameter ("
            + virtualDeploymentUnit.getScale_in_out()
            + ") must not be less than the number of starting "
            + "VNFComponent: "
            + virtualDeploymentUnit.getVnfc().size());
  }
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:26,代码来源:NSDUtils.java


示例7: createVirtualNetworkFunctionRecord

import org.openbaton.catalogue.mano.descriptor.VirtualDeploymentUnit; //导入依赖的package包/类
private VirtualNetworkFunctionRecord createVirtualNetworkFunctionRecord() {
  VirtualNetworkFunctionRecord virtualNetworkFunctionRecord = new VirtualNetworkFunctionRecord();
  virtualNetworkFunctionRecord.setMonitoring_parameter(
      new HashSet<String>() {
        {
          add("monitor1");
          add("monitor2");
          add("monitor3");
        }
      });
  VNFDeploymentFlavour vdf = new VNFDeploymentFlavour();
  vdf.setExtId("mocked_vdu_ext_id");
  vdf.setFlavour_key("m1.tiny");
  virtualNetworkFunctionRecord.setName("mocked_vnfr");
  virtualNetworkFunctionRecord.setDeployment_flavour_key(vdf.getFlavour_key());
  virtualNetworkFunctionRecord.setVdu(new HashSet<VirtualDeploymentUnit>());
  BaseVimInstance vimInstance = createVimInstance();
  for (int i = 1; i <= 3; i++) {
    virtualNetworkFunctionRecord.getVdu().add(createVDU(i, vimInstance));
  }
  return virtualNetworkFunctionRecord;
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:23,代码来源:VNFLifecycleOperationGrantingClassSuiteTest.java


示例8: nsrManagementDeleteTest

import org.openbaton.catalogue.mano.descriptor.VirtualDeploymentUnit; //导入依赖的package包/类
@Test
public void nsrManagementDeleteTest()
    throws VimException, InterruptedException, ExecutionException, NamingException,
        NotFoundException, WrongStatusException, PluginException, BadFormatException {
  NetworkServiceRecord nsd_exp = createNetworkServiceRecord();
  when(resourceManagement.release(any(VirtualDeploymentUnit.class), any(VNFCInstance.class)))
      .thenReturn(new AsyncResult<Void>(null));
  when(nsrRepository.findFirstByIdAndProjectId(nsd_exp.getId(), projectId)).thenReturn(nsd_exp);
  Configuration system = new Configuration();
  system.setConfigurationParameters(new HashSet<>());
  ConfigurationParameter configurationParameter = new ConfigurationParameter();
  configurationParameter.setConfKey("delete-on-all-status");
  configurationParameter.setValue("true");
  when(configurationManagement.queryByName("system")).thenReturn(system);
  nsrManagement.delete(nsd_exp.getId(), projectId);
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:17,代码来源:NetworkServiceRecordManagementClassSuiteTest.java


示例9: scaleOutTo

import org.openbaton.catalogue.mano.descriptor.VirtualDeploymentUnit; //导入依赖的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


示例10: scaleInTo

import org.openbaton.catalogue.mano.descriptor.VirtualDeploymentUnit; //导入依赖的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


示例11: createNetworkServiceDescriptor

import org.openbaton.catalogue.mano.descriptor.VirtualDeploymentUnit; //导入依赖的package包/类
private NetworkServiceDescriptor createNetworkServiceDescriptor(String vimInstanceName) {
  NetworkServiceDescriptor networkServiceDescriptor = new NetworkServiceDescriptor();
  VirtualNetworkFunctionDescriptor vnfd = new VirtualNetworkFunctionDescriptor();

  vnfd.setName("" + Math.random());
  vnfd.setType("dummy");

  VirtualDeploymentUnit vdu = new VirtualDeploymentUnit();
  vdu.setVirtual_memory_resource_element("1024");
  vdu.setVirtual_network_bandwidth_resource("1000000");
  BaseVimInstance instance = createVimInstance();
  instance.setId(null);
  instance.setName(vimInstanceName);

  vdu.setVm_image(
      new HashSet<String>() {
        {
          add("image_name_1");
        }
      });
  vdu.setScale_in_out(3);
  vdu.setMonitoring_parameter(
      new HashSet<String>() {
        {
          add("cpu_utilization");
        }
      });
  vnfd.setVdu(new HashSet<>());
  vnfd.getVdu().add(vdu);

  networkServiceDescriptor.setVnfd(new HashSet<>());
  networkServiceDescriptor.getVnfd().add(vnfd);

  networkServiceDescriptor.setVendor("fokus");
  networkServiceDescriptor.setVersion("1");
  return networkServiceDescriptor;
}
 
开发者ID:openbaton,项目名称:openbaton-client,代码行数:38,代码来源:SdkTest.java


示例12: updateSoftware

import org.openbaton.catalogue.mano.descriptor.VirtualDeploymentUnit; //导入依赖的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


示例13: allocate

import org.openbaton.catalogue.mano.descriptor.VirtualDeploymentUnit; //导入依赖的package包/类
/**
 * This operation allows requesting the instantiation and assignment of a virtualised resource to
 * the VNF, as indicated by the consumer functional block.
 */
Future<VNFCInstance> allocate(
    VimInstance vimInstance,
    VirtualDeploymentUnit vdu,
    VirtualNetworkFunctionRecord virtualNetworkFunctionRecord,
    VNFComponent vnfComponent,
    String userdata,
    Map<String, String> floatingIps,
    Set<Key> keys)
    throws VimException;
 
开发者ID:openbaton,项目名称:openbaton-libs,代码行数:14,代码来源:ResourceManagement.java


示例14: parseVDUTemplate

import org.openbaton.catalogue.mano.descriptor.VirtualDeploymentUnit; //导入依赖的package包/类
/**
 * Parser of the Virtual Deployment Unit
 *
 * @param vduTemplate
 * @param cps
 * @return
 */
private VirtualDeploymentUnit parseVDUTemplate(
    VDUNodeTemplate vduTemplate, List<CPNodeTemplate> cps) {

  VirtualDeploymentUnit vdu = new VirtualDeploymentUnit();
  vdu.setName(vduTemplate.getName());

  // ADD Settings
  vdu.setScale_in_out(vduTemplate.getProperties().getScale_in_out());
  vdu.setVm_image(vduTemplate.getArtifacts());
  if (vduTemplate.getProperties().getFault_management_policy() != null) {
    vdu.setFault_management_policy(
        vduTemplate.getProperties().getFault_management_policy().getFaultManagementPolicies());
  }

  vdu.setVimInstanceName(vduTemplate.getProperties().getVim_instance_name());

  // ADD VNF Connection Points
  Set<VNFComponent> vnfComponents = new HashSet<>();
  VNFComponent vnfc = new VNFComponent();
  Set<VNFDConnectionPoint> connectionPoints = new HashSet<>();

  for (CPNodeTemplate cp : cps) {
    if (cp.getRequirements().getVirtualBinding().contains(vduTemplate.getName())) {
      connectionPoints.add(parseCPTemplate(cp));
    }
  }

  vnfc.setConnection_point(connectionPoints);
  vnfComponents.add(vnfc);
  vdu.setVnfc(vnfComponents);

  return vdu;
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:41,代码来源:TOSCAParser.java


示例15: VnfmOrGrantLifecycleOperationMessage

import org.openbaton.catalogue.mano.descriptor.VirtualDeploymentUnit; //导入依赖的package包/类
public VnfmOrGrantLifecycleOperationMessage(
    VirtualNetworkFunctionDescriptor virtualNetworkFunctionDescriptor,
    Set<VirtualDeploymentUnit> vduSet,
    String deploymentFlavourKey) {
  this.virtualNetworkFunctionDescriptor = virtualNetworkFunctionDescriptor;
  this.vduSet = vduSet;
  this.deploymentFlavourKey = deploymentFlavourKey;
  this.action = Action.ALLOCATE_RESOURCES;
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:10,代码来源:VnfmOrGrantLifecycleOperationMessage.java


示例16: fillVnfrVnfc

import org.openbaton.catalogue.mano.descriptor.VirtualDeploymentUnit; //导入依赖的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


示例17: getVnfcId

import org.openbaton.catalogue.mano.descriptor.VirtualDeploymentUnit; //导入依赖的package包/类
private String getVnfcId() {
  for (VirtualDeploymentUnit vdu : virtualNetworkFunctionRecord.getVdu()) {
    for (VNFCInstance vnfcInstance : vdu.getVnfc_instance()) {
      if (this.vnfcInstance.getVc_id().equals(vnfcInstance.getVc_id())) {
        return vnfcInstance.getId();
      }
    }
    if (vnfcInstance.getId() != null) {
      return vnfcInstance.getId();
    }
  }
  return null;
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:14,代码来源:HealTask.java


示例18: getVnfcInSuchState

import org.openbaton.catalogue.mano.descriptor.VirtualDeploymentUnit; //导入依赖的package包/类
private VNFCInstance getVnfcInSuchState(String state) {
  for (VirtualDeploymentUnit vdu : virtualNetworkFunctionRecord.getVdu()) {
    for (VNFCInstance vnfcInstance : vdu.getVnfc_instance()) {
      if (vnfcInstance.getState() != null && vnfcInstance.getState().equals(state)) {
        return vnfcInstance;
      }
    }
  }
  return null;
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:11,代码来源:HealTask.java


示例19: VimException

import org.openbaton.catalogue.mano.descriptor.VirtualDeploymentUnit; //导入依赖的package包/类
public VimException(
    String s,
    Exception e,
    VirtualDeploymentUnit virtualDeploymentUnit,
    VNFCInstance vnfcInstance) {
  super(s, e);
  this.virtualDeploymentUnit = virtualDeploymentUnit;
  this.vnfcInstance = vnfcInstance;
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:10,代码来源:VimException.java


示例20: createVDU

import org.openbaton.catalogue.mano.descriptor.VirtualDeploymentUnit; //导入依赖的package包/类
private VirtualDeploymentUnit createVDU() {
  VirtualDeploymentUnit vdu = new VirtualDeploymentUnit();
  OpenstackVimInstance vimInstance = createVIM();
  HashSet<VNFComponent> vnfcs = new HashSet<>();
  VNFComponent vnfc = new VNFComponent();
  Set<VNFDConnectionPoint> vnfdCps = new HashSet<>();
  VNFDConnectionPoint vnfcCp = new VNFDConnectionPoint();
  vnfcCp.setVirtual_link_reference("network1");
  vnfdCps.add(vnfcCp);
  vnfc.setConnection_point(vnfdCps);
  vnfcs.add(vnfc);
  vdu.setVnfc(vnfcs);
  Set<String> monitoring_parameter = new HashSet<>();
  monitoring_parameter.add("parameter_1");
  monitoring_parameter.add("parameter_2");
  monitoring_parameter.add("parameter_3");
  vdu.setMonitoring_parameter(monitoring_parameter);
  vdu.setComputation_requirement("m1.small");
  Set<String> vm_images = new HashSet<>();
  vm_images.add("image_1234");
  vdu.setVm_image(vm_images);
  vimInstance.setFlavours(new HashSet<>());
  DeploymentFlavour deploymentFlavour = new DeploymentFlavour();
  deploymentFlavour.setExtId("ext_id");
  deploymentFlavour.setFlavour_key("m1.small");
  vimInstance.getFlavours().add(deploymentFlavour);
  return vdu;
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:29,代码来源:VimTestSuiteClass.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ObjectDeserializer类代码示例发布时间:2022-05-22
下一篇:
Java UsbHub类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap