public static ServiceFunctionChainKey getSFCKey(PortChain portChain) { return new ServiceFunctionChainKey(new SfcName(portChain.getName())); }
public ServiceFunctionPath getSfp(String sfcName) { ServiceFunctionPath sfpFound = null; ServiceFunctionPaths sfps = SfcProviderServicePathAPI.readAllServiceFunctionPaths(); if (sfps != null) { for (ServiceFunctionPath sfp: sfps.getServiceFunctionPath()) { if (sfp.getServiceChainName().getValue().equalsIgnoreCase(sfcName)) { sfpFound = sfp; } } } return sfpFound; }
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()); } } } }
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();
public static ServiceFunctionPath getSfcPath(SfcName chainName) { ServiceFunctionPaths paths = SfcProviderServicePathAPI.readAllServiceFunctionPaths(); if (paths != null) { for (ServiceFunctionPath path : paths.getServiceFunctionPath()) { if (path.getServiceChainName().equals(chainName)) { return path; } } } return null; }
private ServiceFunctionPath getSfcPath(SfcName chainName) { ServiceFunctionPaths paths = SfcProviderServicePathAPI.readAllServiceFunctionPaths(); for (ServiceFunctionPath path : paths.getServiceFunctionPath()) { if (path.getServiceChainName().equals(chainName)) { return path; } } return null; }
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; }
public ServiceFunctionPath getSfp(String redirectSfc) { ServiceFunctionPath sfpFound = null; ServiceFunctionPaths sfps = SfcProviderServicePathAPI.readAllServiceFunctionPaths(); if (sfps != null) { for (ServiceFunctionPath sfp: sfps.getServiceFunctionPath()) { if (sfp.getServiceChainName().getValue().equalsIgnoreCase(redirectSfc)) { sfpFound = sfp; } } } return sfpFound; }
.add(sfcbuilder.setName(new SfcName("Chain-1")).setSfcServiceFunction(sfcServiceFunctionArrayList).build());
public Ace getAce(RenderedServicePath rsp) { return getAce(rsp.getName().getValue(), rsp.getParentServiceFunctionPath().getValue(), rsp.getServiceChainName().getValue()); }
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);
node.put(_SERVICE_CHAIN_NAME, rsp.getServiceChainName().getValue());
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()));
public static ServiceFunctionPath buildServiceFunctionPath(ServiceFunctionChain sfc) { Preconditions.checkNotNull(sfc, "Service Function Chain must not be null"); ServiceFunctionPathBuilder sfpBuilder = new ServiceFunctionPathBuilder(); //Set the name sfpBuilder.setName(new SfpName(SFP_NAME_PREFIX + sfc.getName().getValue())); sfpBuilder.setSymmetric(sfc.isSymmetric()); //Set related SFC name sfpBuilder.setServiceChainName(sfc.getName()); return sfpBuilder.build(); }
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(); } }
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);