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); }
ServiceFunction serviceFunction = SfcProviderServiceFunctionAPI.readServiceFunction(sfName); if (serviceFunction == null) { LOG.error("ServiceFunction {} doesn't exist", sfName);
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) {