use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.monitor.rev200120.RouterId in project netvirt by opendaylight.
the class NatRpcServiceImpl method getNatTranslationsOnVpn.
@Override
public ListenableFuture<RpcResult<GetNatTranslationsOnVpnOutput>> getNatTranslationsOnVpn(GetNatTranslationsOnVpnInput input) {
RpcResultBuilder<GetNatTranslationsOnVpnOutput> rpcResultBuilder = null;
List<Uuid> routerUuidList = NatUtil.getRouterUuIdsForVpn(dataBroker, input.getVpnUuid());
if (routerUuidList.isEmpty()) {
String errMsg = String.format("404 Not Found - Invalid external vpn {%s} provided", input.getVpnUuid().getValue());
rpcResultBuilder = RpcResultBuilder.<GetNatTranslationsOnVpnOutput>failed().withError(RpcError.ErrorType.APPLICATION, errMsg);
return rpcResultBuilder.buildFuture();
}
List<RouterNat> natRouterList = new ArrayList<>();
for (Uuid routerUuid : routerUuidList) {
Uint32 routerId = NatUtil.getVpnId(dataBroker, routerUuid.getValue());
if (routerId == NatConstants.INVALID_ID) {
LOG.warn("getNatTranslationsOnVpn : Invalid RouterID found {}", routerId);
continue;
}
natRouterList.addAll(constructNatInformation(routerUuid, routerId));
}
GetNatTranslationsOnVpnOutputBuilder output = new GetNatTranslationsOnVpnOutputBuilder().setRouterNat(natRouterList);
rpcResultBuilder = RpcResultBuilder.success();
rpcResultBuilder.withResult(output.build());
return Futures.immediateFuture(rpcResultBuilder.build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.monitor.rev200120.RouterId in project netvirt by opendaylight.
the class NatRpcServiceImpl method getNatTranslationsOnRouter.
@Override
public ListenableFuture<RpcResult<GetNatTranslationsOnRouterOutput>> getNatTranslationsOnRouter(GetNatTranslationsOnRouterInput input) {
RpcResultBuilder<GetNatTranslationsOnRouterOutput> rpcResultBuilder = null;
Uint32 routerId = NatUtil.getVpnId(dataBroker, input.getRouterUuid().getValue());
if (routerId == NatConstants.INVALID_ID) {
String errMsg = String.format("404 Not Found - No Router found with UUID {%s}", input.getRouterUuid().getValue());
rpcResultBuilder = RpcResultBuilder.<GetNatTranslationsOnRouterOutput>failed().withError(RpcError.ErrorType.APPLICATION, errMsg);
return rpcResultBuilder.buildFuture();
}
List<RouterNat> routerNatList = constructNatInformation(input.getRouterUuid(), routerId);
GetNatTranslationsOnRouterOutputBuilder output = new GetNatTranslationsOnRouterOutputBuilder().setRouterNat(routerNatList);
rpcResultBuilder = RpcResultBuilder.success();
rpcResultBuilder.withResult(output.build());
return rpcResultBuilder.buildFuture();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.monitor.rev200120.RouterId in project netvirt by opendaylight.
the class BgpConfigurationManager method startBgp.
public void startBgp(long as, String routerId, int spt, boolean fbit) {
IpAddress rid = routerId == null ? null : IpAddressBuilder.getDefaultInstance(routerId);
Long staleTime = (long) spt;
InstanceIdentifier.InstanceIdentifierBuilder<AsId> iib = InstanceIdentifier.builder(Bgp.class).child(AsId.class);
InstanceIdentifier<AsId> iid = iib.build();
AsId dto = new AsIdBuilder().setLocalAs(as).setRouterId(rid).setStalepathTime(staleTime).setAnnounceFbit(fbit).build();
update(iid, dto);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.monitor.rev200120.RouterId in project netvirt by opendaylight.
the class NeutronvpnUtils method getVpnInstanceRouterIdsList.
public static List<RouterIds> getVpnInstanceRouterIdsList(List<Uuid> routerIds) {
List<RouterIds> listRouterIds = new ArrayList<>();
for (Uuid routerId : routerIds) {
final RouterIds routerIdInstance = getvpnInstanceRouterIds(routerId);
listRouterIds.add(routerIdInstance);
}
return listRouterIds;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.monitor.rev200120.RouterId in project netvirt by opendaylight.
the class NeutronvpnUtils method getNeutronRouter.
protected Router getNeutronRouter(Uuid routerId) {
Router router = routerMap.get(routerId);
if (router != null) {
return router;
}
Optional<Router> rtr = read(LogicalDatastoreType.CONFIGURATION, getNeutronRouterIid(routerId));
if (rtr.isPresent()) {
router = rtr.get();
}
return router;
}
Aggregations