use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns.RouterDpnListKey in project netvirt by opendaylight.
the class NatUtil method getDpnsForRouter.
@Nonnull
public static List<BigInteger> getDpnsForRouter(DataBroker dataBroker, String routerUuid) {
InstanceIdentifier id = InstanceIdentifier.builder(NeutronRouterDpns.class).child(RouterDpnList.class, new RouterDpnListKey(routerUuid)).build();
Optional<RouterDpnList> routerDpnListData = SingleTransactionDataBroker.syncReadOptionalAndTreatReadFailedExceptionAsAbsentOptional(dataBroker, LogicalDatastoreType.OPERATIONAL, id);
List<BigInteger> dpns = new ArrayList<>();
if (routerDpnListData.isPresent()) {
List<DpnVpninterfacesList> dpnVpninterfacesList = routerDpnListData.get().getDpnVpninterfacesList();
for (DpnVpninterfacesList dpnVpnInterface : dpnVpninterfacesList) {
dpns.add(dpnVpnInterface.getDpnId());
}
}
return dpns;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns.RouterDpnListKey in project netvirt by opendaylight.
the class NeutronvpnUtils method getDpnsForRouter.
@Nonnull
public List<BigInteger> getDpnsForRouter(String routerUuid) {
InstanceIdentifier id = InstanceIdentifier.builder(NeutronRouterDpns.class).child(RouterDpnList.class, new RouterDpnListKey(routerUuid)).build();
Optional<RouterDpnList> routerDpnListData = SingleTransactionDataBroker.syncReadOptionalAndTreatReadFailedExceptionAsAbsentOptional(dataBroker, LogicalDatastoreType.OPERATIONAL, id);
List<BigInteger> dpns = new ArrayList<>();
if (routerDpnListData.isPresent()) {
List<DpnVpninterfacesList> dpnVpninterfacesList = routerDpnListData.get().getDpnVpninterfacesList();
for (DpnVpninterfacesList dpnVpnInterface : dpnVpninterfacesList) {
dpns.add(dpnVpnInterface.getDpnId());
}
}
return dpns;
}
Aggregations