public static ServiceFunctionChainKey getSFCKey(PortChain portChain) { return new ServiceFunctionChainKey(new SfcName(portChain.getName())); }
private List<String> getSymetricChainNames(ActionInstance action) { List<String> chainNames = new ArrayList<>(); for (ParameterValue param : action.getParameterValue()) { if (param.getStringValue() != null && param.getName().getValue().equals(ChainActionDefinition.SFC_CHAIN_NAME)) { String chainName = param.getStringValue(); ServiceFunctionPath sfcPath = ChainAction.getSfcPath(new SfcName(chainName)); if (sfcPath == null || sfcPath.getName() == null) { continue; } if (sfcPath.isSymmetric()) { chainNames.add(param.getStringValue()); } } } return chainNames; }
.add(sfcbuilder.setName(new SfcName("Chain-1")).setSfcServiceFunction(sfcServiceFunctionArrayList).build());
private void getSfcChain() { ParameterValue pv = getChainNameParameter(actionInstance.getParameterValue()); if (pv == null) return; LOG.trace("Invoking RPC for chain {}", pv.getStringValue()); SfcName chainName=new SfcName(pv.getStringValue()); ServiceFunctionChain chain = SfcProviderServiceChainAPI.readServiceFunctionChain(chainName); ServiceFunctionPaths paths = SfcProviderServicePathAPI.readAllServiceFunctionPaths(); for(ServiceFunctionPath path: paths.getServiceFunctionPath()) { if(path.getServiceChainName().equals(chainName)) { LOG.info("Found path {} for chain {}",path.getName(),path.getServiceChainName()); } } } }
ServiceFunctionPath sfcPath = getSfcPath(new SfcName(sfcChainName)); if (sfcPath == null || sfcPath.getName() == null) { LOG.error("ULN: ERROR: addSfcChain: SFC Path was invalid. Either null or name was null.", sfcPath);
public static ServiceFunctionChain buildServiceFunctionChain( PortChain portChain, List<ServiceFunction> sfList) { ServiceFunctionChainBuilder sfcBuilder = new ServiceFunctionChainBuilder(); sfcBuilder.setName(new SfcName(portChain.getName())); sfcBuilder.setKey(new ServiceFunctionChainKey(sfcBuilder.getName()));
sfRefList.add(sfBuilder.setName("napt44-abstract1").setType(new SftTypeName("napt44")).build()); res = putChain(new SfcName("SFC1"), sfRefList) && res; sfRefList.add(sfBuilder.setName("napt44-abstract2").setType(new SftTypeName("napt44")).build()); res = putChain(new SfcName("SFC2"), sfRefList) && res;
private ValidationResult isValidGbpChain(List<ParameterValue> paramValue) { ParameterValue pv = getChainNameParameter(paramValue); if (pv == null) { return new ValidationResultBuilder().failed().setMessage( "Chain parameter {" + paramValue + "} not found!").build(); } SfcName sfcName = new SfcName(pv.getStringValue()); LOG.trace("isValidGbpChain: Invoking RPC for chain {}", pv.getStringValue()); ServiceFunctionChain chain = SfcProviderServiceChainAPI.readServiceFunctionChain(sfcName); if (chain != null){ return new ValidationResultBuilder().success().build(); } else { return new ValidationResultBuilder().failed().setMessage( "Chain named {" + pv.getStringValue() + "} not found in config DS.").build(); } }
SfcName sfcName = new SfcName("chain-sfc-gbp"); SfpName pathName = new SfpName("path-sfc-gbp"); ServiceFunctionChain serviceFunctionChain; return null; sfcName = new SfcName(sfcName.getValue() + "-" + serviceTypeName); pathName = new SfpName(pathName.getValue() + "-" + serviceTypeName); SfcServiceFunctionBuilder sfcServiceFunctionBuilder = new SfcServiceFunctionBuilder();
ServiceFunctionPath sfcPath = getSfcPath(new SfcName(chainName)); if (sfcPath == null || sfcPath.getName() == null) { LOG.error("updateAction: SFC Path was invalid. Either null or name was null.", sfcPath);