use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey in project netvirt by opendaylight.
the class PhysicalSwitchHelper method getPhysicalSwitchInstanceIdentifier.
public static InstanceIdentifier<Node> getPhysicalSwitchInstanceIdentifier(InstanceIdentifier<Node> iid, String switchName) {
NodeId id = iid.firstKeyOf(Node.class).getNodeId();
String nodeString = id.getValue() + "/physicalswitch/" + switchName;
NodeId nodeId = new NodeId(new Uri(nodeString));
NodeKey nodeKey = new NodeKey(nodeId);
TopologyKey topoKey = new TopologyKey(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID);
return InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class, topoKey).child(Node.class, nodeKey).build();
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey in project netvirt by opendaylight.
the class ElanUtils method isDpnPresent.
public boolean isDpnPresent(BigInteger dpnId) {
String dpn = String.format("%s:%s", "openflow", dpnId);
NodeId nodeId = new NodeId(dpn);
InstanceIdentifier<Node> node = InstanceIdentifier.builder(Nodes.class).child(Node.class, new NodeKey(nodeId)).build();
return read(broker, LogicalDatastoreType.CONFIGURATION, node).isPresent();
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey in project netvirt by opendaylight.
the class HwvtepHAUtil method createInstanceIdentifierFromHAId.
public static InstanceIdentifier<Node> createInstanceIdentifierFromHAId(String haUUidVal) {
String nodeString = HWVTEP_URI_PREFIX + "://" + UUID + "/" + java.util.UUID.nameUUIDFromBytes(haUUidVal.getBytes(StandardCharsets.UTF_8)).toString();
NodeId nodeId = new NodeId(new Uri(nodeString));
NodeKey nodeKey = new NodeKey(nodeId);
TopologyKey topoKey = new TopologyKey(HWVTEP_TOPOLOGY_ID);
return InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class, topoKey).child(Node.class, nodeKey).build();
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey in project netvirt by opendaylight.
the class HwvtepHAUtil method convertToInstanceIdentifier.
public static InstanceIdentifier<Node> convertToInstanceIdentifier(String nodeIdString) {
NodeId nodeId = new NodeId(new Uri(nodeIdString));
NodeKey nodeKey = new NodeKey(nodeId);
TopologyKey topoKey = new TopologyKey(HWVTEP_TOPOLOGY_ID);
return InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class, topoKey).child(Node.class, nodeKey).build();
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey in project netvirt by opendaylight.
the class InterVpnLinkLocatorTest method stubNwUtilsGetOperativeDpns.
private void stubNwUtilsGetOperativeDpns(int maxNbrOfOperativeDpns) throws Exception {
WriteTransaction writeTx1 = dataBroker.newWriteOnlyTransaction();
for (int i = 1; i <= maxNbrOfOperativeDpns; i++) {
NodeId nodeId = new NodeId("openflow:" + i);
Node node = new NodeBuilder().setId(nodeId).build();
writeTx1.merge(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.builder(Nodes.class).child(Node.class, new NodeKey(nodeId)).build(), node);
}
writeTx1.submit().checkedGet();
}
Aggregations