use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406.GetTunnelTypeInputBuilder in project netvirt by opendaylight.
the class VpnExtraRouteHelper method getTunnelType.
public static Class<? extends TunnelTypeBase> getTunnelType(OdlInterfaceRpcService interfaceManager, String ifName) {
try {
Future<RpcResult<GetTunnelTypeOutput>> result = interfaceManager.getTunnelType(new GetTunnelTypeInputBuilder().setIntfName(ifName).build());
RpcResult<GetTunnelTypeOutput> rpcResult = result.get();
if (!rpcResult.isSuccessful()) {
LOG.warn("RPC Call to getTunnelInterfaceId returned with Errors {}", rpcResult.getErrors());
} else {
return rpcResult.getResult().getTunnelType();
}
} catch (InterruptedException | ExecutionException e) {
LOG.warn("Exception when getting tunnel interface Id for tunnel type", e);
}
return null;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406.GetTunnelTypeInputBuilder in project genius by opendaylight.
the class InterfaceManagerConfigurationTest method checkTunnelRpcs.
private void checkTunnelRpcs() throws Exception {
// 1. Test endpoint ip fetching for dpn-id
GetEndpointIpForDpnInput endpointIpForDpnInput = new GetEndpointIpForDpnInputBuilder().setDpid(DPN_ID_2).build();
Future<RpcResult<GetEndpointIpForDpnOutput>> endpointIpForDpnOutput = odlInterfaceRpcService.getEndpointIpForDpn(endpointIpForDpnInput);
assertEqualBeans(EndPointIpFromDpn.newEndPointIpFromDpn(), endpointIpForDpnOutput.get().getResult());
// 2. fetch tunnel type from interface-name
GetTunnelTypeInput tunnelTypeInput = new GetTunnelTypeInputBuilder().setIntfName(TUNNEL_INTERFACE_NAME).build();
Future<RpcResult<GetTunnelTypeOutput>> tunnelTypeOutput = odlInterfaceRpcService.getTunnelType(tunnelTypeInput);
assertEqualBeans(TunnelTypeOutput.newTunnelTypeOutput(), tunnelTypeOutput.get().getResult());
}
Aggregations