use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder in project genius by opendaylight.
the class OvsdbTestUtil method addBridgeIntoNode.
public static CheckedFuture<Void, TransactionCommitFailedException> addBridgeIntoNode(ConnectionInfo connectionInfo, String bridgeName, String dpid, DataBroker dataBroker) throws Exception {
NodeId ovsdbNodeId = SouthboundUtils.createNodeId(connectionInfo.getRemoteIp(), connectionInfo.getRemotePort());
NodeKey nodeKey = new NodeKey(ovsdbNodeId);
NodeBuilder bridgeNodeBuilder = new NodeBuilder();
InstanceIdentifier<Node> bridgeIid = SouthboundUtils.createInstanceIdentifier(nodeKey, bridgeName);
NodeId bridgeNodeId = SouthboundUtils.createManagedNodeId(bridgeIid);
bridgeNodeBuilder.setNodeId(bridgeNodeId);
OvsdbBridgeAugmentationBuilder ovsdbBridgeAugmentationBuilder = new OvsdbBridgeAugmentationBuilder();
ovsdbBridgeAugmentationBuilder.setBridgeName(new OvsdbBridgeName(bridgeName)).setDatapathId(new DatapathId(dpid));
ovsdbBridgeAugmentationBuilder.setManagedBy(new OvsdbNodeRef(SouthboundUtils.createInstanceIdentifier(nodeKey.getNodeId())));
bridgeNodeBuilder.addAugmentation(OvsdbBridgeAugmentation.class, ovsdbBridgeAugmentationBuilder.build());
Node bridgeNode = bridgeNodeBuilder.build();
WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
tx.merge(LogicalDatastoreType.OPERATIONAL, bridgeIid, bridgeNode, true);
return tx.submit();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder in project genius by opendaylight.
the class InterfaceManagerTestUtil method buildInventoryDpnNode.
static Node buildInventoryDpnNode(BigInteger dpnId) {
NodeId nodeId = new NodeId("openflow:" + dpnId);
Node nodeDpn = new NodeBuilder().setId(nodeId).setKey(new NodeKey(nodeId)).build();
return nodeDpn;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder 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();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder 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();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder in project genius by opendaylight.
the class MDSALManager method buildDpnNode.
protected Node buildDpnNode(BigInteger dpnId) {
NodeId nodeId = new NodeId("openflow:" + dpnId);
Node nodeDpn = new NodeBuilder().setId(nodeId).setKey(new NodeKey(nodeId)).build();
return nodeDpn;
}
Aggregations