private boolean deleteOvsdbTerminationPoint(InstanceIdentifier<TerminationPoint> ovsdbTerminationPointIID) { Preconditions.checkNotNull(ovsdbTerminationPointIID, "Cannot DELETE Termination Point from OVS configuration store, InstanceIdentifier<TerminationPoint> is null."); return SfcDataStoreAPI.deleteTransactionAPI(ovsdbTerminationPointIID, LogicalDatastoreType.CONFIGURATION); }
private boolean deleteOvsdbNode(InstanceIdentifier<Node> ovsdbNodeIID) { Preconditions.checkNotNull(ovsdbNodeIID, "Cannot DELETE OVS Node from OVS configuration store, InstanceIdentifier<Node> is null."); return SfcDataStoreAPI.deleteTransactionAPI(ovsdbNodeIID, LogicalDatastoreType.CONFIGURATION); }
InstanceIdentifier.builder(ServiceFunctionsState.class).build(); SfcDataStoreAPI.deleteTransactionAPI(SFC_IID, LogicalDatastoreType.CONFIGURATION); SfcDataStoreAPI.deleteTransactionAPI(SCF_IID, LogicalDatastoreType.CONFIGURATION); SfcDataStoreAPI.deleteTransactionAPI(SFT_IID, LogicalDatastoreType.CONFIGURATION); SfcDataStoreAPI.deleteTransactionAPI(SF_IID, LogicalDatastoreType.CONFIGURATION); SfcDataStoreAPI.deleteTransactionAPI(SFG_IID, LogicalDatastoreType.CONFIGURATION); SfcDataStoreAPI.deleteTransactionAPI(SFF_IID, LogicalDatastoreType.CONFIGURATION); SfcDataStoreAPI.deleteTransactionAPI(SFP_IID, LogicalDatastoreType.CONFIGURATION); SfcDataStoreAPI.deleteTransactionAPI(rspIid, LogicalDatastoreType.OPERATIONAL); SfcDataStoreAPI.deleteTransactionAPI(aclIid, LogicalDatastoreType.CONFIGURATION); SfcDataStoreAPI.deleteTransactionAPI(sfstIid, LogicalDatastoreType.CONFIGURATION); SfcDataStoreAPI.deleteTransactionAPI(sfstateIid, LogicalDatastoreType.OPERATIONAL);
private void removeAclFromDatastore(String aclName) { InstanceIdentifier<Acl> aclPath = InstanceIdentifier.builder(AccessLists.class).child(Acl.class, new AclKey(aclName, Ipv4Acl.class)).build(); boolean transactionSuccessful = SfcDataStoreAPI.deleteTransactionAPI(aclPath, LogicalDatastoreType.CONFIGURATION); if (!transactionSuccessful) { LOG.error("FABMGR: ERROR: removeAclFromDatastore: deleteTransactionAPI failed: {}", aclName); } }
public static boolean deleteVariableMetadata (String mdName) { boolean ret = false; InstanceIdentifier<VariableMetadata> mdIID; printTraceStart(LOG); VariableMetadataKey mdKey = new VariableMetadataKey(mdName); mdIID = InstanceIdentifier.builder(ServiceFunctionMetadata.class) .child(VariableMetadata.class, mdKey).build(); if (SfcDataStoreAPI.deleteTransactionAPI(mdIID, LogicalDatastoreType.CONFIGURATION)) { ret = true; } else { LOG.error("{}: Failed to delete variable metadata: {}", Thread.currentThread().getStackTrace()[1], mdName); } printTraceStop(LOG); return ret; } }
/** * This method deletes 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 boolean deleteServiceFunctionState(SfName serviceFunctionName) { printTraceStart(LOG); boolean ret = false; ServiceFunctionStateKey serviceFunctionStateKey = new ServiceFunctionStateKey(serviceFunctionName); InstanceIdentifier<ServiceFunctionState> sfStateIID = InstanceIdentifier.builder(ServiceFunctionsState.class) .child(ServiceFunctionState.class, serviceFunctionStateKey) .build(); if (SfcDataStoreAPI.deleteTransactionAPI(sfStateIID, LogicalDatastoreType.OPERATIONAL)) { ret = true; } else { LOG.error("{}: Could not delete operational state for SF: {}", Thread.currentThread().getStackTrace()[1], serviceFunctionName); } return ret; }
public static boolean deleteContextMetadata (String mdName) { boolean ret = false; printTraceStart(LOG); InstanceIdentifier<ContextMetadata> mdIID; ContextMetadataKey mdKey = new ContextMetadataKey(mdName); mdIID = InstanceIdentifier.builder(ServiceFunctionMetadata.class) .child(ContextMetadata.class, mdKey).build(); if (SfcDataStoreAPI.deleteTransactionAPI(mdIID, LogicalDatastoreType.CONFIGURATION)) { ret = true; } else { LOG.error("{}: Failed to delete service function context metadata {}", Thread.currentThread().getStackTrace()[1], mdName); } printTraceStop(LOG); return ret; }
/** * Deletes a SFG Algorithm from the datastore <p> * @param serviceFunctionGroupAlgorithmName SFG Algorithm name * @return boolean success of failure */ protected static boolean deleteServiceFunctionGroupAlgorithm(String serviceFunctionGroupAlgorithmName) { boolean ret = false; printTraceStart(LOG); ServiceFunctionGroupAlgorithmKey serviceFunctionGroupAlgorithmKey = new ServiceFunctionGroupAlgorithmKey(serviceFunctionGroupAlgorithmName); InstanceIdentifier<ServiceFunctionGroupAlgorithm> sfgAlgEntryIID = InstanceIdentifier.builder(ServiceFunctionGroupAlgorithms.class).child(ServiceFunctionGroupAlgorithm.class, serviceFunctionGroupAlgorithmKey).toInstance(); if (SfcDataStoreAPI.deleteTransactionAPI(sfgAlgEntryIID, LogicalDatastoreType.CONFIGURATION)) { ret = true; } else { LOG.error("{}: Could not delete SFG Algorithm: {}", Thread.currentThread().getStackTrace()[1], serviceFunctionGroupAlgorithmName); } printTraceStop(LOG); return ret; }
/** * This method deletes the operational state for a service function. * <p> * * @param sffName SFF name * @return A ServiceFunctionState object that is a list of all paths using * this service function, null otherwise */ public static boolean deleteServiceFunctionForwarderState(SffName sffName) { printTraceStart(LOG); boolean ret = false; ServiceFunctionForwarderStateKey serviceFunctionForwarderStateKey = new ServiceFunctionForwarderStateKey(sffName); InstanceIdentifier<ServiceFunctionForwarderState> sffStateIID = InstanceIdentifier.builder(ServiceFunctionForwardersState.class) .child(ServiceFunctionForwarderState.class, serviceFunctionForwarderStateKey) .build(); if (SfcDataStoreAPI.deleteTransactionAPI(sffStateIID, LogicalDatastoreType.OPERATIONAL)) { ret = true; } else { LOG.error("{}: Could not delete operational state for SFF: {}", Thread.currentThread().getStackTrace()[1], sffName); } return ret; }
/** * Deletes a SFG from the datastore * <p> * * @param serviceFunctionGroupName SFG name * @return boolean success of failure */ protected static boolean deleteServiceFunctionGroup(String serviceFunctionGroupName) { boolean ret = false; printTraceStart(LOG); ServiceFunctionGroupKey serviceFunctionGroupKey = new ServiceFunctionGroupKey(serviceFunctionGroupName); InstanceIdentifier<ServiceFunctionGroup> sfgEntryIID = InstanceIdentifier.builder(ServiceFunctionGroups.class) .child(ServiceFunctionGroup.class, serviceFunctionGroupKey) .build(); if (SfcDataStoreAPI.deleteTransactionAPI(sfgEntryIID, LogicalDatastoreType.CONFIGURATION)) { ret = true; } else { LOG.error("{}: Could not delete SFG: {}", Thread.currentThread().getStackTrace()[1], serviceFunctionGroupName); } printTraceStop(LOG); return ret; }
public static boolean deleteServiceFunctionScheduleType( Class<? extends ServiceFunctionSchedulerTypeIdentity> serviceFunctionSchedulerType) { printTraceStart(LOG); boolean ret = false; ServiceFunctionSchedulerTypeKey serviceFunctionSchedulerTypeKey = new ServiceFunctionSchedulerTypeKey(serviceFunctionSchedulerType); InstanceIdentifier<ServiceFunctionSchedulerType> sfstIID = InstanceIdentifier.builder(ServiceFunctionSchedulerTypes.class) .child(ServiceFunctionSchedulerType.class, serviceFunctionSchedulerTypeKey) .build(); if (SfcDataStoreAPI.deleteTransactionAPI(sfstIID, LogicalDatastoreType.CONFIGURATION)) { ret = true; } else { LOG.error("Failed to delete Service Function Schedule Type: {}", serviceFunctionSchedulerType); } printTraceStop(LOG); return ret; }
.build(); if (SfcDataStoreAPI.deleteTransactionAPI(aclIID, LogicalDatastoreType.OPERATIONAL)) { ret = true; } else {
/** * This method deletes a SFF from the datastore * <p> * * @param serviceFunctionForwarderName SFF name * @return true if SF was deleted, false otherwise */ public static boolean deleteServiceFunctionForwarder(SffName serviceFunctionForwarderName) { boolean ret = false; printTraceStart(LOG); ServiceFunctionForwarderKey serviceFunctionForwarderKey = new ServiceFunctionForwarderKey(serviceFunctionForwarderName); InstanceIdentifier<ServiceFunctionForwarder> sffEntryIID = InstanceIdentifier.builder(ServiceFunctionForwarders.class) .child(ServiceFunctionForwarder.class, serviceFunctionForwarderKey) .build(); if (SfcDataStoreAPI.deleteTransactionAPI(sffEntryIID, LogicalDatastoreType.CONFIGURATION)) { ret = true; } else { LOG.error("Could not delete SFF: {}", serviceFunctionForwarderName); } printTraceStop(LOG); return ret; }
if (renderedServicePath != null) { pathId = renderedServicePath.getPathId(); if (SfcDataStoreAPI.deleteTransactionAPI(rspEntryIID, LogicalDatastoreType.OPERATIONAL)) { ret = true;
/** * This method is used to delete all Service Function names under a * Service Function Type list. It basically removes the list of all service * functions of a given type. The Service Functions themselves are not touched * by this function. * * @param serviceFunctionType Service Function Type abstract class * @return Service Function Type Object */ public static boolean deleteServiceFunctionType(ServiceFunctionType serviceFunctionType) { printTraceStart(LOG); boolean ret = false; ServiceFunctionTypeKey serviceFunctionTypeKey = new ServiceFunctionTypeKey(serviceFunctionType.getType()); InstanceIdentifier<ServiceFunctionType> sftEntryIID = InstanceIdentifier.builder(ServiceFunctionTypes.class) .child(ServiceFunctionType.class, serviceFunctionTypeKey) .build(); if (SfcDataStoreAPI.deleteTransactionAPI(sftEntryIID, LogicalDatastoreType.CONFIGURATION)) { ret = true; } else { LOG.error("Failed to delete Service Type: {}", serviceFunctionType); } printTraceStop(LOG); return ret; }
.child(SffServicePath.class, sffServicePathKey) .build(); if (SfcDataStoreAPI.deleteTransactionAPI(sfStateIID, LogicalDatastoreType.OPERATIONAL)) { ret = true; } else {
.child(SffServicePath.class, sffServicePathKey) .build(); if (SfcDataStoreAPI.deleteTransactionAPI(sfStateIID, LogicalDatastoreType.OPERATIONAL)) { ret = true; } else {
.child(SfServicePath.class, sfServicePathKey) .build(); if (SfcDataStoreAPI.deleteTransactionAPI(sfStateIID, LogicalDatastoreType.OPERATIONAL)) { ret = true; } else {
.build(); if (SfcDataStoreAPI.deleteTransactionAPI(sftentryIID, LogicalDatastoreType.CONFIGURATION)) { ret = true; } else {
/** * remove a flow from the DataStore * * @param nodeName - which node to write the flow to * @param tableKey - table Key * @param flowKey - flow key */ public static boolean removeFlowFromDataStore(final String nodeName, TableKey tableKey, FlowKey flowKey) { NodeBuilder nodeBuilder = new NodeBuilder(); nodeBuilder.setId(new NodeId(nodeName)); nodeBuilder.setKey(new NodeKey(nodeBuilder.getId())); // Create the flow path InstanceIdentifier<Flow> flowInstanceId = InstanceIdentifier.builder(Nodes.class) .child(Node.class, nodeBuilder.getKey()) .augmentation(FlowCapableNode.class) .child(Table.class, tableKey) .child(Flow.class, flowKey) .build(); return SfcDataStoreAPI.deleteTransactionAPI(flowInstanceId, LogicalDatastoreType.CONFIGURATION); }