use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey in project genius by opendaylight.
the class SouthboundUtils method createTunnelsInstanceIdentifier.
public static InstanceIdentifier<Tunnels> createTunnelsInstanceIdentifier(InstanceIdentifier<Node> nodeId, InstanceIdentifier<TerminationPoint> localTEPInstanceIdentifier, InstanceIdentifier<TerminationPoint> remoteTEPInstanceIdentifier) {
TunnelsKey tunnelsKey = new TunnelsKey(new HwvtepPhysicalLocatorRef(localTEPInstanceIdentifier), new HwvtepPhysicalLocatorRef(remoteTEPInstanceIdentifier));
InstanceIdentifier<Tunnels> tunnelInstanceId = InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class, new TopologyKey(HWVTEP_TOPOLOGY_ID)).child(Node.class, new NodeKey(nodeId.firstKeyOf(Node.class))).augmentation(PhysicalSwitchAugmentation.class).child(Tunnels.class, tunnelsKey).build();
return tunnelInstanceId;
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey in project genius by opendaylight.
the class SouthboundUtils method createGlobalNodeInstanceIdentifier.
public static InstanceIdentifier<Node> createGlobalNodeInstanceIdentifier(DataBroker dataBroker, String physicalSwitchNodeId) {
InstanceIdentifier<Node> psNodeId = InstanceIdentifier.create(NetworkTopology.class).child(Topology.class, new TopologyKey(HWVTEP_TOPOLOGY_ID)).child(Node.class, new NodeKey(new NodeId(physicalSwitchNodeId)));
Optional<Node> physicalSwitchOptional = IfmUtil.read(LogicalDatastoreType.OPERATIONAL, psNodeId, dataBroker);
if (!physicalSwitchOptional.isPresent()) {
LOG.debug("physical switch is not present for {}", physicalSwitchNodeId);
return null;
}
Node physicalSwitch = physicalSwitchOptional.get();
PhysicalSwitchAugmentation physicalSwitchAugmentation = physicalSwitch.getAugmentation(PhysicalSwitchAugmentation.class);
return (InstanceIdentifier<Node>) physicalSwitchAugmentation.getManagedBy().getValue();
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey in project genius by opendaylight.
the class SouthboundUtils method createPhysicalSwitchInstanceIdentifier.
public static InstanceIdentifier<Node> createPhysicalSwitchInstanceIdentifier(String psNodeIdString) {
NodeId physicalSwitchNodeId = new NodeId(psNodeIdString);
InstanceIdentifier<Node> psNodeId = InstanceIdentifier.create(NetworkTopology.class).child(Topology.class, new TopologyKey(HWVTEP_TOPOLOGY_ID)).child(Node.class, new NodeKey(physicalSwitchNodeId));
return psNodeId;
}
Aggregations