use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey 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.TopologyKey in project netvirt by opendaylight.
the class StateManager method initializeNetvirtTopology.
private void initializeNetvirtTopology() {
final TopologyId topologyId = new TopologyId("netvirt:1");
InstanceIdentifier<Topology> path = InstanceIdentifier.create(NetworkTopology.class).child(Topology.class, new TopologyKey(topologyId));
TopologyBuilder tpb = new TopologyBuilder();
tpb.setTopologyId(topologyId);
try {
txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> tx.put(LogicalDatastoreType.OPERATIONAL, path, tpb.build())).get();
} catch (InterruptedException | ExecutionException e) {
LOG.error("StateManager error initializing netvirt topology", e);
}
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey in project netvirt by opendaylight.
the class QosNeutronUtils method setPortBandwidthLimits.
// TODO Clean up the exception handling
@SuppressWarnings("checkstyle:IllegalCatch")
public void setPortBandwidthLimits(Port port, BandwidthLimitRules bwLimit, WriteTransaction writeConfigTxn) {
if (!qosEosHandler.isQosClusterOwner()) {
LOG.trace("Not Qos Cluster Owner. Ignoring setting bandwidth limits");
return;
}
LOG.trace("Setting bandwidth limits {} on Port {}", port, bwLimit);
BigInteger dpId = getDpnForInterface(port.getUuid().getValue());
if (dpId.equals(BigInteger.ZERO)) {
LOG.info("DPN ID for interface {} not found", port.getUuid().getValue());
return;
}
OvsdbBridgeRef bridgeRefEntry = getBridgeRefEntryFromOperDS(dpId);
Optional<Node> bridgeNode = MDSALUtil.read(LogicalDatastoreType.OPERATIONAL, bridgeRefEntry.getValue().firstIdentifierOf(Node.class), dataBroker);
TerminationPoint tp = SouthboundUtils.getTerminationPointByExternalId(bridgeNode.get(), port.getUuid().getValue());
OvsdbTerminationPointAugmentation ovsdbTp = tp.getAugmentation(OvsdbTerminationPointAugmentation.class);
OvsdbTerminationPointAugmentationBuilder tpAugmentationBuilder = new OvsdbTerminationPointAugmentationBuilder();
tpAugmentationBuilder.setName(ovsdbTp.getName());
tpAugmentationBuilder.setIngressPolicingRate(bwLimit.getMaxKbps().longValue());
tpAugmentationBuilder.setIngressPolicingBurst(bwLimit.getMaxBurstKbps().longValue());
TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
tpBuilder.setKey(tp.getKey());
tpBuilder.addAugmentation(OvsdbTerminationPointAugmentation.class, tpAugmentationBuilder.build());
try {
if (writeConfigTxn != null) {
writeConfigTxn.put(LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.create(NetworkTopology.class).child(Topology.class, new TopologyKey(SouthboundUtils.OVSDB_TOPOLOGY_ID)).child(Node.class, bridgeNode.get().getKey()).child(TerminationPoint.class, new TerminationPointKey(tp.getKey())), tpBuilder.build());
} else {
MDSALUtil.syncUpdate(dataBroker, LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.create(NetworkTopology.class).child(Topology.class, new TopologyKey(SouthboundUtils.OVSDB_TOPOLOGY_ID)).child(Node.class, bridgeNode.get().getKey()).child(TerminationPoint.class, new TerminationPointKey(tp.getKey())), tpBuilder.build());
}
} catch (Exception e) {
LOG.error("Failure while setting BwLimitRule {} to port {}", bwLimit, port, e);
}
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey in project lispflowmapping by opendaylight.
the class VppEndpointListener method processNodeOnConnection.
private void processNodeOnConnection(final Node newOrModifiedNode) {
for (SupportingNode supportingNode : newOrModifiedNode.getSupportingNode()) {
final NodeId nodeMount = supportingNode.getNodeRef();
final VppNetconfConnectionProbe probe = new VppNetconfConnectionProbe(supportingNode.getNodeRef(), dataBroker);
try {
// Verify netconf connection
boolean connectionReady = probe.startProbing();
if (connectionReady) {
LOG.debug("Node {} is connected, creating ...", supportingNode.getNodeRef());
final TopologyId topologyMount = supportingNode.getTopologyRef();
final KeyedInstanceIdentifier<Node, NodeKey> iiToVpp = InstanceIdentifier.create(NetworkTopology.class).child(Topology.class, new TopologyKey(topologyMount)).child(Node.class, new NodeKey(nodeMount));
nodeIdToKeyedInstanceIdentifierMap.put(newOrModifiedNode.getNodeId(), iiToVpp);
} else {
LOG.debug("Failed while connecting to node {}", supportingNode.getNodeRef());
}
} catch (InterruptedException | ExecutionException e) {
LOG.warn("Exception while processing node {} ... ", supportingNode.getNodeRef(), e);
} catch (TimeoutException e) {
LOG.warn("Node {} was not connected within {} seconds. " + "Check node configuration and connectivity to proceed", supportingNode.getNodeRef(), VppNetconfConnectionProbe.NODE_CONNECTION_TIMER);
}
}
}
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 OvsdbSouthboundTestUtil method createTerminationPointInstanceIdentifier.
public static InstanceIdentifier<TerminationPoint> createTerminationPointInstanceIdentifier(NodeKey nodeKey, String portName) {
InstanceIdentifier<TerminationPoint> terminationPointPath = InstanceIdentifier.create(NetworkTopology.class).child(Topology.class, new TopologyKey(OVSDB_TOPOLOGY_ID)).child(Node.class, nodeKey).child(TerminationPoint.class, new TerminationPointKey(new TpId(portName)));
LOG.debug("Termination point InstanceIdentifier generated : {}", terminationPointPath);
return terminationPointPath;
}
Aggregations