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()); } } } }
serviceFunctionChain = SfcProviderServiceChainAPI.readServiceFunctionChain(sfcName); sfcBuilder.setName(sfcName).setSfcServiceFunction(sfcServiceFunctionArrayList); serviceFunctionChain = sfcBuilder.build(); ret = SfcProviderServiceChainAPI.putServiceFunctionChain(serviceFunctionChain); if (!ret) { LOG.error("Failed to create ServiceFunctionChain: {}", sfcName);
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 serviceFunctionChainName = serviceFunctionPath.getServiceChainName(); serviceFunctionChain = serviceFunctionChainName != null ? SfcProviderServiceChainAPI .readServiceFunctionChain(serviceFunctionChainName) : null; if (serviceFunctionChain == null) { LOG.error("ServiceFunctionChain name for Path {} not provided", serviceFunctionPath.getName());