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; } }
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; }
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; }
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(); }
public static DeleteRenderedPathInput buildDeleteRenderedServicePathInput(ServiceFunctionPathKey sfpKey) { DeleteRenderedPathInputBuilder rpInputBuilder = new DeleteRenderedPathInputBuilder(); rpInputBuilder.setName(sfpKey.getName().getValue()); return rpInputBuilder.build(); } public static ServiceFunctionChainKey getSFCKey(PortChain portChain) {
node.put(_PARENT_SERVICE_FUNCTION_PATH, rsp.getParentServiceFunctionPath().getValue());
public Ace getAce(RenderedServicePath rsp) { return getAce(rsp.getName().getValue(), rsp.getParentServiceFunctionPath().getValue(), rsp.getServiceChainName().getValue()); }
/** * 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; }
RspName rspName = new RspName(sfServicePath.getName().getValue()); SfcProviderServiceForwarderAPI.deletePathFromServiceForwarderState(rspName); rspList.add(rspName);
private RenderedServicePath createRsp(ServiceFunctionPath sfcPath, RspName rspName) { CreateRenderedPathInput rspInput = new CreateRenderedPathInputBuilder().setParentServiceFunctionPath(sfcPath.getName().getValue()) .setName(rspName.getValue()) .setSymmetric(sfcPath.isSymmetric()) .build(); return SfcProviderRenderedPathAPI.createRenderedServicePathAndState(sfcPath, rspInput); }
private RenderedServicePath createRsp(ServiceFunctionPath sfcPath, RspName rspName) { CreateRenderedPathInput rspInput = new CreateRenderedPathInputBuilder().setParentServiceFunctionPath(sfcPath.getName().getValue()) .setName(rspName.getValue()) .setSymmetric(sfcPath.isSymmetric()) .build(); return SfcProviderRenderedPathAPI.createRenderedServicePathAndState(sfcPath, rspInput); }
boolean ret = true; RspName rspNameFromSfpName = new RspName(sfpName.getValue()); RenderedServicePath renderedServicePath = SfcProviderRenderedPathAPI.readRenderedServicePath(rspNameFromSfpName);
if (serviceFunctionPath.getName() != null) { renderedServicePathBuilder .setName(new RspName(serviceFunctionPath.getName().getValue() + "-Path-" + pathId)); } else { LOG.error("{}: Failed to set RSP Name as it was null and SFP Name was null.",
RspName rspName = new RspName(sfcPath.getName().getValue() + tenantName + "-gbp-rsp"); ReadOnlyTransaction rTx = ctx.getDataBroker().newReadOnlyTransaction(); RenderedServicePath renderedServicePath;
pathName = new SfpName(pathName.getValue() + "-" + serviceTypeName); SfcServiceFunctionBuilder sfcServiceFunctionBuilder = new SfcServiceFunctionBuilder(); sfcServiceFunctionArrayList.add(sfcServiceFunctionBuilder.setName(serviceTypeName + "-gbp-sfc")