Search in sources :

Example 21 with TopologyId

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);
        }
    }
}
Also used : VppNetconfConnectionProbe(org.opendaylight.lispflowmapping.neutron.intenthandler.util.VppNetconfConnectionProbe) SupportingNode(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.node.attributes.SupportingNode) Node(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node) SupportingNode(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.node.attributes.SupportingNode) NetworkTopology(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology) Topology(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology) TopologyKey(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey) NodeId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId) ExecutionException(java.util.concurrent.ExecutionException) NodeKey(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey) TopologyId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId) TimeoutException(java.util.concurrent.TimeoutException)

Example 22 with TopologyId

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);
}
Also used : TunnelsKey(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.TunnelsKey) BfdParams(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.tunnel.attributes.BfdParams) TunnelsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.TunnelsBuilder) Tunnels(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.Tunnels) SuppressFBWarnings(edu.umd.cs.findbugs.annotations.SuppressFBWarnings)

Example 23 with TopologyId

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;
}
Also used : IpPrefix(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix) DeviceVteps(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.transport.zone.subnets.DeviceVteps) Subnets(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.transport.zone.Subnets) ArrayList(java.util.ArrayList) HwVtep(org.opendaylight.genius.itm.confighelpers.HwVtep) IpAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)

Aggregations

TopologyId (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId)18 TopologyKey (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey)12 NetworkTopology (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology)11 Topology (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology)7 Node (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node)6 NodeKey (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey)6 NodeId (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId)5 ExecutionException (java.util.concurrent.ExecutionException)4 ArrayList (java.util.ArrayList)2 Before (org.junit.Before)2 WriteTransaction (org.opendaylight.controller.md.sal.binding.api.WriteTransaction)2 TransactionChainListener (org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener)2 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)2 Uri (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri)2 Tunnels (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.Tunnels)2 TunnelsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.TunnelsBuilder)2 TunnelsKey (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.TunnelsKey)2 BfdParams (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.tunnel.attributes.BfdParams)2 PcepTopologyNodeStatsAug (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.stats.rev171113.PcepTopologyNodeStatsAug)2 TopologyBuilder (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyBuilder)2