use of org.opendaylight.yang.gen.v1.urn.huawei.params.xml.ns.yang.l3vpn.rev140815.VpnInstances in project netvirt by opendaylight.
the class NeutronvpnUtils method getExistingRDs.
public List<String> getExistingRDs() {
List<String> existingRDs = new ArrayList<>();
InstanceIdentifier<VpnInstances> path = InstanceIdentifier.builder(VpnInstances.class).build();
Optional<VpnInstances> vpnInstancesOptional = read(LogicalDatastoreType.CONFIGURATION, path);
if (vpnInstancesOptional.isPresent() && vpnInstancesOptional.get().getVpnInstance() != null) {
for (VpnInstance vpnInstance : vpnInstancesOptional.get().getVpnInstance()) {
if (vpnInstance.getIpv4Family() == null) {
continue;
}
List<String> rds = vpnInstance.getIpv4Family().getRouteDistinguisher();
if (rds != null) {
existingRDs.addAll(rds);
}
}
}
return existingRDs;
}
Aggregations