本文整理汇总了Java中org.openbaton.catalogue.mano.common.VNFDeploymentFlavour类的典型用法代码示例。如果您正苦于以下问题:Java VNFDeploymentFlavour类的具体用法?Java VNFDeploymentFlavour怎么用?Java VNFDeploymentFlavour使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
VNFDeploymentFlavour类属于org.openbaton.catalogue.mano.common包,在下文中一共展示了VNFDeploymentFlavour类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDeploymentFlavourConverted
import org.openbaton.catalogue.mano.common.VNFDeploymentFlavour; //导入依赖的package包/类
public Set<VNFDeploymentFlavour> getDeploymentFlavourConverted() throws NotFoundException {
Set<VNFDeploymentFlavour> vnfdf = new HashSet<>();
if (deploymentFlavour != null) {
for (HashMap<String, String> df : this.deploymentFlavour) {
for (String key : df.keySet()) {
if (key.equals("flavour_key")) {
VNFDeploymentFlavour new_df = new VNFDeploymentFlavour();
new_df.setFlavour_key(df.get("flavour_key"));
vnfdf.add(new_df);
}
}
}
} else throw new NotFoundException("Please specify a deployment flavor!");
return vnfdf;
}
示例2: OrVnfmInstantiateMessage
import org.openbaton.catalogue.mano.common.VNFDeploymentFlavour; //导入依赖的package包/类
public OrVnfmInstantiateMessage(
VirtualNetworkFunctionDescriptor vnfd,
VNFDeploymentFlavour vnfdf,
String vnfInstanceName,
Set<VirtualLinkRecord> vlrs,
Map<String, String> extension,
Map<String, Collection<BaseVimInstance>> vimInstances,
Set<Key> keys,
VNFPackage vnfPackage) {
this.vnfd = vnfd;
this.keys = keys;
this.vnfdf = vnfdf;
this.vnfInstanceName = vnfInstanceName;
this.vlrs = vlrs;
this.extension = extension;
this.vimInstances = vimInstances;
this.action = Action.INSTANTIATE;
this.vnfPackage = vnfPackage;
}
示例3: createVirtualNetworkFunctionRecord
import org.openbaton.catalogue.mano.common.VNFDeploymentFlavour; //导入依赖的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;
}
示例4: OrVnfmInstantiateMessage
import org.openbaton.catalogue.mano.common.VNFDeploymentFlavour; //导入依赖的package包/类
public OrVnfmInstantiateMessage(
VirtualNetworkFunctionDescriptor vnfd,
VNFDeploymentFlavour vnfdf,
String vnfInstanceName,
Set<VirtualLinkRecord> vlrs,
Map<String, String> extension,
Map<String, Collection<VimInstance>> vimInstances,
Set<Key> keys,
VNFPackage vnfPackage) {
this.vnfd = vnfd;
this.keys = keys;
this.vnfdf = vnfdf;
this.vnfInstanceName = vnfInstanceName;
this.vlrs = vlrs;
this.extension = extension;
this.vimInstances = vimInstances;
this.action = Action.INSTANTIATE;
this.vnfPackage = vnfPackage;
}
示例5: getVnfdFromResource
import org.openbaton.catalogue.mano.common.VNFDeploymentFlavour; //导入依赖的package包/类
/**
* Instead of creating VNFs in each "create*"-method this method will be
* used in the future
*/
public VirtualNetworkFunctionDescriptor getVnfdFromResource(OpenBatonService openBaton) {
MME mme = (MME) openBaton;
VirtualNetworkFunctionDescriptor tmpVnfd = new VirtualNetworkFunctionDescriptor();
tmpVnfd.setConfigurations(mme.getConfiguration());
Set<VNFDeploymentFlavour> flavourSet = new HashSet<VNFDeploymentFlavour>();
flavourSet.add(mme.getDeploymentFlavour());
tmpVnfd.setDeployment_flavour(flavourSet);
tmpVnfd.setEndpoint(mme.getEndpoint());
tmpVnfd.setLifecycle_event(mme.getLifecycleEvents());
tmpVnfd.setCyclicDependency(true);
tmpVnfd.setHb_version(2);
tmpVnfd.setName(mme.getServiceName() + new Random().nextInt());
tmpVnfd.setType(mme.getType());
tmpVnfd.setVendor(mme.getVendor());
tmpVnfd.setVersion(mme.getVersion());
tmpVnfd.setVdu(mme.getVduSet());
tmpVnfd.setVirtual_link(mme.getVirtualLinkSet());
return tmpVnfd;
}
示例6: createVNFR
import org.openbaton.catalogue.mano.common.VNFDeploymentFlavour; //导入依赖的package包/类
private VirtualNetworkFunctionRecord createVNFR() {
VirtualNetworkFunctionRecord vnfr = new VirtualNetworkFunctionRecord();
vnfr.setName("testVnfr");
vnfr.setStatus(Status.INITIALIZED);
vnfr.setAudit_log("audit_log");
vnfr.setDescriptor_reference("test_dr");
VNFDeploymentFlavour deployment_flavour = new VNFDeploymentFlavour();
deployment_flavour.setFlavour_key("m1.small");
vnfr.setDeployment_flavour_key("m1.small");
return vnfr;
}
示例7: createMME
import org.openbaton.catalogue.mano.common.VNFDeploymentFlavour; //导入依赖的package包/类
public VirtualNetworkFunctionDescriptor createMME(OpenBatonService openBaton) {
checkRequestor();
MME mme = (MME) openBaton;
VirtualNetworkFunctionDescriptor tmpVnfd = new VirtualNetworkFunctionDescriptor();
tmpVnfd.setConfigurations(mme.getConfiguration());
Set<VNFDeploymentFlavour> flavourSet = new HashSet<VNFDeploymentFlavour>();
flavourSet.add(mme.getDeploymentFlavour());
tmpVnfd.setDeployment_flavour(flavourSet);
tmpVnfd.setEndpoint(mme.getEndpoint());
tmpVnfd.setLifecycle_event(mme.getLifecycleEvents());
tmpVnfd.setCyclicDependency(true);
tmpVnfd.setHb_version(2);
tmpVnfd.setName(mme.getServiceName() + new Random().nextInt());
tmpVnfd.setType(mme.getType());
tmpVnfd.setVendor(mme.getVendor());
tmpVnfd.setVersion(mme.getVersion());
tmpVnfd.setVdu(mme.getVduSet());
tmpVnfd.setVirtual_link(mme.getVirtualLinkSet());
try {
VirtualNetworkFunctionDescriptor createdMME = nfvoRequestor.getNetworkServiceDescriptorAgent()
.createVNFD(null, tmpVnfd);
LOGGER.log(Level.SEVERE, "MME CREATED");
return createdMME;
} catch (SDKException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return null;
}
}
示例8: getDeployment_flavour
import org.openbaton.catalogue.mano.common.VNFDeploymentFlavour; //导入依赖的package包/类
public Set<VNFDeploymentFlavour> getDeployment_flavour() {
return deployment_flavour;
}
示例9: setDeployment_flavour
import org.openbaton.catalogue.mano.common.VNFDeploymentFlavour; //导入依赖的package包/类
public void setDeployment_flavour(Set<VNFDeploymentFlavour> deployment_flavour) {
this.deployment_flavour = deployment_flavour;
}
示例10: getVnfdf
import org.openbaton.catalogue.mano.common.VNFDeploymentFlavour; //导入依赖的package包/类
public VNFDeploymentFlavour getVnfdf() {
return vnfdf;
}
示例11: setVnfdf
import org.openbaton.catalogue.mano.common.VNFDeploymentFlavour; //导入依赖的package包/类
public void setVnfdf(VNFDeploymentFlavour vnfdf) {
this.vnfdf = vnfdf;
}
示例12: createFlavorIfNotExisting
import org.openbaton.catalogue.mano.common.VNFDeploymentFlavour; //导入依赖的package包/类
public void createFlavorIfNotExisting(
BaseVimInstance vimInstance, VirtualNetworkFunctionRecord virtualNetworkFunctionRecord)
throws VimException, PluginException {
org.openbaton.nfvo.vim_interfaces.vim.Vim vim = vimBroker.getVim(vimInstance.getType());
log.info(
"Checking if Flavor "
+ virtualNetworkFunctionRecord.getDeployment_flavour_key()
+ " exists...");
if (vimInstance instanceof OpenstackVimInstance) {
boolean flavorExist = false;
for (DeploymentFlavour flavour : ((OpenstackVimInstance) vimInstance).getFlavours()) {
if (flavour
.getFlavour_key()
.equals(virtualNetworkFunctionRecord.getDeployment_flavour_key())) {
flavorExist = true;
}
}
if (!flavorExist) {
log.debug(
"Not found Flavor "
+ virtualNetworkFunctionRecord.getDeployment_flavour_key()
+ " on VIM "
+ vimInstance.getName()
+ ". Creating it... ");
VirtualNetworkFunctionDescriptor vnfd =
vnfdRepository.findOne(virtualNetworkFunctionRecord.getDescriptor_reference());
for (VNFDeploymentFlavour vnfDeploymentFlavour : vnfd.getDeployment_flavour()) {
if (vnfDeploymentFlavour
.getFlavour_key()
.equals(virtualNetworkFunctionRecord.getDeployment_flavour_key())) {
if (!(vnfDeploymentFlavour.getDisk() == 0
|| vnfDeploymentFlavour.getRam() == 0
|| vnfDeploymentFlavour.getVcpus() == 0)) {
DeploymentFlavour flavor = vim.add(vimInstance, vnfDeploymentFlavour);
((OpenstackVimInstance) vimInstance).getFlavours().add(flavor);
log.info("Created new Flavor -> " + flavor);
try {
vimManagement.refresh(vimInstance, true).get();
} catch (Exception e) {
throw new VimException(e.getMessage(), e);
}
} else {
throw new VimException(
"Not found DeploymentFlavour with name "
+ virtualNetworkFunctionRecord.getDeployment_flavour_key()
+ " on VimInstance "
+ vimInstance.getName()
+ ". Providing additional information allows to create the Flavor on demand.");
}
}
}
}
} else {
log.warn("Flavor creation is supported for OpenStack only at the moment");
}
}
示例13: createVirtualNetworkFunctionDescriptor
import org.openbaton.catalogue.mano.common.VNFDeploymentFlavour; //导入依赖的package包/类
private VirtualNetworkFunctionDescriptor createVirtualNetworkFunctionDescriptor() {
VirtualNetworkFunctionDescriptor virtualNetworkFunctionDescriptor =
new VirtualNetworkFunctionDescriptor();
virtualNetworkFunctionDescriptor.setType("test");
virtualNetworkFunctionDescriptor.setProjectId(projectId);
virtualNetworkFunctionDescriptor.setEndpoint("test");
virtualNetworkFunctionDescriptor.setName("" + ((int) (Math.random() * 10000)));
virtualNetworkFunctionDescriptor.setMonitoring_parameter(new HashSet<String>());
virtualNetworkFunctionDescriptor.getMonitoring_parameter().add("monitor1");
virtualNetworkFunctionDescriptor.getMonitoring_parameter().add("monitor2");
virtualNetworkFunctionDescriptor.getMonitoring_parameter().add("monitor3");
virtualNetworkFunctionDescriptor.setAuto_scale_policy(new HashSet<AutoScalePolicy>());
virtualNetworkFunctionDescriptor.setConnection_point(new HashSet<ConnectionPoint>());
virtualNetworkFunctionDescriptor.setVirtual_link(new HashSet<InternalVirtualLink>());
virtualNetworkFunctionDescriptor.setLifecycle_event(new HashSet<LifecycleEvent>());
virtualNetworkFunctionDescriptor.setDeployment_flavour(
new HashSet<VNFDeploymentFlavour>() {
{
VNFDeploymentFlavour vdf = new VNFDeploymentFlavour();
vdf.setExtId("ext_id");
vdf.setFlavour_key("flavor_name");
add(vdf);
}
});
virtualNetworkFunctionDescriptor.setVdu(
new HashSet<VirtualDeploymentUnit>() {
{
VirtualDeploymentUnit vdu = new VirtualDeploymentUnit();
vdu.setVm_image(
new HashSet<String>() {
{
add("mocked_image");
}
});
HighAvailability highAvailability = new HighAvailability();
highAvailability.setRedundancyScheme("1:N");
highAvailability.setResiliencyLevel(ResiliencyLevel.ACTIVE_STANDBY_STATELESS);
vdu.setHigh_availability(highAvailability);
vdu.setComputation_requirement("high_requirements");
vdu.setVnfc(new HashSet<VNFComponent>());
vdu.setLifecycle_event(new HashSet<LifecycleEvent>());
vdu.setMonitoring_parameter(
new HashSet<String>() {
{
add("monitor1");
add("monitor2");
add("monitor3");
}
});
BaseVimInstance vimInstance = new OpenstackVimInstance();
vimInstance.setName("vim_instance");
vimInstance.setType("test");
Set<String> vimInstanceNames = new LinkedHashSet<>();
vimInstanceNames.add("vim_instance");
vdu.setVimInstanceName(vimInstanceNames);
add(vdu);
}
});
return virtualNetworkFunctionDescriptor;
}
示例14: createNetworkServiceRecord
import org.openbaton.catalogue.mano.common.VNFDeploymentFlavour; //导入依赖的package包/类
private NetworkServiceRecord createNetworkServiceRecord() {
final NetworkServiceRecord nsr = new NetworkServiceRecord();
nsr.setVendor("FOKUS");
nsr.setProjectId(projectId);
nsr.setStatus(Status.ACTIVE);
nsr.setMonitoring_parameter(new HashSet<String>());
nsr.getMonitoring_parameter().add("monitor1");
nsr.getMonitoring_parameter().add("monitor2");
nsr.getMonitoring_parameter().add("monitor3");
HashSet<VirtualNetworkFunctionRecord> virtualNetworkFunctionRecords = new HashSet<>();
VirtualNetworkFunctionRecord virtualNetworkFunctionRecord = new VirtualNetworkFunctionRecord();
virtualNetworkFunctionRecord.setName("mocked_vnfr_name");
virtualNetworkFunctionRecord.setType("test");
virtualNetworkFunctionRecord.setMonitoring_parameter(
new HashSet<String>() {
{
add("monitor1");
add("monitor2");
add("monitor3");
}
});
VNFDeploymentFlavour vdf = new VNFDeploymentFlavour();
vdf.setExtId("ext_id");
vdf.setFlavour_key("flavor_name");
virtualNetworkFunctionRecord.setDeployment_flavour_key(vdf.getFlavour_key());
virtualNetworkFunctionRecord.setVdu(
new HashSet<VirtualDeploymentUnit>() {
{
VirtualDeploymentUnit vdu = new VirtualDeploymentUnit();
HighAvailability highAvailability = new HighAvailability();
highAvailability.setRedundancyScheme("1:N");
highAvailability.setResiliencyLevel(ResiliencyLevel.ACTIVE_STANDBY_STATELESS);
vdu.setHigh_availability(highAvailability);
vdu.setVm_image(
new HashSet<String>() {
{
add("mocked_image");
}
});
vdu.setComputation_requirement("high_requirements");
vdu.setVnfc(new HashSet<VNFComponent>());
vdu.setVnfc_instance(new HashSet<VNFCInstance>());
vdu.setLifecycle_event(new HashSet<LifecycleEvent>());
vdu.setMonitoring_parameter(
new HashSet<String>() {
{
add("monitor1");
add("monitor2");
add("monitor3");
}
});
BaseVimInstance vimInstance = new OpenstackVimInstance();
vimInstance.setName("vim_instance");
vimInstance.setType("test");
add(vdu);
}
});
virtualNetworkFunctionRecords.add(virtualNetworkFunctionRecord);
nsr.setVnfr(virtualNetworkFunctionRecords);
return nsr;
}
示例15: getVirtualNetworkFunctionDescriptor
import org.openbaton.catalogue.mano.common.VNFDeploymentFlavour; //导入依赖的package包/类
private VirtualNetworkFunctionDescriptor getVirtualNetworkFunctionDescriptor() {
VirtualNetworkFunctionDescriptor virtualNetworkFunctionDescriptor =
new VirtualNetworkFunctionDescriptor();
virtualNetworkFunctionDescriptor.setName("" + ((int) (Math.random() * 1000)));
virtualNetworkFunctionDescriptor.setEndpoint("test");
virtualNetworkFunctionDescriptor.setType("type");
virtualNetworkFunctionDescriptor.setMonitoring_parameter(
new HashSet<String>() {
{
add("monitor1");
add("monitor2");
add("monitor3");
}
});
virtualNetworkFunctionDescriptor.setDeployment_flavour(
new HashSet<VNFDeploymentFlavour>() {
{
VNFDeploymentFlavour vdf = new VNFDeploymentFlavour();
vdf.setExtId("ext_id");
vdf.setFlavour_key("flavor_name");
add(vdf);
}
});
virtualNetworkFunctionDescriptor.setVdu(
new HashSet<VirtualDeploymentUnit>() {
{
VirtualDeploymentUnit vdu = new VirtualDeploymentUnit();
HighAvailability highAvailability = new HighAvailability();
highAvailability.setRedundancyScheme("1:N");
highAvailability.setResiliencyLevel(ResiliencyLevel.ACTIVE_STANDBY_STATELESS);
vdu.setHigh_availability(highAvailability);
vdu.setComputation_requirement("high_requirements");
BaseVimInstance vimInstance = new OpenstackVimInstance();
vimInstance.setName("vim_instance");
vimInstance.setType("test");
Set<VNFComponent> vnfcs = new HashSet<VNFComponent>();
VNFComponent vnfc = new VNFComponent();
VNFDConnectionPoint vnfdConnectionPoint = new VNFDConnectionPoint();
vnfdConnectionPoint.setFloatingIp("random");
Set<VNFDConnectionPoint> cps = new HashSet<VNFDConnectionPoint>();
cps.add(vnfdConnectionPoint);
vnfc.setConnection_point(cps);
vnfcs.add(vnfc);
vdu.setVnfc(vnfcs);
add(vdu);
}
});
virtualNetworkFunctionDescriptor.setVnfPackageLocation("http://an.ip.here.com");
return virtualNetworkFunctionDescriptor;
}