Search in sources :

Example 1 with TenantId

use of org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.TenantId in project netvirt by opendaylight.

the class VpnSubnetRouteHandlerTest method setupMocks.

private void setupMocks() {
    nexthopIp = "10.1.1.25";
    idKey = "100:1.10.1.1.24";
    poolName = "vpnservices";
    elanTag = 2L;
    longId = Long.valueOf("100");
    nodeConnectorId = buildNodeConnectorId(dpId, 2L);
    ipAddress = IpAddressBuilder.getDefaultInstance(nexthopIp);
    vpnIntfaces = new VpnInterfacesBuilder().setInterfaceName(interfaceName).setKey(new VpnInterfacesKey(interfaceName)).build();
    List<VpnInterfaces> vpnInterfaces = new ArrayList<>();
    final List<SubnetToDpn> subToDpn = new ArrayList<>();
    final List<Uuid> portList = new ArrayList<>();
    final List<PortOpDataEntry> listPortOpDataEntry = new ArrayList<>();
    final List<TunnelEndPoints> tunnelEndPoints = new ArrayList<>();
    List<Uuid> subnetIdList = new ArrayList<>();
    subnetIdList.add(subnetId);
    vpnInterfaces.add(vpnIntfaces);
    lowerLayerIfList.add(nodeConnectorId.getValue());
    portOp = new PortOpDataEntryBuilder().setDpnId(dpId).setKey(new PortOpDataEntryKey(tenantId.getValue())).setSubnetIds(subnetIdList).setPortId(tenantId.getValue()).build();
    subnetToDpn = new SubnetToDpnBuilder().setDpnId(dpId).setKey(new SubnetToDpnKey(dpId)).setVpnInterfaces(vpnInterfaces).build();
    allocateIdOutput = new AllocateIdOutputBuilder().setIdValue(longId).build();
    allocateIdInput = new AllocateIdInputBuilder().setPoolName(poolName).setIdKey(idKey).build();
    subToDpn.add(subnetToDpn);
    portList.add(portId);
    listPortOpDataEntry.add(portOp);
    org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceBuilder ifaceBuilder = new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceBuilder();
    ifaceBuilder.setLowerLayerIf(lowerLayerIfList).setType(L2vlan.class).setAdminStatus(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface.AdminStatus.Up).setOperStatus(Interface.OperStatus.Up).setIfIndex(100).setKey(new InterfaceKey(interfaceName)).setName(interfaceName).setPhysAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.PhysAddress.getDefaultInstance("AA:AA:AA:AA:AA:AA"));
    stateInterface = ifaceBuilder.build();
    subnetOp = new SubnetOpDataEntryBuilder().setElanTag(elanTag).setNhDpnId(dpId).setSubnetCidr(subnetIp).setSubnetId(subnetId).setKey(new SubnetOpDataEntryKey(subnetId)).setVpnName(interfaceName).setVrfId(primaryRd).setSubnetToDpn(subToDpn).setRouteAdvState(TaskState.Advertised).build();
    vpnInstance = new VpnInstanceBuilder().setVpnId(elanTag).setVpnInstanceName(interfaceName).setVrfId(interfaceName).setKey(new VpnInstanceKey(interfaceName)).build();
    subnetmap = new SubnetmapBuilder().setSubnetIp(subnetIp).setId(subnetId).setNetworkId(portId).setKey(new SubnetmapKey(subnetId)).setRouterId(portId).setVpnId(subnetId).setTenantId(tenantId).setPortList(portList).build();
    portOpData = new PortOpDataBuilder().setPortOpDataEntry(listPortOpDataEntry).build();
    dpntePsInfo = new DPNTEPsInfoBuilder().setDPNID(dpId).setUp(true).setKey(new DPNTEPsInfoKey(dpId)).setTunnelEndPoints(tunnelEndPoints).build();
    tunlEndPts = new TunnelEndPointsBuilder().setInterfaceName(interfaceName).setVLANID(10).setIpAddress(ipAddress).build();
    tunnelEndPoints.add(tunlEndPts);
    ipv4Family = new Ipv4FamilyBuilder().setRouteDistinguisher(routeDistinguishers).build();
    vpnInstnce = new org.opendaylight.yang.gen.v1.urn.huawei.params.xml.ns.yang.l3vpn.rev140815.vpn.instances.VpnInstanceBuilder().setKey(new org.opendaylight.yang.gen.v1.urn.huawei.params.xml.ns.yang.l3vpn.rev140815.vpn.instances.VpnInstanceKey(interfaceName)).setVpnInstanceName(interfaceName).setIpv4Family(ipv4Family).build();
    networks = new NetworksBuilder().setId(portId).setKey(new NetworksKey(portId)).build();
    doReturn(mockReadTx).when(dataBroker).newReadOnlyTransaction();
    doReturn(mockWriteTx).when(dataBroker).newWriteOnlyTransaction();
    doReturn(Futures.immediateCheckedFuture(null)).when(mockWriteTx).submit();
}
Also used : PortOpDataEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.port.op.data.PortOpDataEntryBuilder) PortOpDataEntry(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.port.op.data.PortOpDataEntry) ArrayList(java.util.ArrayList) VpnInterfacesKey(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.subnet.op.data.subnet.op.data.entry.subnet.to.dpn.VpnInterfacesKey) VpnInterfacesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.subnet.op.data.subnet.op.data.entry.subnet.to.dpn.VpnInterfacesBuilder) SubnetOpDataEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.subnet.op.data.SubnetOpDataEntryBuilder) AllocateIdOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.AllocateIdOutputBuilder) PortOpDataEntryKey(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.port.op.data.PortOpDataEntryKey) SubnetToDpn(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.subnet.op.data.subnet.op.data.entry.SubnetToDpn) NetworksKey(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.external.networks.NetworksKey) TunnelEndPointsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.dpn.endpoints.dpn.teps.info.TunnelEndPointsBuilder) AllocateIdInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.AllocateIdInputBuilder) SubnetOpDataEntryKey(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.subnet.op.data.SubnetOpDataEntryKey) SubnetToDpnKey(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.subnet.op.data.subnet.op.data.entry.SubnetToDpnKey) SubnetToDpnBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.subnet.op.data.subnet.op.data.entry.SubnetToDpnBuilder) VpnInterfaces(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.subnet.op.data.subnet.op.data.entry.subnet.to.dpn.VpnInterfaces) Ipv4FamilyBuilder(org.opendaylight.yang.gen.v1.urn.huawei.params.xml.ns.yang.l3vpn.rev140815.vpn.instances.vpn.instance.Ipv4FamilyBuilder) TunnelEndPoints(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.dpn.endpoints.dpn.teps.info.TunnelEndPoints) DPNTEPsInfoKey(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.dpn.endpoints.DPNTEPsInfoKey) InterfaceKey(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceKey) PortOpDataBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.PortOpDataBuilder) VpnInstanceKey(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.to.vpn.id.VpnInstanceKey) NetworksBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.external.networks.NetworksBuilder) DPNTEPsInfoBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.dpn.endpoints.DPNTEPsInfoBuilder) VpnInstanceBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.to.vpn.id.VpnInstanceBuilder) SubnetmapBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.rev150602.subnetmaps.SubnetmapBuilder) Mockito.doReturn(org.mockito.Mockito.doReturn) Uuid(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid) SubnetmapKey(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.rev150602.subnetmaps.SubnetmapKey)

