Search in sources :

Example 6 with OvsdbBridgeAugmentation

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation in project genius by opendaylight.

the class OvsdbSouthboundTestUtil method deleteBridge.

public static void deleteBridge(DataBroker dataBroker) throws TransactionCommitFailedException {
    final OvsdbBridgeName ovsdbBridgeName = new OvsdbBridgeName("s2");
    final InstanceIdentifier<Node> bridgeIid = createInstanceIdentifier("192.168.56.101", 6640, ovsdbBridgeName);
    final InstanceIdentifier<OvsdbBridgeAugmentation> ovsdbBridgeIid = bridgeIid.builder().augmentation(OvsdbBridgeAugmentation.class).build();
    LOG.debug("Built with the intent to delete bridge data {}", bridgeIid.toString());
    WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
    tx.delete(LogicalDatastoreType.OPERATIONAL, ovsdbBridgeIid);
    tx.submit().checkedGet();
}
Also used : WriteTransaction(org.opendaylight.controller.md.sal.binding.api.WriteTransaction) OvsdbBridgeAugmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation) OvsdbBridgeName(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeName) Node(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node)

Example 7 with OvsdbBridgeAugmentation

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation in project genius by opendaylight.

the class OvsdbSouthboundTestUtil method createBridge.

public static void createBridge(DataBroker dataBroker) throws TransactionCommitFailedException {
    final OvsdbBridgeName ovsdbBridgeName = new OvsdbBridgeName("s2");
    final InstanceIdentifier<Node> bridgeIid = createInstanceIdentifier("192.168.56.101", 6640, ovsdbBridgeName);
    final InstanceIdentifier<OvsdbBridgeAugmentation> ovsdbBridgeIid = bridgeIid.builder().augmentation(OvsdbBridgeAugmentation.class).build();
    final NodeId bridgeNodeId = createManagedNodeId(bridgeIid);
    final NodeBuilder bridgeCreateNodeBuilder = new NodeBuilder();
    bridgeCreateNodeBuilder.setNodeId(bridgeNodeId);
    OvsdbBridgeAugmentationBuilder bridgeCreateAugmentationBuilder = new OvsdbBridgeAugmentationBuilder();
    bridgeCreateAugmentationBuilder.setBridgeName(ovsdbBridgeName).setDatapathId(new DatapathId("00:00:00:00:00:00:00:01"));
    bridgeCreateNodeBuilder.addAugmentation(OvsdbBridgeAugmentation.class, bridgeCreateAugmentationBuilder.build());
    LOG.debug("Built with the intent to store bridge data {}", bridgeCreateAugmentationBuilder.toString());
    WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
    tx.put(LogicalDatastoreType.OPERATIONAL, ovsdbBridgeIid, bridgeCreateAugmentationBuilder.build(), true);
    tx.submit().checkedGet();
}
Also used : WriteTransaction(org.opendaylight.controller.md.sal.binding.api.WriteTransaction) OvsdbBridgeAugmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation) OvsdbBridgeAugmentationBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentationBuilder) OvsdbBridgeName(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeName) Node(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node) NodeId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId) DatapathId(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.DatapathId) NodeBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder)

Example 8 with OvsdbBridgeAugmentation

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation in project genius by opendaylight.

the class OvsdbSouthboundTestUtil method updateBridge.

public static void updateBridge(DataBroker dataBroker, String datapathId) throws TransactionCommitFailedException {
    final OvsdbBridgeName ovsdbBridgeName = new OvsdbBridgeName("s2");
    final InstanceIdentifier<Node> bridgeIid = createInstanceIdentifier("192.168.56.101", 6640, ovsdbBridgeName);
    final InstanceIdentifier<OvsdbBridgeAugmentation> ovsdbBridgeIid = bridgeIid.builder().augmentation(OvsdbBridgeAugmentation.class).build();
    final NodeId bridgeNodeId = createManagedNodeId(bridgeIid);
    final NodeBuilder bridgeCreateNodeBuilder = new NodeBuilder();
    bridgeCreateNodeBuilder.setNodeId(bridgeNodeId);
    OvsdbBridgeAugmentationBuilder bridgeCreateAugmentationBuilder = new OvsdbBridgeAugmentationBuilder();
    bridgeCreateAugmentationBuilder.setBridgeName(ovsdbBridgeName).setDatapathId(new DatapathId(datapathId));
    bridgeCreateNodeBuilder.addAugmentation(OvsdbBridgeAugmentation.class, bridgeCreateAugmentationBuilder.build());
    LOG.debug("Built with the intent to store bridge data {}", bridgeCreateAugmentationBuilder.toString());
    WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
    tx.merge(LogicalDatastoreType.OPERATIONAL, ovsdbBridgeIid, bridgeCreateAugmentationBuilder.build(), true);
    tx.submit().checkedGet();
}
Also used : WriteTransaction(org.opendaylight.controller.md.sal.binding.api.WriteTransaction) OvsdbBridgeAugmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation) OvsdbBridgeAugmentationBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentationBuilder) OvsdbBridgeName(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeName) Node(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node) NodeId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId) DatapathId(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.DatapathId) NodeBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder)

