public IpAddress getSfIpAddress(String sfname) { ServiceFunction serviceFunction = SfcProviderServiceFunctionAPI.readServiceFunction(SfName.getDefaultInstance(sfname)); if (serviceFunction == null) { LOG.info("Failed to read ServiceFunction: {}", sfname); return null; } return getSfIpAddress(serviceFunction); }
List<RspName> rspList = SfcProviderServiceFunctionAPI.getRspsBySfName(sfName); if ((rspList != null) && (!rspList.isEmpty())) { if (SfcProviderServiceFunctionAPI.deleteServiceFunctionState(sfName)) { } else { LOG.error("{}: Failed to delete SF {} operational state", SfcProviderServiceFunctionAPI.readServiceFunctionState(sfName); List<RspName> rspList = new ArrayList<>(); if ((sfServicePathList != null) && (!sfServicePathList.isEmpty())) { if (!SfcProviderServiceFunctionAPI.deleteServiceFunctionState(sfName)) { LOG.error("{}: Failed to delete SF {} operational state", Thread.currentThread().getStackTrace()[1], sfName);
ServiceFunction serviceFunction = SfcProviderServiceFunctionAPI.readServiceFunction(sfName); if (serviceFunction == null) { LOG.error("ServiceFunction {} doesn't exist", sfName); SfcSfDescMon sfcSfDescMon = SfcProviderServiceFunctionAPI.readServiceFunctionDescriptionMonitor(sfName); if (sfcSfDescMon == null) {
&& SfcProviderServiceFunctionAPI.addPathToServiceFunctionState(renderedServicePath)) { .addRenderedPathToServicePathState(createdServiceFunctionPath.getName(), renderedServicePath.getName()))) { SfcProviderServiceFunctionAPI .deleteServicePathFromServiceFunctionState(createdServiceFunctionPath.getName()); SfcProviderServiceForwarderAPI.deletePathFromServiceForwarderState(createdServiceFunctionPath); if (renderedServicePath != null) {
ret = SfcProviderServiceFunctionAPI.mergeServiceFunctionState(serviceFunctionState); } else { ret = SfcProviderServiceFunctionAPI.putServiceFunctionState(serviceFunctionState);
.deleteServicePathFromServiceFunctionState(new SfpName(rspName.getValue())); rspList.add(rspName); .deleteServicePathFromServiceFunctionState(new SfpName(rspName.getValue())); rspList.add(rspName);
ServiceFunction sf = SfcNetconfServiceFunctionAPI.buildServiceFunctionFromNetconf( sfNodeName, descInfo.getDataPlaneIp(), descInfo.getDataPlanePort(), sfType); if (SfcProviderServiceFunctionAPI.putServiceFunction(sf)) { LOG.info("Successfully created SF from Netconf node {}", nodeName); SfcNetconfServiceFunctionAPI.putServiceFunctionDescription(descInfo, sfNodeName);
&& SfcProviderServiceFunctionAPI.addPathToServiceFunctionState(revRenderedServicePath)) { .deleteServicePathFromServiceFunctionState(new SfpName(revRenderedServicePath.getName().getValue())); SfcProviderServiceForwarderAPI.deletePathFromServiceForwarderState(revRenderedServicePath.getName()); SfcProviderRenderedPathAPI.deleteRenderedServicePath(revRenderedServicePath.getName());
ret = SfcProviderServiceFunctionAPI.mergeServiceFunctionState(serviceFunctionState); } else { ret = SfcProviderServiceFunctionAPI.putServiceFunctionState(serviceFunctionState);
SfcProviderServiceFunctionAPI.deleteServicePathFromServiceFunctionState(new SfpName(input.getName()));
private SfName getServiceFunctionByType(ServiceFunctionType serviceFunctionType) { List<SftServiceFunctionName> sftServiceFunctionNameList = serviceFunctionType.getSftServiceFunctionName(); int maxTries = sftServiceFunctionNameList.size(); Random rad = new Random(); ServiceFunction serviceFunction = null; SfName serviceFunctionName = null; int start = rad.nextInt(sftServiceFunctionNameList.size()); while (maxTries > 0) { serviceFunctionName = new SfName(sftServiceFunctionNameList.get(start).getName()); serviceFunction = SfcProviderServiceFunctionAPI.readServiceFunction(serviceFunctionName); if (serviceFunction != null) { break; } else { LOG.debug("ServiceFunction {} doesn't exist", serviceFunctionName); maxTries--; serviceFunctionName = null; start = (start + 1) % sftServiceFunctionNameList.size(); } } if (serviceFunctionName == null) { LOG.error("Could not find an existing ServiceFunction for {}", serviceFunctionType.getType()); } return serviceFunctionName; }
@Override protected void setRestUriList(DataObject dataObject) { ServiceFunctionState obj = (ServiceFunctionState) dataObject; this.restUriList = new ArrayList<>(); if (SfcProviderServiceFunctionAPI.readServiceFunction(obj.getName())!=null) { ServiceFunction serviceFunction = SfcProviderServiceFunctionAPI.readServiceFunction(obj.getName()); if (serviceFunction.getRestUri() != null) { SfName sfName = obj.getName(); if (sfName != null) { String restUri = serviceFunction.getRestUri().getValue() + SFSTATE_REST_URI + sfName.getValue(); this.restUriList.add(restUri); LOG.info("Service Function state will be sent to REST URI {}", restUri); } } else { this.restUriList = null; } } else { this.restUriList = null; } }
.readServiceFunction(new SfName(sfg.getSfcServiceFunction().get(0).getName())); if (serviceFunction == null) { LOG.error("Could not find suitable SF in data store by name: {}", for (SfName serviceFunctionName : serviceFunctionNameList) { ServiceFunction serviceFunction = SfcProviderServiceFunctionAPI.readServiceFunction(serviceFunctionName); if (serviceFunction == null) { LOG.error("Could not find suitable SF in data store by name: {}", serviceFunctionName);
SfcProviderServiceFunctionAPI.readServiceFunction(hop.getServiceFunctionName()); if (serviceFunction == null) { LOG.warn("handleRenderedServicePath: Could not identify ServiceFunction {} on {}",
} else { SfName sfName = new SfName(serviceName); ServiceFunction serviceFunction = SfcProviderServiceFunctionAPI.readServiceFunction(sfName); List<SfDataPlaneLocator> listOfDPL = serviceFunction.getSfDataPlaneLocator(); for (SfDataPlaneLocator sfdpl : listOfDPL) {