Example 2 with TenantId

use of org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.TenantId in project netvirt by opendaylight.

the class PortPairTranslator method buildServiceFunction.

@Nonnull
public static ServiceFunction buildServiceFunction(PortPair portPair, PortPairGroup portPairGroup) {
    Preconditions.checkNotNull(portPair, "Port pair must not be null");
    Preconditions.checkNotNull(portPairGroup, "Port pair group must not be null");
    ServiceFunctionBuilder serviceFunctionBuilder = new ServiceFunctionBuilder();
    // Set SF name and tenant-id
    serviceFunctionBuilder.setName(new SfName(portPair.getName()));
    serviceFunctionBuilder.setTenantId(new TenantId(portPair.getTenantId().getValue()));
    // Set SF Type. Setting it to PortPairGroup Type, this will be overridden if user pass
    // it through service_function_params
    serviceFunctionBuilder.setType(SftTypeName.getDefaultInstance(portPairGroup.getName()));
    // If user pass specific param using service_function_parameters, set/override it accordingly
    Class transportTypeClass = null;
    List<ServiceFunctionParameters> sfParams = portPair.getServiceFunctionParameters();
    if (sfParams != null) {
        for (ServiceFunctionParameters sfParam : sfParams) {
            // There is by default type set to port pair group name, override it if user pass it specific type
            if (sfParam.getServiceFunctionParameter().equals(SF_TYPE_PARAM)) {
                serviceFunctionBuilder.setType(new SftTypeName(sfParam.getServiceFunctionParameterValue()));
            }
            if (sfParam.getServiceFunctionParameter().equals(DPL_TRANSPORT_PARAM)) {
                transportTypeClass = DPL_TRANSPORT_TYPE.get(sfParam.getServiceFunctionParameterValue());
            }
        }
    }
    // Build forward DPL
    SfDataPlaneLocatorBuilder sfForwardDplBuilder = new SfDataPlaneLocatorBuilder();
    sfForwardDplBuilder.setName(new SfDataPlaneLocatorName(portPair.getName() + DPL_INGRESS_SUFFIX));
    sfForwardDplBuilder.setTransport(transportTypeClass == null ? Mac.class : transportTypeClass);
    sfForwardDplBuilder.setServiceFunctionForwarder(new SffName(SfcMdsalHelper.NETVIRT_LOGICAL_SFF_NAME));
    String forwardPort = portPair.getIngress().getValue();
    LogicalInterface forwardInterface = new LogicalInterfaceBuilder().setInterfaceName(forwardPort).build();
    sfForwardDplBuilder.setLocatorType(forwardInterface);
    // Build reverse DPL
    SfDataPlaneLocatorBuilder sfReverseDplBuilder = new SfDataPlaneLocatorBuilder();
    sfReverseDplBuilder.setName(new SfDataPlaneLocatorName(portPair.getName() + DPL_EGRESS_SUFFIX));
    sfReverseDplBuilder.setTransport(transportTypeClass == null ? Mac.class : transportTypeClass);
    sfReverseDplBuilder.setServiceFunctionForwarder(new SffName(SfcMdsalHelper.NETVIRT_LOGICAL_SFF_NAME));
    String reversePort = portPair.getEgress().getValue();
    LogicalInterface reverseInterface = new LogicalInterfaceBuilder().setInterfaceName(reversePort).build();
    sfReverseDplBuilder.setLocatorType(reverseInterface);
    // Set all data plane locator
    List<SfDataPlaneLocator> sfDataPlaneLocatorList = new ArrayList<>();
    sfDataPlaneLocatorList.add(sfForwardDplBuilder.build());
    sfDataPlaneLocatorList.add(sfReverseDplBuilder.build());
    serviceFunctionBuilder.setSfDataPlaneLocator(sfDataPlaneLocatorList);
    return serviceFunctionBuilder.build();
}
Also used : SfDataPlaneLocator(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sf.rev140701.service.function.base.SfDataPlaneLocator) ServiceFunctionBuilder(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sf.rev140701.service.functions.ServiceFunctionBuilder) ArrayList(java.util.ArrayList) SffName(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SffName) Mac(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sl.rev140701.Mac) TenantId(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.TenantId) SfDataPlaneLocatorName(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SfDataPlaneLocatorName) SftTypeName(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SftTypeName) LogicalInterfaceBuilder(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.sfc.sff.logical.rev160620.service.functions.service.function.sf.data.plane.locator.locator.type.LogicalInterfaceBuilder) LogicalInterface(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.sfc.sff.logical.rev160620.service.functions.service.function.sf.data.plane.locator.locator.type.LogicalInterface) SfName(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SfName) SfDataPlaneLocatorBuilder(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sf.rev140701.service.function.base.SfDataPlaneLocatorBuilder) ServiceFunctionParameters(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.sfc.rev160511.port.pair.attributes.ServiceFunctionParameters) Nonnull(javax.annotation.Nonnull)

