use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.evpn.rd.to.networks.EvpnRdToNetworkBuilder in project netvirt by opendaylight.
the class EvpnTestHelper method updateRdtoNetworks.
public void updateRdtoNetworks(ElanInstance actualElanInstances) throws TransactionCommitFailedException {
EvpnRdToNetworkBuilder evpnRdToNetworkBuilder = new EvpnRdToNetworkBuilder().setKey(new EvpnRdToNetworkKey(RD));
evpnRdToNetworkBuilder.setRd(RD);
evpnRdToNetworkBuilder.setNetworkId(ELAN1);
LOG.info("updating Evpn {} with elaninstance {} and rd {}", "evpn1", actualElanInstances, RD);
singleTxdataBroker.syncWrite(LogicalDatastoreType.CONFIGURATION, getRdToNetworkIdentifier(RD), evpnRdToNetworkBuilder.build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.evpn.rd.to.networks.EvpnRdToNetworkBuilder in project netvirt by opendaylight.
the class NeutronEvpnUtils method updateVpnWithElanInfo.
public void updateVpnWithElanInfo(VpnInstance vpnInstance, String elanInstanceName, Operation operation) {
String rd = vpnManager.getPrimaryRdFromVpnInstance(vpnInstance);
InstanceIdentifier<EvpnRdToNetwork> rdToNetworkIdentifier = getRdToNetworkIdentifier(rd);
jobCoordinator.enqueueJob("EVPN_ASSOCIATE-" + rd, () -> {
ReadWriteTransaction transaction = dataBroker.newReadWriteTransaction();
List<ListenableFuture<Void>> futures = new ArrayList<>();
if (operation == Operation.DELETE) {
LOG.debug("Deleting Evpn-Network with key {}", rd);
transaction.delete(LogicalDatastoreType.CONFIGURATION, rdToNetworkIdentifier);
} else {
EvpnRdToNetworkBuilder evpnRdToNetworkBuilder = new EvpnRdToNetworkBuilder().setKey(new EvpnRdToNetworkKey(rd));
evpnRdToNetworkBuilder.setRd(rd);
evpnRdToNetworkBuilder.setNetworkId(elanInstanceName);
LOG.info("updating Evpn {} with elaninstance {} and rd {}", vpnInstance.getVpnInstanceName(), elanInstanceName, rd);
transaction.put(LogicalDatastoreType.CONFIGURATION, rdToNetworkIdentifier, evpnRdToNetworkBuilder.build(), WriteTransaction.CREATE_MISSING_PARENTS);
}
futures.add(transaction.submit());
return futures;
});
}
Aggregations