private ObjectNode getSfServicePathObjectNode(SfServicePath sfServicePath) { if (sfServicePath == null) { return null; } ObjectNode sfServicePathNode = mapper.createObjectNode(); if (sfServicePath.getName() != null && sfServicePath.getName().getValue() != null) { sfServicePathNode.put(_NAME, sfServicePath.getName().getValue()); } if (sfServicePath.getStatisticByTimestamp() != null) { ArrayNode serviceStatisticsNode = getStatisticByTimestampObjectNode(sfServicePath.getStatisticByTimestamp()); sfServicePathNode.put(_SERVICE_STATISTICS_BY_TIMESTAMP, serviceStatisticsNode); } return sfServicePathNode; } }
RspName rspName = new RspName(sffServicePath.getName().getValue()); .deleteServicePathFromServiceFunctionState(new SfpName(rspName.getValue())); rspList.add(rspName); RspName rspName = new RspName(sffServicePath.getName().getValue()); .deleteServicePathFromServiceFunctionState(new SfpName(rspName.getValue())); rspList.add(rspName);
public static ServiceFunctionPathKey getSFPKey(PortChain portChain) { return new ServiceFunctionPathKey(new SfpName(SFP_NAME_PREFIX + portChain.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(); }
public RenderedServicePath getRspforSfp(String sfpName) { RenderedServicePath rspFound = null; RenderedServicePaths rsps = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, this.getRspsId()); if (rsps != null) { for (RenderedServicePath rsp : rsps.getRenderedServicePath()) { if (rsp.getParentServiceFunctionPath() != null) { if (rsp.getParentServiceFunctionPath().getValue().equals(sfpName)) { rspFound = rsp; } } } } return rspFound; }
RspName rspName = new RspName(serviceFunctionPath.getName().getValue()); RenderedServicePath renderedServicePath = SfcProviderRenderedPathAPI .readRenderedServicePath(new RspName(serviceFunctionPath.getName().getValue())); if (sffNameSet.add(sffName)) { SffServicePathKey sffServicePathKey = new SffServicePathKey(new SfpName(rspName.getValue())); ServiceFunctionForwarderStateKey serviceFunctionForwarderStateKey = new ServiceFunctionForwarderStateKey(sffName);
if (sffNameSet.add(sffname)) { SffServicePathKey sffServicePathKey = new SffServicePathKey(new SfpName(rspName.getValue())); ServiceFunctionForwarderStateKey serviceFunctionForwarderStateKey = new ServiceFunctionForwarderStateKey(sffname);
public RenderedServicePath getRspforSfp(String sfpName) { RenderedServicePath rspFound = null; RenderedServicePaths rsps = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, this.getRspsId()); if (rsps != null) { for (RenderedServicePath rsp : rsps.getRenderedServicePath()) { if (rsp.getParentServiceFunctionPath() != null) { if (rsp.getParentServiceFunctionPath().getValue().equals(sfpName)) { rspFound = rsp; } } } } return rspFound; }
boolean ret = true; RspName rspNameFromSfpName = new RspName(sfpName.getValue()); RenderedServicePath renderedServicePath = SfcProviderRenderedPathAPI.readRenderedServicePath(rspNameFromSfpName); RspName rspName = renderedServicePath.getName(); SfpName sfpNameFromRspName = new SfpName(rspName.getValue()); SfServicePathKey sfServicePathKey = new SfServicePathKey(sfpNameFromRspName); SfServicePathBuilder sfServicePathBuilder = new SfServicePathBuilder();
public static CreateRenderedPathInput buildCreateRenderedServicePathInput(ServiceFunctionPath sfp) { CreateRenderedPathInputBuilder rpInputBuilder = new CreateRenderedPathInputBuilder(); rpInputBuilder.setName(sfp.getName().getValue()); rpInputBuilder.setSymmetric(sfp.isSymmetric()); rpInputBuilder.setParentServiceFunctionPath(sfp.getName().getValue()); return rpInputBuilder.build(); }
SfpName pathName = new SfpName("path-sfc-gbp"); ServiceFunctionChain serviceFunctionChain; boolean ret; pathName = new SfpName(pathName.getValue() + "-" + serviceTypeName); SfcServiceFunctionBuilder sfcServiceFunctionBuilder = new SfcServiceFunctionBuilder(); sfcServiceFunctionArrayList.add(sfcServiceFunctionBuilder.setName(serviceTypeName + "-gbp-sfc")
SfpName sfpName = new SfpName(renderedServicePath.getName().getValue()); SfServicePathKey sfServicePathKey = new SfServicePathKey(sfpName); SfServicePathBuilder sfServicePathBuilder = new SfServicePathBuilder();
public static DeleteRenderedPathInput buildDeleteRenderedServicePathInput(ServiceFunctionPathKey sfpKey) { DeleteRenderedPathInputBuilder rpInputBuilder = new DeleteRenderedPathInputBuilder(); rpInputBuilder.setName(sfpKey.getName().getValue()); return rpInputBuilder.build(); } public static ServiceFunctionChainKey getSFCKey(PortChain portChain) {
SfcProviderServiceFunctionAPI.deleteServicePathFromServiceFunctionState(new SfpName(input.getName()));
node.put(_PARENT_SERVICE_FUNCTION_PATH, rsp.getParentServiceFunctionPath().getValue());
.readServiceFunctionPath(new SfpName(createRenderedPathInput.getParentServiceFunctionPath()));
public Ace getAce(RenderedServicePath rsp) { return getAce(rsp.getName().getValue(), rsp.getParentServiceFunctionPath().getValue(), rsp.getServiceChainName().getValue()); }
.deleteServicePathFromServiceFunctionState(new SfpName(revRenderedServicePath.getName().getValue())); SfcProviderServiceForwarderAPI.deletePathFromServiceForwarderState(revRenderedServicePath.getName()); SfcProviderRenderedPathAPI.deleteRenderedServicePath(revRenderedServicePath.getName());
/** * This method reads the operational state for a service function. * <p> * * @param serviceFunctionName SF name * @return A ServiceFunctionState object that is a list of all paths using * this service function, null otherwise */ public static List<RspName> getRspsBySfName(SfName serviceFunctionName) { printTraceStart(LOG); List<SfServicePath> sfServicePathList; List<RspName> rspList = new ArrayList<>(); ServiceFunctionStateKey serviceFunctionStateKey = new ServiceFunctionStateKey(serviceFunctionName); InstanceIdentifier<ServiceFunctionState> sfStateIID = InstanceIdentifier.builder(ServiceFunctionsState.class) .child(ServiceFunctionState.class, serviceFunctionStateKey) .build(); ServiceFunctionState dataSfcStateObject = SfcDataStoreAPI.readTransactionAPI(sfStateIID, LogicalDatastoreType.OPERATIONAL); if (dataSfcStateObject != null) { sfServicePathList = dataSfcStateObject.getSfServicePath(); for (SfServicePath sfServicePath : sfServicePathList) { RspName rspName = new RspName(sfServicePath.getName().getValue()); rspList.add(rspName); } } else { LOG.warn("getRspsBySfName() Service Function {} has no operational state", serviceFunctionName); } printTraceStop(LOG); return rspList; }