Example 3 with TenantId

use of org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.TenantId in project netvirt by opendaylight.

the class IfMgr method addSubnet.

/**
 * Add Subnet.
 *
 * @param snetId subnet id
 * @param name subnet name
 * @param tenantId tenant id
 * @param gatewayIp gateway ip address
 * @param ipVersion IP Version "IPv4 or IPv6"
 * @param subnetCidr subnet CIDR
 * @param ipV6AddressMode Address Mode of IPv6 Subnet
 * @param ipV6RaMode RA Mode of IPv6 Subnet.
 */
public void addSubnet(Uuid snetId, String name, Uuid tenantId, IpAddress gatewayIp, String ipVersion, IpPrefix subnetCidr, String ipV6AddressMode, String ipV6RaMode) {
    // in expanded form and are used during Neighbor Discovery Support.
    if (gatewayIp != null) {
        Ipv6Address addr = new Ipv6Address(InetAddresses.forString(gatewayIp.getIpv6Address().getValue()).getHostAddress());
        gatewayIp = new IpAddress(addr);
    }
    VirtualSubnet snet = VirtualSubnet.builder().subnetUUID(snetId).tenantID(tenantId).name(name).gatewayIp(gatewayIp).subnetCidr(subnetCidr).ipVersion(ipVersion).ipv6AddressMode(ipV6AddressMode).ipv6RAMode(ipV6RaMode).build();
    vsubnets.put(snetId, snet);
    List<VirtualPort> intfList = unprocessedSubnetIntfs.remove(snetId);
    if (intfList == null) {
        LOG.debug("No unprocessed interfaces for the subnet {}", snetId);
        return;
    }
    synchronized (intfList) {
        for (VirtualPort intf : intfList) {
            if (intf != null) {
                intf.setSubnet(snetId, snet);
                snet.addInterface(intf);
                VirtualRouter rtr = intf.getRouter();
                if (rtr != null) {
                    rtr.addSubnet(snet);
                }
            }
        }
    }
}
Also used : IVirtualPort(org.opendaylight.netvirt.ipv6service.api.IVirtualPort) IVirtualSubnet(org.opendaylight.netvirt.ipv6service.api.IVirtualSubnet) IpAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress) Ipv6Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address) IVirtualRouter(org.opendaylight.netvirt.ipv6service.api.IVirtualRouter)

