use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.interfaces.ElanInterface in project netvirt by opendaylight.
the class AclServiceTestBase method newElanInterface.
protected void newElanInterface(String elanName, String portName, boolean isWrite) throws TransactionCommitFailedException {
ElanInterface elanInterface = new ElanInterfaceBuilder().setName(portName).setElanInstanceName(elanName).build();
InstanceIdentifier<ElanInterface> id = AclServiceUtils.getElanInterfaceConfigurationDataPathId(portName);
if (isWrite) {
singleTransactionDataBroker.syncWrite(CONFIGURATION, id, elanInterface);
} else {
singleTransactionDataBroker.syncDelete(CONFIGURATION, id);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.interfaces.ElanInterface in project netvirt by opendaylight.
the class TransportZoneNotificationUtil method shouldCreateVtep.
public boolean shouldCreateVtep(List<VpnInterfaces> vpnInterfaces) {
if (vpnInterfaces == null || vpnInterfaces.isEmpty()) {
return false;
}
for (VpnInterfaces vpnInterface : vpnInterfaces) {
String interfaceName = vpnInterface.getInterfaceName();
ElanInterface elanInt = elanService.getElanInterfaceByElanInterfaceName(interfaceName);
if (elanInt == null) {
continue;
}
if (ElanUtils.isVxlanNetworkOrVxlanSegment(elanInstanceCache.get(elanInt.getElanInstanceName()).orNull())) {
return true;
} else {
LOG.debug("Non-VXLAN elanInstance: {}", elanInt.getElanInstanceName());
}
}
return false;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.interfaces.ElanInterface in project netvirt by opendaylight.
the class VpnUtil method isVlan.
public static boolean isVlan(DataBroker databroker, String interfaceName) {
ElanInterface elanInterface = getElanInterfaceByElanInterfaceName(databroker, interfaceName);
if (elanInterface == null) {
return false;
}
ElanInstance elanInstance = getElanInstanceByName(databroker, elanInterface.getElanInstanceName());
return isVlan(elanInstance);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.interfaces.ElanInterface in project netvirt by opendaylight.
the class ElanInterfaceGet method doExecute.
@Override
protected Object doExecute() {
LOG.debug("Executing Get ElanInterface command for the corresponding Elan Instance for {}", elanName);
if (elanName != null) {
ElanInstance elanInstance = elanProvider.getElanInstance(elanName);
List<String> elanInterfaces = elanProvider.getElanInterfaces(elanName);
if (elanInterfaces == null) {
session.getConsole().println("No Elan Interfaces present for ELan Instance:" + elanName);
return null;
}
session.getConsole().println(getElanInterfaceHeaderOutput());
displayInterfaces(elanInstance, elanInterfaces);
} else {
List<ElanInstance> elanInstances = elanProvider.getElanInstances();
if (!elanInstances.isEmpty()) {
session.getConsole().println(getElanInterfaceHeaderOutput());
for (ElanInstance elanInstance : elanInstances) {
List<String> elanInterfaces = elanProvider.getElanInterfaces(elanInstance.getElanInstanceName());
displayInterfaces(elanInstance, elanInterfaces);
session.getConsole().println("\n");
}
}
}
return null;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.interfaces.ElanInterface in project netvirt by opendaylight.
the class NeutronvpnManager method removeExternalVpnInterfaces.
// TODO Clean up the exception handling
@SuppressWarnings("checkstyle:IllegalCatch")
protected void removeExternalVpnInterfaces(Uuid extNetId) {
Collection<String> extElanInterfaces = elanService.getExternalElanInterfaces(extNetId.getValue());
if (extElanInterfaces == null || extElanInterfaces.isEmpty()) {
LOG.error("No external ports attached for external network {}", extNetId.getValue());
return;
}
try {
WriteTransaction wrtConfigTxn = dataBroker.newWriteOnlyTransaction();
for (String elanInterface : extElanInterfaces) {
InstanceIdentifier<VpnInterface> vpnIfIdentifier = NeutronvpnUtils.buildVpnInterfaceIdentifier(elanInterface);
LOG.info("Removing vpn interface {}", elanInterface);
wrtConfigTxn.delete(LogicalDatastoreType.CONFIGURATION, vpnIfIdentifier);
}
wrtConfigTxn.submit();
} catch (Exception ex) {
LOG.error("Removal of vpninterfaces {} failed", extElanInterfaces, ex);
}
}
Aggregations