use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint in project genius by opendaylight.
the class OvsInterfaceTopologyStateUpdateHelper method getTunnelOpState.
private static Interface.OperStatus getTunnelOpState(OvsdbTerminationPointAugmentation terminationPoint) {
if (!SouthboundUtils.bfdMonitoringEnabled(terminationPoint.getInterfaceBfd())) {
return Interface.OperStatus.Up;
}
Interface.OperStatus livenessState = Interface.OperStatus.Down;
List<InterfaceBfdStatus> tunnelBfdStatus = terminationPoint.getInterfaceBfdStatus();
if (tunnelBfdStatus != null && !tunnelBfdStatus.isEmpty()) {
for (InterfaceBfdStatus bfdState : tunnelBfdStatus) {
if (bfdState.getBfdStatusKey().equalsIgnoreCase(SouthboundUtils.BFD_OP_STATE)) {
String bfdOpState = bfdState.getBfdStatusValue();
livenessState = SouthboundUtils.BFD_STATE_UP.equalsIgnoreCase(bfdOpState) ? Interface.OperStatus.Up : Interface.OperStatus.Down;
break;
}
}
}
return livenessState;
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint in project genius by opendaylight.
the class SouthboundUtils method createTerminationPointInstanceIdentifier.
public static InstanceIdentifier<TerminationPoint> createTerminationPointInstanceIdentifier(NodeKey nodekey, String portName) {
InstanceIdentifier<TerminationPoint> terminationPointPath = InstanceIdentifier.create(NetworkTopology.class).child(Topology.class, new TopologyKey(IfmConstants.OVSDB_TOPOLOGY_ID)).child(Node.class, nodekey).child(TerminationPoint.class, new TerminationPointKey(new TpId(portName)));
LOG.debug("Termination point InstanceIdentifier generated : {}", terminationPointPath);
return terminationPointPath;
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint in project genius by opendaylight.
the class HwVTEPConfigRemoveHelper method removeTerminationEndPoint.
private static void removeTerminationEndPoint(WriteTransaction transaction, IfTunnel ifTunnel, InstanceIdentifier<Node> globalNodeId) {
LOG.info("removing remote termination end point {}", ifTunnel.getTunnelDestination());
TerminationPointKey tpKey = SouthboundUtils.getTerminationPointKey(ifTunnel.getTunnelDestination().getIpv4Address().getValue());
InstanceIdentifier<TerminationPoint> tpPath = SouthboundUtils.createInstanceIdentifier(globalNodeId, tpKey);
transaction.delete(LogicalDatastoreType.CONFIGURATION, tpPath);
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint in project genius by opendaylight.
the class HwVTEPInterfaceConfigAddHelper method createRemotePhysicalLocatorEntry.
private static InstanceIdentifier<TerminationPoint> createRemotePhysicalLocatorEntry(WriteTransaction transaction, InstanceIdentifier<Node> nodeIid, IpAddress destIPAddress) {
String remoteIp = destIPAddress.getIpv4Address().getValue();
LOG.debug("creating remote physical locator entry {}", remoteIp);
TerminationPointKey tpKey = SouthboundUtils.getTerminationPointKey(remoteIp);
InstanceIdentifier<TerminationPoint> tpPath = SouthboundUtils.createInstanceIdentifier(nodeIid, tpKey);
createPhysicalLocatorEntry(transaction, tpPath, tpKey, destIPAddress);
return tpPath;
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint in project genius by opendaylight.
the class HwVTEPInterfaceConfigUpdateHelper method updateBfdMonitoring.
/*
* BFD monitoring interval and enable/disable attributes can be modified
*/
public static List<ListenableFuture<Void>> updateBfdMonitoring(ManagedNewTransactionRunner txRunner, InstanceIdentifier<Node> globalNodeId, InstanceIdentifier<Node> physicalSwitchId, IfTunnel ifTunnel) {
TunnelsBuilder tunnelsBuilder = new TunnelsBuilder();
InstanceIdentifier<TerminationPoint> localTEPInstanceIdentifier = SouthboundUtils.createTEPInstanceIdentifier(globalNodeId, ifTunnel.getTunnelSource());
InstanceIdentifier<TerminationPoint> remoteTEPInstanceIdentifier = SouthboundUtils.createTEPInstanceIdentifier(globalNodeId, ifTunnel.getTunnelDestination());
InstanceIdentifier<Tunnels> tunnelsInstanceIdentifier = SouthboundUtils.createTunnelsInstanceIdentifier(physicalSwitchId, localTEPInstanceIdentifier, remoteTEPInstanceIdentifier);
LOG.debug("updating bfd monitoring parameters for the hwvtep {}", tunnelsInstanceIdentifier);
tunnelsBuilder.setKey(new TunnelsKey(new HwvtepPhysicalLocatorRef(localTEPInstanceIdentifier), new HwvtepPhysicalLocatorRef(remoteTEPInstanceIdentifier)));
List<BfdParams> bfdParams = new ArrayList<>();
SouthboundUtils.fillBfdParameters(bfdParams, ifTunnel);
tunnelsBuilder.setBfdParams(bfdParams);
return Collections.singletonList(txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> tx.merge(LogicalDatastoreType.CONFIGURATION, tunnelsInstanceIdentifier, tunnelsBuilder.build(), WriteTransaction.CREATE_MISSING_PARENTS)));
}
Aggregations