Example 4 with TenantId

use of org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.TenantId in project netvirt by opendaylight.

the class NeutronvpnManager method updateVpnMaps.

private void updateVpnMaps(Uuid vpnId, String name, Uuid router, Uuid tenantId, List<Uuid> networks) {
    VpnMapBuilder builder;
    boolean isLockAcquired = false;
    InstanceIdentifier<VpnMap> vpnMapIdentifier = InstanceIdentifier.builder(VpnMaps.class).child(VpnMap.class, new VpnMapKey(vpnId)).build();
    try {
        Optional<VpnMap> optionalVpnMap = SingleTransactionDataBroker.syncReadOptional(dataBroker, LogicalDatastoreType.CONFIGURATION, vpnMapIdentifier);
        if (optionalVpnMap.isPresent()) {
            builder = new VpnMapBuilder(optionalVpnMap.get());
        } else {
            builder = new VpnMapBuilder().setKey(new VpnMapKey(vpnId)).setVpnId(vpnId);
        }
        if (name != null) {
            builder.setName(name);
        }
        if (tenantId != null) {
            builder.setTenantId(tenantId);
        }
        if (router != null) {
            builder.setRouterId(router);
        }
        if (networks != null) {
            List<Uuid> nwList = builder.getNetworkIds();
            if (nwList == null) {
                nwList = new ArrayList<>();
            }
            nwList.addAll(networks);
            builder.setNetworkIds(nwList);
        }
        isLockAcquired = vpnLock.tryLock(vpnId, LOCK_WAIT_TIME, TimeUnit.SECONDS);
        LOG.debug("Creating/Updating vpnMaps node: {} ", vpnId.getValue());
        SingleTransactionDataBroker.syncWrite(dataBroker, LogicalDatastoreType.CONFIGURATION, vpnMapIdentifier, builder.build());
        LOG.debug("VPNMaps DS updated for VPN {} ", vpnId.getValue());
    } catch (ReadFailedException | TransactionCommitFailedException e) {
        LOG.error("UpdateVpnMaps failed for node: {} ", vpnId.getValue());
    } finally {
        if (isLockAcquired) {
            vpnLock.unlock(vpnId);
        }
    }
}
Also used : ReadFailedException(org.opendaylight.controller.md.sal.common.api.data.ReadFailedException) TransactionCommitFailedException(org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException) Uuid(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid) VpnMapBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.rev150602.vpnmaps.VpnMapBuilder) VpnMap(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.rev150602.vpnmaps.VpnMap) VpnMapKey(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.rev150602.vpnmaps.VpnMapKey)

Example 5 with TenantId

use of org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.TenantId in project netvirt by opendaylight.

the class NeutronvpnManager method showVpnConfigCLI.

/**
 * Implementation of the "vpnservice:l3vpn-config-show" karaf CLI command.
 *
 * @param vpnuuid Uuid of the VPN whose config must be shown
 * @return formatted output list
 * @throws InterruptedException if there was a thread related problem getting the data to display
 * @throws ExecutionException if there was any other problem getting the data to display
 */
