private boolean putOvsdbTerminationPoint(OvsdbBridgeAugmentation ovsdbBridge, OvsdbTerminationPointAugmentation ovsdbTerminationPoint) { Preconditions.checkNotNull(ovsdbTerminationPoint, "Cannot PUT Termination Point into OVS configuration store, OvsdbTerminationPointAugmentation is null."); return SfcDataStoreAPI.writePutTransactionAPI( SfcOvsUtil.buildOvsdbTerminationPointAugmentationIID(ovsdbBridge, ovsdbTerminationPoint), ovsdbTerminationPoint, LogicalDatastoreType.CONFIGURATION); }
public static boolean putServiceFunctionScheduleType(ServiceFunctionSchedulerType serviceFunctionSchedulerType) { boolean ret; printTraceStart(LOG); InstanceIdentifier<ServiceFunctionSchedulerType> sfstEntryIID = InstanceIdentifier.builder(ServiceFunctionSchedulerTypes.class) .child(ServiceFunctionSchedulerType.class, serviceFunctionSchedulerType.getKey()) .build(); ret = SfcDataStoreAPI.writePutTransactionAPI(sfstEntryIID, serviceFunctionSchedulerType, LogicalDatastoreType.CONFIGURATION); printTraceStop(LOG); return ret; }
public static boolean putContextMetadata(ContextMetadata md) { boolean ret; InstanceIdentifier<ContextMetadata> mdIID; printTraceStart(LOG); mdIID = InstanceIdentifier.builder(ServiceFunctionMetadata.class) .child(ContextMetadata.class, md.getKey()).build(); ret = SfcDataStoreAPI.writePutTransactionAPI(mdIID, md, LogicalDatastoreType.CONFIGURATION); printTraceStop(LOG); return ret; }
public static boolean putVariableMetadata(VariableMetadata md) { boolean ret; InstanceIdentifier<VariableMetadata> mdIID; printTraceStart(LOG); mdIID = InstanceIdentifier.builder(ServiceFunctionMetadata.class) .child(VariableMetadata.class, md.getKey()).build(); ret = SfcDataStoreAPI.writePutTransactionAPI(mdIID, md, LogicalDatastoreType.CONFIGURATION); printTraceStop(LOG); return ret; }
public static boolean putServiceFunctionType(ServiceFunctionType sft) { boolean ret; printTraceStart(LOG); InstanceIdentifier<ServiceFunctionType> sftEntryIID = InstanceIdentifier.builder(ServiceFunctionTypes.class) .child(ServiceFunctionType.class, sft.getKey()) .build(); ret = SfcDataStoreAPI.writePutTransactionAPI(sftEntryIID, sft, LogicalDatastoreType.CONFIGURATION); printTraceStop(LOG); return ret; }
/** * Puts a SFG Algorithm in the datastore <p> * @param sfgAlg the ServiceFunctionGroupAlgorithm to put * @return boolean success or failure */ protected static boolean putServiceFunctionGroupAlgorithm(ServiceFunctionGroupAlgorithm sfgAlg) { boolean ret; printTraceStart(LOG); InstanceIdentifier<ServiceFunctionGroupAlgorithm> sfgAlgEntryIID = InstanceIdentifier.builder(ServiceFunctionGroupAlgorithms.class).child(ServiceFunctionGroupAlgorithm.class, sfgAlg.getKey()).toInstance(); ret = SfcDataStoreAPI.writePutTransactionAPI(sfgAlgEntryIID, sfgAlg, LogicalDatastoreType.CONFIGURATION); printTraceStop(LOG); return ret; }
/** * Add ServiceFunctionState to datastore * <p> * * @param sfState ServiceFunctionState Object * @return true if state was added, false otherwise */ public static boolean putServiceFunctionState(ServiceFunctionState sfState) { boolean ret; printTraceStart(LOG); InstanceIdentifier<ServiceFunctionState> sfStateIID = InstanceIdentifier.builder(ServiceFunctionsState.class) .child(ServiceFunctionState.class, sfState.getKey()) .build(); ret = SfcDataStoreAPI.writePutTransactionAPI(sfStateIID, sfState, LogicalDatastoreType.OPERATIONAL); printTraceStop(LOG); return ret; }
/** * Puts a SFG in the datastore * <p> * * @param sfg the ServiceFunctionGroup to put * @return boolean success or failure */ public static boolean putServiceFunctionGroup(ServiceFunctionGroup sfg) { boolean ret; printTraceStart(LOG); InstanceIdentifier<ServiceFunctionGroup> sfgEntryIID = InstanceIdentifier.builder(ServiceFunctionGroups.class) .child(ServiceFunctionGroup.class, sfg.getKey()) .build(); ret = SfcDataStoreAPI.writePutTransactionAPI(sfgEntryIID, sfg, LogicalDatastoreType.CONFIGURATION); printTraceStop(LOG); return ret; }
/** * This method creates a SFF in the data store * <p> * * @param sff SFF object * @return true if SFF was created, false otherwise */ public static boolean putServiceFunctionForwarder(ServiceFunctionForwarder sff) { boolean ret; printTraceStart(LOG); InstanceIdentifier<ServiceFunctionForwarder> sffEntryIID = InstanceIdentifier .builder(ServiceFunctionForwarders.class).child(ServiceFunctionForwarder.class, sff.getKey()).build(); ret = SfcDataStoreAPI.writePutTransactionAPI(sffEntryIID, sff, LogicalDatastoreType.CONFIGURATION); printTraceStop(LOG); return ret; }
private String createAclForGroupComm(List<Subnet> subnets, String groupName) { String aclName = "lracl-" + groupName; //TODO, this is not right :( /* * create Access List with entries and IID, then write transaction to data store */ AccessListEntries aceList = this.createAceListFromIPv4PrefixPairs(subnets); AclBuilder aclBuilder = new AclBuilder(); aclBuilder.setAclName(aclName).setKey(new AclKey(aclName, Ipv4Acl.class)).setAccessListEntries(aceList); InstanceIdentifier<Acl> aclPath = InstanceIdentifier.builder(AccessLists.class).child(Acl.class, new AclKey(aclName, Ipv4Acl.class)).build(); boolean transactionSuccessful = SfcDataStoreAPI.writePutTransactionAPI(aclPath, aclBuilder.build(), LogicalDatastoreType.CONFIGURATION); if (!transactionSuccessful) { LOG.error("FABMGR: ERROR: createAclFromSecurityRule:writePutTransactionAPI failed"); } return aclName; }
private String createAclFromSecurityRule(SecurityRule securityRule) { String aclName = securityRule.getName().getValue(); /* * create Access List with entries and IID, then write transaction to data store */ AccessListEntries aceList = this.createAceListFromSecurityRule(securityRule); AclBuilder aclBuilder = new AclBuilder(); aclBuilder.setAclName(aclName).setKey(new AclKey(aclName, Ipv4Acl.class)).setAccessListEntries(aceList); InstanceIdentifier<Acl> aclPath = InstanceIdentifier.builder(AccessLists.class).child(Acl.class, new AclKey(aclName, Ipv4Acl.class)).build(); boolean transactionSuccessful = SfcDataStoreAPI.writePutTransactionAPI(aclPath, aclBuilder.build(), LogicalDatastoreType.CONFIGURATION); if (!transactionSuccessful) { LOG.error("FABMGR: ERROR: createAclFromSecurityRule:writePutTransactionAPI failed"); } return aclName; }
serviceFunctionStateBuilder.setName(renderedServicePathHop.getServiceFunctionName()); if (SfcDataStoreAPI.writePutTransactionAPI(sfStateIID, sfServicePathBuilder.build(), LogicalDatastoreType.OPERATIONAL)) { ret = true;
if (SfcDataStoreAPI.writePutTransactionAPI(SFT_IID, sftTypesBuilder.build(), LogicalDatastoreType.CONFIGURATION)) { LOG.info("Initialised Service Function Types");
/** * Write a flow to the DataStore * * @param nodeName - which node to write the flow to * @param flow - details of the flow to be written */ public static boolean writeFlowToDataStore(final String nodeName, FlowBuilder flow) { // Create the NodeBuilder NodeBuilder nodeBuilder = new NodeBuilder(); nodeBuilder.setId(new NodeId(nodeName)); nodeBuilder.setKey(new NodeKey(nodeBuilder.getId())); // Create the flow path, which will include the Node, Table, and Flow InstanceIdentifier<Flow> flowInstanceId = InstanceIdentifier.builder(Nodes.class) .child(Node.class, nodeBuilder.getKey()) .augmentation(FlowCapableNode.class) .child(Table.class, new TableKey(flow.getTableId())) .child(Flow.class, flow.getKey()) .build(); return SfcDataStoreAPI.writePutTransactionAPI(flowInstanceId, flow.build(), LogicalDatastoreType.CONFIGURATION); }
serviceFunctionForwarderStateBuilder.setName(renderedServicePathHop.getServiceFunctionForwarder()); if (!SfcDataStoreAPI.writePutTransactionAPI(sfStateIID, sffServicePathBuilder.build(), LogicalDatastoreType.OPERATIONAL)) { ret = false;