use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesState in project lispflowmapping by opendaylight.
the class VppNodeReader method readFirstAvailableIpOfVppNode.
private ListenableFuture<Optional<Ipv4Address>> readFirstAvailableIpOfVppNode(final KeyedInstanceIdentifier<Node, NodeKey> instanceIdentifierToVppNode) {
final SettableFuture<Optional<Ipv4Address>> resultFuture = SettableFuture.create();
final DataBroker vppDataBroker = LispNeutronUtil.resolveDataBrokerForMountPoint(instanceIdentifierToVppNode, mountService);
if (vppDataBroker != null) {
final Optional<InterfacesState> interfacesOnVppNodeOptional = VppNetconfTrasaction.read(vppDataBroker, LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.create(InterfacesState.class));
if (interfacesOnVppNodeOptional.isPresent()) {
for (Interface intf : interfacesOnVppNodeOptional.get().getInterface()) {
if (intf.getType().equals(Loopback.class)) {
continue;
}
final Optional<Ipv4Address> ipv4AddressOptional = readIpAddressFromInterface(intf, instanceIdentifierToVppNode);
if (ipv4AddressOptional.isPresent()) {
resultFuture.set(ipv4AddressOptional);
break;
}
}
}
resultFuture.set(Optional.absent());
} else {
LOG.debug("Data broker for vpp {} is missing.", instanceIdentifierToVppNode);
}
return resultFuture;
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesState in project genius by opendaylight.
the class TepDeleteDatastore method doExecute.
@Override
protected Object doExecute() {
final DataBroker dataBroker = itmProvider.getDataBroker();
InstanceIdentifier<TransportZones> itmConfigPath = InstanceIdentifier.builder(TransportZones.class).build();
InstanceIdentifier<Interfaces> interfacesConfigPath = InstanceIdentifier.builder(Interfaces.class).build();
final InstanceIdentifier<InterfacesState> ifStateOpPath = InstanceIdentifier.builder(InterfacesState.class).build();
InstanceIdentifier<Nodes> frmConfigPath = InstanceIdentifier.builder(Nodes.class).build();
List<InstanceIdentifier<T>> allConfigPaths = new ArrayList<>();
allConfigPaths.add((InstanceIdentifier<T>) itmConfigPath);
allConfigPaths.add((InstanceIdentifier<T>) interfacesConfigPath);
allConfigPaths.add((InstanceIdentifier<T>) frmConfigPath);
// allConfigPaths.add((InstanceIdentifier<T>) tunnelsConfigPath);
ItmUtils.asyncBulkRemove(dataBroker, LogicalDatastoreType.CONFIGURATION, allConfigPaths, ItmUtils.DEFAULT_CALLBACK);
List<InstanceIdentifier<T>> allOperationalPaths = new ArrayList<>();
// allOperationalPaths.add((InstanceIdentifier<T>) tnStateOpPath);
allOperationalPaths.add((InstanceIdentifier<T>) ifStateOpPath);
ItmUtils.asyncBulkRemove(dataBroker, LogicalDatastoreType.OPERATIONAL, allOperationalPaths, ItmUtils.DEFAULT_CALLBACK);
return null;
}
Aggregations