private void remove(final KeyedInstanceIdentifier<Node, NodeKey> sourcePath) { final InstanceIdentifier<Node1> augmentPath = sourcePath.augmentation(Node1.class); deleteData(OPERATIONAL, augmentPath); }
private void remove(final KeyedInstanceIdentifier<Node, NodeKey> sourcePath){ final InstanceIdentifier<Node1> augmentPath = sourcePath.augmentation(Node1.class); deleteData(OPERATIONAL, augmentPath); }
public static InstanceIdentifier<FabricNode> createFabricIId(FabricId fabricId) { return Constants.DOM_FABRICS_PATH.child(Node.class, new NodeKey(fabricId)) .augmentation(FabricNode.class); }
private void ensureTableFowHashIdMapping(final ReadWriteTransaction tx) { if( ! tableEnsured) { ensureTable(tx, tableKey.getId(), tableRef); final FlowHashIdMapping emptyMapping = new FlowHashIdMappingBuilder() .setFlowHashIdMap(Collections.<FlowHashIdMap> emptyList()).build(); tx.merge(LogicalDatastoreType.OPERATIONAL, tableRef.augmentation(FlowHashIdMapping.class), emptyMapping); tableEnsured = true; } }
private void ensureTableFowHashIdMapping(final ReadWriteTransaction tx) { if( ! tableEnsured) { ensureTable(tx, tableKey.getId(), tableRef); final FlowHashIdMapping emptyMapping = new FlowHashIdMappingBuilder() .setFlowHashIdMap(Collections.<FlowHashIdMap> emptyList()).build(); tx.merge(LogicalDatastoreType.OPERATIONAL, tableRef.augmentation(FlowHashIdMapping.class), emptyMapping); tableEnsured = true; } }
public InstanceIdentifier<VlanVrfRoute> createVrfRouteIId(int vrf) { return deviceIId .augmentation(FabricCapableDevice.class) .child(Config.class) .child(Vrf.class, new VrfKey(createVrfId(vrf))) .augmentation(VlanVrfRoute.class); }
/** * Create a {@link InstanceIdentifier} {@link OvsdbBridgeAugmentation} based on the Topology * {@link NodeId} * * @param nodeId A topology {@link NodeId} * @return InstanceIdentifier<OvsdbBridgeAugmentation> */ public static InstanceIdentifier<OvsdbBridgeAugmentation> buildOvsdbBridgeIID(NodeId nodeId) { InstanceIdentifier<OvsdbBridgeAugmentation> bridgeEntryIID = InstanceIdentifier.create(NetworkTopology.class) .child(Topology.class, new TopologyKey(SouthboundConstants.OVSDB_TOPOLOGY_ID)) .child(Node.class, new NodeKey(nodeId)) .augmentation(OvsdbBridgeAugmentation.class); return bridgeEntryIID; }
protected static InstanceIdentifier<Acl> getAclCfgId( final InstanceIdentifier<Acl> id) { return InstanceIdentifier.create(Interfaces.class).child( org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface.class, new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.InterfaceKey( id.firstKeyOf(Interface.class).getName())).augmentation(VppAclInterfaceAugmentation.class) .child(Acl.class); }
/** * Method builds OVS BridgeAugmentation InstanceIdentifier which is based on OVS NodeId * <p> * * @param ovsdbBridge OvsdbBridgeAugmentation * @return InstanceIdentifier<OvsdbBridgeAugmentation> * @see SfcOvsUtil getManagedByNodeId */ public static InstanceIdentifier<OvsdbBridgeAugmentation> buildOvsdbBridgeIID(OvsdbBridgeAugmentation ovsdbBridge) { InstanceIdentifier<OvsdbBridgeAugmentation> bridgeEntryIID = InstanceIdentifier.create(NetworkTopology.class) .child(Topology.class, new TopologyKey(SouthboundConstants.OVSDB_TOPOLOGY_ID)) .child(Node.class, new NodeKey(getManagedByNodeId(ovsdbBridge))) .augmentation(OvsdbBridgeAugmentation.class); return bridgeEntryIID; }
private void removeOldConfigs(ReadWriteTransaction transaction, Map<String, String> oldOtherConfigs, OpenVSwitch ovs) { InstanceIdentifier<OvsdbNodeAugmentation> nodeAugmentataionIid = InstanceIdentifier .create(NetworkTopology.class) .child(Topology.class, new TopologyKey(SouthboundConstants.OVSDB_TOPOLOGY_ID)) .child(Node.class, new NodeKey(getNodeId(ovs))).augmentation(OvsdbNodeAugmentation.class); Set<String> otherConfigKeys = oldOtherConfigs.keySet(); for (String otherConfigKey : otherConfigKeys) { KeyedInstanceIdentifier<OpenvswitchOtherConfigs, OpenvswitchOtherConfigsKey> externalIid = nodeAugmentataionIid .child(OpenvswitchOtherConfigs.class, new OpenvswitchOtherConfigsKey(otherConfigKey)); transaction.delete(LogicalDatastoreType.OPERATIONAL, externalIid); } }
private void removeExternalIds(ReadWriteTransaction transaction, Map<String, String> oldExternalIds, OpenVSwitch ovs) { InstanceIdentifier<OvsdbNodeAugmentation> nodeAugmentataionIid = InstanceIdentifier .create(NetworkTopology.class) .child(Topology.class, new TopologyKey(SouthboundConstants.OVSDB_TOPOLOGY_ID)) .child(Node.class, new NodeKey(getNodeId(ovs))).augmentation(OvsdbNodeAugmentation.class); Set<String> externalIdKeys = oldExternalIds.keySet(); for (String externalIdKey : externalIdKeys) { KeyedInstanceIdentifier<OpenvswitchExternalIds, OpenvswitchExternalIdsKey> externalIid = nodeAugmentataionIid .child(OpenvswitchExternalIds.class, new OpenvswitchExternalIdsKey(externalIdKey)); transaction.delete(LogicalDatastoreType.OPERATIONAL, externalIid); } }
private void updateHashCache(final ReadWriteTransaction trans, final FlowKey flowKey, final FlowHashIdMapKey hashingKey) { final FlowHashIdMapBuilder flHashIdMap = new FlowHashIdMapBuilder(); flHashIdMap.setFlowId(flowKey.getId()); flHashIdMap.setKey(hashingKey); final KeyedInstanceIdentifier<FlowHashIdMap, FlowHashIdMapKey> flHashIdent = tableRef .augmentation(FlowHashIdMapping.class).child(FlowHashIdMap.class, hashingKey); /* Add new FlowHashIdMap */ trans.put(LogicalDatastoreType.OPERATIONAL, flHashIdent, flHashIdMap.build()); }
private void updateHashCache(final ReadWriteTransaction trans, final FlowKey flowKey, final FlowHashIdMapKey hashingKey) { final FlowHashIdMapBuilder flHashIdMap = new FlowHashIdMapBuilder(); flHashIdMap.setFlowId(flowKey.getId()); flHashIdMap.setKey(hashingKey); final KeyedInstanceIdentifier<FlowHashIdMap, FlowHashIdMapKey> flHashIdent = tableRef .augmentation(FlowHashIdMapping.class).child(FlowHashIdMap.class, hashingKey); /* Add new FlowHashIdMap */ trans.put(LogicalDatastoreType.OPERATIONAL, flHashIdent, flHashIdMap.build()); }
/** * Generates an Instance Identifier for an OVSDB QoS entries list. * @param ovsdbNode the desired node * @param qosEntryKey the key of the desired QoS entry * @return instance identifier */ public static InstanceIdentifier<QosEntries> getOvsdbQoSEntriesIid(Node ovsdbNode, QosEntriesKey qosEntryKey) { InstanceIdentifier<QosEntries> qosEntriesIid = InstanceIdentifier .create(NetworkTopology.class) .child(Topology.class, new TopologyKey(UnimgrConstants.OVSDB_TOPOLOGY_ID)) .child(Node.class, new NodeKey(ovsdbNode.getNodeId())) .augmentation(OvsdbNodeAugmentation.class) .child(QosEntries.class, qosEntryKey); return qosEntriesIid; }
private void insert(final KeyedInstanceIdentifier<Node, NodeKey> sourcePath) { final NodeKey nodeKey = sourcePath.getKey(); final InstanceIdentifier<Node1> augmentPath = sourcePath.augmentation(Node1.class); final Node1 nodeAgument = new Node1Builder().setEventSourceNode( new NodeId(nodeKey.getNodeId().getValue())).build(); putData(OPERATIONAL, augmentPath, nodeAgument); }
private void insert(final KeyedInstanceIdentifier<Node, NodeKey> sourcePath) { final NodeKey nodeKey = sourcePath.getKey(); final InstanceIdentifier<Node1> augmentPath = sourcePath.augmentation(Node1.class); final Node1 nodeAgument = new Node1Builder().setEventSourceNode(new NodeId(nodeKey.getNodeId().getValue())).build(); putData(OPERATIONAL, augmentPath, nodeAgument); }
/** * Generates an Instance Identifier for an OVSDB QoS queue list entry. * @param ovsdbNode the desired node * @param queuesKey the key of the desired queue list * @return instance identifier */ public static InstanceIdentifier<Queues> getOvsdbQueuesIid(Node ovsdbNode, QueuesKey queuesKey) { InstanceIdentifier<Queues> queuesIid = InstanceIdentifier .create(NetworkTopology.class) .child(Topology.class, new TopologyKey(UnimgrConstants.OVSDB_TOPOLOGY_ID)) .child(Node.class, new NodeKey(ovsdbNode.getNodeId())) .augmentation(OvsdbNodeAugmentation.class) .child(Queues.class, queuesKey); return queuesIid; } }
private void writeMeter(final CommandInterpreter ci, Meter meter) { ReadWriteTransaction modification = dataBroker.newReadWriteTransaction(); InstanceIdentifier<Meter> path1 = InstanceIdentifier.create(Nodes.class).child(Node.class, testNode.getKey()) .augmentation(FlowCapableNode.class).child(Meter.class, new MeterKey(meter.getMeterId())); modification.merge(LogicalDatastoreType.CONFIGURATION, nodeToInstanceId(testNode), testNode, true); modification.merge(LogicalDatastoreType.CONFIGURATION, path1, meter, true); CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit(); Futures.addCallback(commitFuture, new FutureCallback<Void>() { @Override public void onSuccess(Void aVoid) { ci.println("Status of Group Data Loaded Transaction: success."); } @Override public void onFailure(Throwable throwable) { ci.println(String.format("Status of Group Data Loaded Transaction : failure. Reason : %s", throwable)); } }); }
/** * Generates an Instance Identifier for an OVSDB queue other config entry. * @param ovsdbNodeId the desired node id * @param queuesKey the key of the desired queue entry * @return instance identifier */ public static InstanceIdentifier<QueuesOtherConfig> getQueuesOtherConfigIid(NodeId ovsdbNodeId, QueuesKey queuesKey) { InstanceIdentifier<QueuesOtherConfig> queuesOtherConfig = InstanceIdentifier .create(NetworkTopology.class) .child(Topology.class, new TopologyKey(UnimgrConstants.OVSDB_TOPOLOGY_ID)) .child(Node.class, new NodeKey(ovsdbNodeId)) .augmentation(OvsdbNodeAugmentation.class) .child(Queues.class, queuesKey) .child(QueuesOtherConfig.class, new QueuesOtherConfigKey(UnimgrConstants.QOS_MAX_RATE)); return queuesOtherConfig; }
/** * Generates an Instance Identifier for an OVSDB QoS other config entry. * @param ovsdbNodeId the desired node id * @param qosEntryKey the key of the desired QoS entry * @return instance identifier */ public static InstanceIdentifier<QosOtherConfig> getQosOtherConfigIid(NodeId ovsdbNodeId, QosEntriesKey qosEntryKey) { InstanceIdentifier<QosOtherConfig> qosOtherConfigIid = InstanceIdentifier .create(NetworkTopology.class) .child(Topology.class, new TopologyKey(UnimgrConstants.OVSDB_TOPOLOGY_ID)) .child(Node.class, new NodeKey(ovsdbNodeId)) .augmentation(OvsdbNodeAugmentation.class) .child(QosEntries.class, qosEntryKey) .child(QosOtherConfig.class, new QosOtherConfigKey(UnimgrConstants.QOS_MAX_RATE)); return qosOtherConfigIid; }