use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId 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.TopologyId in project genius by opendaylight.
the class HwVtepTunnelsStateHandler method resetMonitoringTask.
// tunnelKey, nodeId, topologyId are initialized to null and immediately passed to getTunnelIdentifier which
// FindBugs as a "Load of known null value" violation. Not sure sure what the intent...
@SuppressFBWarnings("NP_LOAD_OF_KNOWN_NULL_VALUE")
void resetMonitoringTask(boolean isEnable) {
// TODO: get the corresponding hwvtep tunnel from the sourceInterface
// once InterfaceMgr implements renderer for HWVTEP VXLAN tunnels
// tunnelKey, nodeId, topologyId are initialized to null and immediately passed to getTunnelIdentifier which
// FindBugs flags as a "Load of known null value" violation. Not sure sure what the intent...
TunnelsKey tunnelKey = null;
String nodeId = null;
String topologyId = null;
Optional<Tunnels> tunnelsOptional = SingleTransactionDataBroker.syncReadOptionalAndTreatReadFailedExceptionAsAbsentOptional(dataBroker, LogicalDatastoreType.CONFIGURATION, getTunnelIdentifier(topologyId, nodeId, tunnelKey));
if (!tunnelsOptional.isPresent()) {
LOG.warn("Tunnel {} is not present on the Node {}. So not disabling the BFD monitoring", tunnelKey, nodeId);
return;
}
Tunnels tunnel = tunnelsOptional.get();
List<BfdParams> tunnelBfdParams = tunnel.getBfdParams();
if (tunnelBfdParams == null || tunnelBfdParams.isEmpty()) {
LOG.debug("there is no bfd params available for the tunnel {}", tunnel);
return;
}
Iterator<BfdParams> tunnelBfdParamsIterator = tunnelBfdParams.iterator();
while (tunnelBfdParamsIterator.hasNext()) {
BfdParams bfdParam = tunnelBfdParamsIterator.next();
if (bfdParam.getBfdParamKey().equals(AlivenessMonitorConstants.BFD_PARAM_ENABLE)) {
tunnelBfdParamsIterator.remove();
break;
}
}
setBfdParamForEnable(tunnelBfdParams, isEnable);
Tunnels tunnelWithBfdReset = new TunnelsBuilder().setKey(tunnelKey).setBfdParams(tunnelBfdParams).build();
MDSALUtil.syncUpdate(dataBroker, LogicalDatastoreType.CONFIGURATION, getTunnelIdentifier(topologyId, nodeId, tunnelKey), tunnelWithBfdReset);
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId in project genius by opendaylight.
the class TransportZoneListener method createhWVteps.
private List<HwVtep> createhWVteps(TransportZone transportZone) {
List<HwVtep> hwVtepsList = new ArrayList<>();
String zoneName = transportZone.getZoneName();
Class<? extends TunnelTypeBase> tunnelType = transportZone.getTunnelType();
LOG.trace("Transport Zone_name: {}", zoneName);
List<Subnets> subnetsList = transportZone.getSubnets();
if (subnetsList != null) {
for (Subnets subnet : subnetsList) {
IpPrefix ipPrefix = subnet.getPrefix();
IpAddress gatewayIP = subnet.getGatewayIp();
int vlanID = subnet.getVlanId();
LOG.trace("IpPrefix: {}, gatewayIP: {}, vlanID: {} ", ipPrefix, gatewayIP, vlanID);
List<DeviceVteps> deviceVtepsList = subnet.getDeviceVteps();
if (deviceVtepsList != null) {
for (DeviceVteps vteps : deviceVtepsList) {
String topologyId = vteps.getTopologyId();
String nodeId = vteps.getNodeId();
IpAddress ipAddress = vteps.getIpAddress();
LOG.trace("topo-id: {}, node-id: {}, ipAddress: {}", topologyId, nodeId, ipAddress);
HwVtep hwVtep = ItmUtils.createHwVtepObject(topologyId, nodeId, ipAddress, ipPrefix, gatewayIP, vlanID, tunnelType, transportZone);
LOG.trace("Adding new HwVtep {} info ", hwVtep.getHwIp());
hwVtepsList.add(hwVtep);
}
}
}
}
LOG.trace("returning hwvteplist {}", hwVtepsList);
return hwVtepsList;
}
Aggregations