public List<String> showVpnConfigCLI(Uuid vpnuuid) throws InterruptedException, ExecutionException {
    List<String> result = new ArrayList<>();
    if (vpnuuid == null) {
        result.add("");
        result.add("Displaying VPN config for all VPNs");
        result.add("To display VPN config for a particular VPN, use the following syntax");
        result.add(getshowVpnConfigCLIHelp());
    }
    RpcResult<GetL3VPNOutput> rpcResult = getL3VPN(new GetL3VPNInputBuilder().setId(vpnuuid).build()).get();
    if (rpcResult.isSuccessful()) {
        result.add("");
        result.add(String.format(" %-37s %-37s %-7s ", "VPN ID", "Tenant ID", "RD"));
        result.add("");
        result.add(String.format(" %-80s ", "Import-RTs"));
        result.add("");
        result.add(String.format(" %-80s ", "Export-RTs"));
        result.add("");
        result.add(String.format(" %-76s ", "Subnet IDs"));
        result.add("");
        result.add("------------------------------------------------------------------------------------");
        result.add("");
        List<L3vpnInstances> vpnList = rpcResult.getResult().getL3vpnInstances();
        for (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.rev150602.VpnInstance vpn : vpnList) {
            String tenantId = vpn.getTenantId() != null ? vpn.getTenantId().getValue() : "\"                 " + "                  \"";
            result.add(String.format(" %-37s %-37s %-7s ", vpn.getId().getValue(), tenantId, vpn.getRouteDistinguisher()));
            result.add("");
            result.add(String.format(" %-80s ", vpn.getImportRT()));
            result.add("");
            result.add(String.format(" %-80s ", vpn.getExportRT()));
            result.add("");
            Uuid vpnid = vpn.getId();
            List<Uuid> subnetList = neutronvpnUtils.getSubnetsforVpn(vpnid);
            if (!subnetList.isEmpty()) {
                for (Uuid subnetuuid : subnetList) {
                    result.add(String.format(" %-76s ", subnetuuid.getValue()));
                }
            } else {
                result.add(String.format(" %-76s ", "\"                                    \""));
            }
            result.add("");
            result.add("----------------------------------------");
            result.add("");
        }
    } else {
        String errortag = rpcResult.getErrors().iterator().next().getTag();
        if (Objects.equals(errortag, "")) {
            result.add("");
            result.add("No VPN has been configured yet");
        } else if (Objects.equals(errortag, "invalid-value")) {
            result.add("");
            result.add("VPN " + vpnuuid.getValue() + " is not present");
        } else {
            result.add("error getting VPN info : " + rpcResult.getErrors());
            result.add(getshowVpnConfigCLIHelp());
        }
    }
    return result;
}
Also used : ArrayList(java.util.ArrayList) GetL3VPNOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.rev150602.GetL3VPNOutput) L3vpnInstances(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.rev150602.getl3vpn.output.L3vpnInstances) Uuid(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid) GetL3VPNInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.rev150602.GetL3VPNInputBuilder)

Aggregations

Uuid (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid)5 ArrayList (java.util.ArrayList)3 SubnetmapKey (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.rev150602.subnetmaps.SubnetmapKey)3 ReadFailedException (org.opendaylight.controller.md.sal.common.api.data.ReadFailedException)2 TransactionCommitFailedException (org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException)2 SubnetOpDataEntryKey (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.subnet.op.data.SubnetOpDataEntryKey)2 Subnetmap (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.rev150602.subnetmaps.Subnetmap)2 SubnetmapBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.rev150602.subnetmaps.SubnetmapBuilder)2 VpnMap (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.rev150602.vpnmaps.VpnMap)2 Optional (com.google.common.base.Optional)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 Nonnull (javax.annotation.Nonnull)1 Mockito.doReturn (org.mockito.Mockito.doReturn)1 SingleTransactionDataBroker.syncReadOptional (org.opendaylight.genius.datastoreutils.SingleTransactionDataBroker.syncReadOptional)1 IVirtualPort (org.opendaylight.netvirt.ipv6service.api.IVirtualPort)1 IVirtualRouter (org.opendaylight.netvirt.ipv6service.api.IVirtualRouter)1 IVirtualSubnet (org.opendaylight.netvirt.ipv6service.api.IVirtualSubnet)1 SfDataPlaneLocatorName (org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SfDataPlaneLocatorName)1