本文整理汇总了Java中org.openbaton.catalogue.mano.record.VirtualNetworkFunctionRecord类的典型用法代码示例。如果您正苦于以下问题:Java VirtualNetworkFunctionRecord类的具体用法?Java VirtualNetworkFunctionRecord怎么用?Java VirtualNetworkFunctionRecord使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VirtualNetworkFunctionRecord类属于org.openbaton.catalogue.mano.record包,在下文中一共展示了VirtualNetworkFunctionRecord类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deactivate
import org.openbaton.catalogue.mano.record.VirtualNetworkFunctionRecord; //导入依赖的package包/类
/**
* Deactivates autoscaling for the passed NSR
*
* @param msg : NSR in payload to add for autoscaling
*/
@RequestMapping(
value = "RELEASE_RESOURCES_FINISH",
method = RequestMethod.POST,
consumes = MediaType.APPLICATION_JSON_VALUE,
produces = MediaType.APPLICATION_JSON_VALUE
)
@ResponseStatus(HttpStatus.CREATED)
public void deactivate(@RequestBody String msg) throws NotFoundException {
log.trace("msg=" + msg);
JsonParser jsonParser = new JsonParser();
JsonObject json = jsonParser.parse(msg).getAsJsonObject();
Gson mapper = new GsonBuilder().create();
Action action = mapper.fromJson(json.get("action"), Action.class);
log.trace("ACTION=" + action);
NetworkServiceRecord nsr = mapper.fromJson(json.get("payload"), NetworkServiceRecord.class);
log.trace("NSR=" + nsr);
for (VirtualNetworkFunctionRecord vnfr : nsr.getVnfr()) {
elasticityManagement.deactivate(nsr.getProjectId(), nsr.getId(), vnfr);
}
}
示例2: getDependencyForAVNFRecordTarget
import org.openbaton.catalogue.mano.record.VirtualNetworkFunctionRecord; //导入依赖的package包/类
@Override
public VNFRecordDependency getDependencyForAVNFRecordTarget(
VirtualNetworkFunctionRecord virtualNetworkFunctionRecord) {
NetworkServiceRecord nsr =
nsrRepository.findFirstById(virtualNetworkFunctionRecord.getParent_ns_id());
if (nsr.getStatus().ordinal() != Status.ERROR.ordinal()) {
Set<VNFRecordDependency> vnfRecordDependencies = nsr.getVnf_dependency();
for (VNFRecordDependency vnfRecordDependency : vnfRecordDependencies) {
vnfRecordDependency = vnfrDependencyRepository.findOne(vnfRecordDependency.getId());
if (vnfRecordDependency.getTarget().equals(virtualNetworkFunctionRecord.getName())) {
return vnfRecordDependency;
}
}
}
return null;
}
示例3: handleError
import org.openbaton.catalogue.mano.record.VirtualNetworkFunctionRecord; //导入依赖的package包/类
@Override
public void handleError(VirtualNetworkFunctionRecord virtualNetworkFunctionRecord) {
log.error("Received Error for VNFR " + virtualNetworkFunctionRecord.getName());
if (VnfmUtils.getLifecycleEvent(virtualNetworkFunctionRecord.getLifecycle_event(), Event.ERROR)
!= null) {
StringBuilder output = new StringBuilder("\n--------------------\n--------------------\n");
try {
for (String result :
lcm.executeScriptsForEvent(virtualNetworkFunctionRecord, Event.ERROR)) {
output.append(JsonUtils.parse(result));
output.append("\n--------------------\n");
}
} catch (Exception e) {
e.printStackTrace();
log.error("Exception executing Error handling");
}
output.append("\n--------------------\n");
log.info("Executed script for ERROR. Output was: \n\n" + output);
}
}
示例4: start
import org.openbaton.catalogue.mano.record.VirtualNetworkFunctionRecord; //导入依赖的package包/类
@Override
public VirtualNetworkFunctionRecord start(
VirtualNetworkFunctionRecord virtualNetworkFunctionRecord) throws Exception {
log.info("Starting vnfr: " + virtualNetworkFunctionRecord.getName());
if (VnfmUtils.getLifecycleEvent(virtualNetworkFunctionRecord.getLifecycle_event(), Event.START)
!= null) {
if (VnfmUtils.getLifecycleEvent(
virtualNetworkFunctionRecord.getLifecycle_event(), Event.START)
.getLifecycle_events()
!= null) {
StringBuilder output = new StringBuilder("\n--------------------\n--------------------\n");
for (String result :
lcm.executeScriptsForEvent(virtualNetworkFunctionRecord, Event.START)) {
output.append(JsonUtils.parse(result));
output.append("\n--------------------\n");
}
output.append("\n--------------------\n");
log.info("Executed script for START. Output was: \n\n" + output);
}
}
return virtualNetworkFunctionRecord;
}
示例5: getNotInitializedVnfrSource
import org.openbaton.catalogue.mano.record.VirtualNetworkFunctionRecord; //导入依赖的package包/类
public Set<String> getNotInitializedVnfrSource(Set<String> ids, NetworkServiceRecord nsr) {
Set<String> res = new HashSet<>();
for (String sourceName : ids) {
log.debug("Looking for VNFR name: " + sourceName);
boolean found = false;
for (VirtualNetworkFunctionRecord vnfr : nsr.getVnfr()) {
if (sourceName.equals(vnfr.getName())) {
found = true;
if (vnfr.getStatus().ordinal() < Status.INITIALIZED.ordinal())
res.add(vnfr.getName() + nsr.getId());
}
}
if (!found) res.add(sourceName + nsr.getId());
}
if (!res.isEmpty()) log.debug("There are the following not initialized vnfr sources:" + res);
return res;
}
示例6: sendStart
import org.openbaton.catalogue.mano.record.VirtualNetworkFunctionRecord; //导入依赖的package包/类
private void sendStart(VirtualNetworkFunctionRecord virtualNetworkFunctionRecord)
throws NotFoundException, BadFormatException, ExecutionException, InterruptedException {
VnfmSender vnfmSender;
vnfmSender =
this.getVnfmSender(
vnfmRegister.getVnfm(virtualNetworkFunctionRecord.getEndpoint()).getEndpointType());
log.info(
"Calling START to: "
+ virtualNetworkFunctionRecord.getName()
+ " because it has 0 dependencies");
log.trace(
"VNFR ("
+ virtualNetworkFunctionRecord.getId()
+ ") hibernate version is = "
+ virtualNetworkFunctionRecord.getHbVersion());
/*vnfmSender.sendCommand(
new OrVnfmGenericMessage(virtualNetworkFunctionRecord, Action.START),
vnfmRegister.getVnfm(virtualNetworkFunctionRecord.getEndpoint()));*/
vnfStateHandler.executeAction(
vnfmSender.sendCommand(
new OrVnfmStartStopMessage(virtualNetworkFunctionRecord, null, Action.START),
vnfmRegister.getVnfm(virtualNetworkFunctionRecord.getEndpoint())));
}
示例7: getVirtualNetworkFunctionRecords
import org.openbaton.catalogue.mano.record.VirtualNetworkFunctionRecord; //导入依赖的package包/类
/**
* Returns the list of VirtualNetworkFunctionDescriptor into a NSD with id
*
* @param id of NSD
* @return Set<VirtualNetworkFunctionDescriptor>: List of VirtualNetworkFunctionDescriptor into
* NSD
*/
@ApiOperation(
value = "Returns the Virtual Network Function Records of a NSR",
notes = "Returns all the VNFRs that are part of the specified NSR"
)
@RequestMapping(
value = "{id}/vnfrecords",
method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE
)
@ResponseStatus(HttpStatus.OK)
public Set<VirtualNetworkFunctionRecord> getVirtualNetworkFunctionRecords(
@PathVariable("id") String id, @RequestHeader(value = "project-id") String projectId)
throws NotFoundException {
NetworkServiceRecord nsr = networkServiceRecordManagement.query(id, projectId);
log.trace("*****" + nsr.getVnfr().toString());
return nsr.getVnfr();
}
示例8: requestLog
import org.openbaton.catalogue.mano.record.VirtualNetworkFunctionRecord; //导入依赖的package包/类
@Override
@Async
public Future<NFVMessage> requestLog(VirtualNetworkFunctionRecord vnfr, String hostname)
throws NotFoundException, BadFormatException, ExecutionException, InterruptedException {
VnfmManagerEndpoint endpoint = generator.getVnfm(vnfr.getEndpoint());
if (endpoint == null)
throw new NotFoundException(
"VnfManager of type "
+ vnfr.getType()
+ " (endpoint = "
+ vnfr.getEndpoint()
+ ") is not registered");
OrVnfmLogMessage orVnfmLogMessage = new OrVnfmLogMessage(vnfr.getName(), hostname);
VnfmSender vnfmSender;
try {
vnfmSender = generator.getVnfmSender(endpoint.getEndpointType());
} catch (BeansException e) {
throw new NotFoundException(e);
}
Future<NFVMessage> answerFuture = vnfmSender.sendCommand(orVnfmLogMessage, endpoint);
answerFuture.get();
NFVMessage message = answerFuture.get();
return new AsyncResult<>(message);
}
示例9: addVnfr
import org.openbaton.catalogue.mano.record.VirtualNetworkFunctionRecord; //导入依赖的package包/类
public void addVnfr(VirtualNetworkFunctionRecord vnfr) {
for (VirtualNetworkFunctionRecord vnfrAlreadyPresent : vnfrList) {
if (vnfrAlreadyPresent.getId().equals(vnfr.getId())) {
return;
}
}
vnfrList.add(vnfr);
}
示例10: instantiate
import org.openbaton.catalogue.mano.record.VirtualNetworkFunctionRecord; //导入依赖的package包/类
@Override
public VirtualNetworkFunctionRecord instantiate(
VirtualNetworkFunctionRecord virtualNetworkFunctionRecord,
Object scripts,
Map<String, Collection<VimInstance>> vimInstances)
throws Exception {
return virtualNetworkFunctionRecord;
}
示例11: heal
import org.openbaton.catalogue.mano.record.VirtualNetworkFunctionRecord; //导入依赖的package包/类
@Override
public VirtualNetworkFunctionRecord heal(
VirtualNetworkFunctionRecord virtualNetworkFunctionRecord,
VNFCInstance component,
String cause)
throws Exception {
return virtualNetworkFunctionRecord;
}
示例12: resume
import org.openbaton.catalogue.mano.record.VirtualNetworkFunctionRecord; //导入依赖的package包/类
@Override
public VirtualNetworkFunctionRecord resume(
VirtualNetworkFunctionRecord virtualNetworkFunctionRecord,
VNFCInstance vnfcInstance,
VNFRecordDependency dependency)
throws Exception {
return virtualNetworkFunctionRecord;
}
示例13: scale
import org.openbaton.catalogue.mano.record.VirtualNetworkFunctionRecord; //导入依赖的package包/类
@Override
public VirtualNetworkFunctionRecord scale(
Action scaleInOrOut,
VirtualNetworkFunctionRecord virtualNetworkFunctionRecord,
VNFComponent component,
Object scripts,
VNFRecordDependency dependency)
throws Exception {
return virtualNetworkFunctionRecord;
}
示例14: 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);
}
}
示例15: 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);
}
}