Example 9 with OvsdbBridgeAugmentation

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation in project genius by opendaylight.

the class ItmUtils method getOvsdbNode.

/**
 * Gets the Network topology Node from Operational Datastore
 * based on Bridge Augmentation.
 *
 * @param bridgeAugmentation bridge augmentation of OVSDB node
 *
 * @param dataBroker data broker handle to perform operations on datastore
 *
 * @return the Network Topology Node i.e. OVSDB node which is managing the specified bridge
 */
public static Node getOvsdbNode(OvsdbBridgeAugmentation bridgeAugmentation, DataBroker dataBroker) {
    Node ovsdbNode = null;
    Optional<Node> opOvsdbNode = Optional.absent();
    if (bridgeAugmentation != null) {
        InstanceIdentifier<Node> ovsdbNodeIid = (InstanceIdentifier<Node>) bridgeAugmentation.getManagedBy().getValue();
        opOvsdbNode = ItmUtils.read(LogicalDatastoreType.OPERATIONAL, ovsdbNodeIid, dataBroker);
    }
    if (opOvsdbNode.isPresent()) {
        ovsdbNode = opOvsdbNode.get();
    }
    return ovsdbNode;
}
Also used : Node(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node) InstanceIdentifier(org.opendaylight.yangtools.yang.binding.InstanceIdentifier)

Example 10 with OvsdbBridgeAugmentation

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation in project genius by opendaylight.

the class OvsdbNodeListener method add.

@Override
public void add(@Nonnull Node ovsdbNodeNew) {
    String bridgeName = null;
    String strDpnId = "";
    OvsdbNodeAugmentation ovsdbNewNodeAugmentation = null;
    LOG.trace("OvsdbNodeListener called for Ovsdb Node ({}) Add.", ovsdbNodeNew.getNodeId().getValue());
    // check for OVS bridge node
    OvsdbBridgeAugmentation ovsdbNewBridgeAugmentation = ovsdbNodeNew.getAugmentation(OvsdbBridgeAugmentation.class);
    if (ovsdbNewBridgeAugmentation != null) {
        processBridgeUpdate(ovsdbNewBridgeAugmentation);
    }
}
Also used : OvsdbBridgeAugmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation) OvsdbNodeAugmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentation)

Aggregations

OvsdbBridgeAugmentation (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation)10 Node (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node)10 DatapathId (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.DatapathId)4 WriteTransaction (org.opendaylight.controller.md.sal.binding.api.WriteTransaction)3 OvsdbBridgeName (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeName)3 NodeId (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId)3 OvsdbBridgeAugmentationBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentationBuilder)2 OvsdbNodeAugmentation (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentation)2 NodeBuilder (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder)2 InstanceIdentifier (org.opendaylight.yangtools.yang.binding.InstanceIdentifier)2 BigInteger (java.math.BigInteger)1 Collections (java.util.Collections)1 ReadFailedException (org.opendaylight.controller.md.sal.common.api.data.ReadFailedException)1 OvsdbTepInfo (org.opendaylight.genius.itm.commons.OvsdbTepInfo)1 OvsdbTepAddWorker (org.opendaylight.genius.itm.confighelpers.OvsdbTepAddWorker)1 Interface (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface)1 InterfaceKey (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.InterfaceKey)1 BridgeEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406.bridge._interface.info.BridgeEntry)1 BridgeInterfaceEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406.bridge._interface.info.bridge.entry.BridgeInterfaceEntry)1 BridgeRefEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406.bridge.ref.info.BridgeRefEntry)1