Examples of VnSubnetsType


Examples of net.juniper.contrail.api.types.VnSubnetsType

            assertNotNull(ipam);
        } catch (IOException ex) {
            fail(ex.getMessage());
        }

        VnSubnetsType subnet = new VnSubnetsType();
        subnet.addIpamSubnets(new SubnetType("10.0.2.0", 24), "10.0.2.254");

        net.addNetworkIpam(ipam, subnet);

        VirtualMachine vncVm = new VirtualMachine();
        vncVm.setName("test-vnc-only-vm-1");
View Full Code Here

Examples of net.juniper.contrail.api.types.VnSubnetsType

            }
            _ipam = ipam;
        }

        if (_prefix != null) {
            VnSubnetsType subnet = new VnSubnetsType();
            String[] addr_pair = _prefix.split("\\/");
            subnet.addIpamSubnets(new SubnetType(addr_pair[0], Integer.parseInt(addr_pair[1])), _gateway);
            _vn.setNetworkIpam(_ipam, subnet);
        } else if (_trafficType == TrafficType.Public) {
            _vn.clearNetworkIpam();
            /* Subnet information for Public is stored in the vlan table */
            List<VlanVO> vlan_list = vlanDao.listVlansByNetworkId(_id);
            for (VlanVO vlan : vlan_list) {
                String cidr = NetUtils.ipAndNetMaskToCidr(vlan.getVlanGateway(), vlan.getVlanNetmask());
                int slash = cidr.indexOf('/');
                String ip_addr = cidr.substring(0, slash);
                int plen = Integer.parseInt(cidr.substring(slash + 1));
                VnSubnetsType subnet = new VnSubnetsType();
                subnet.addIpamSubnets(new SubnetType(ip_addr, plen), vlan.getVlanGateway());
                _vn.addNetworkIpam(_ipam, subnet);
            }
        }
        return;
    }
View Full Code Here

Examples of net.juniper.contrail.api.types.VnSubnetsType

        return false;
    }

    if (ipamRefs != null) {
        for (ObjectReference<VnSubnetsType> ref : ipamRefs) {
            VnSubnetsType vnSubnetType = ref.getAttr();
            if (vnSubnetType != null) {
                List<VnSubnetsType.IpamSubnetType> subnets = vnSubnetType.getIpamSubnets();
                if (subnets != null && !subnets.isEmpty()) {
                    VnSubnetsType.IpamSubnetType ipamSubnet = subnets.get(0);
                    vncSubnets.add(ipamSubnet.getDefaultGateway() + ipamSubnet.getSubnet().getIpPrefix() + "/" + ipamSubnet.getSubnet().getIpPrefixLen());
                }
            }
View Full Code Here

Examples of net.juniper.contrail.api.types.VnSubnetsType

        if (currentIpamRefs == null) {
            return true;
        }

        for (ObjectReference<VnSubnetsType> ref : currentIpamRefs) {
            VnSubnetsType vnSubnetType = ref.getAttr();
            if (vnSubnetType != null) {
                List<VnSubnetsType.IpamSubnetType> subnets = vnSubnetType.getIpamSubnets();
                if (subnets != null && !subnets.isEmpty()) {
                    VnSubnetsType.IpamSubnetType ipamSubnet = subnets.get(0);
                    currentSubnets.add(ipamSubnet.getDefaultGateway() + ipamSubnet.getSubnet().getIpPrefix() + "/" + ipamSubnet.getSubnet().getIpPrefixLen());
                }
            }
        }

        for (ObjectReference<VnSubnetsType> ref : newIpamRefs) {
            VnSubnetsType vnSubnetType = ref.getAttr();
            if (vnSubnetType != null) {
                List<VnSubnetsType.IpamSubnetType> subnets = vnSubnetType.getIpamSubnets();
                if (subnets != null && !subnets.isEmpty()) {
                    VnSubnetsType.IpamSubnetType ipamSubnet = subnets.get(0);
                    newSubnets.add(ipamSubnet.getDefaultGateway() + ipamSubnet.getSubnet().getIpPrefix() + "/" + ipamSubnet.getSubnet().getIpPrefixLen());
                }
            }
View Full Code Here

Examples of net.juniper.contrail.api.types.VnSubnetsType

            }
            _ipam = ipam;
        }

        if (_prefix != null) {
            VnSubnetsType subnet = new VnSubnetsType();
            String[] addr_pair = _prefix.split("\\/");
            subnet.addIpamSubnets(new SubnetType(addr_pair[0], Integer.parseInt(addr_pair[1])), _gateway);
            vn.setNetworkIpam(_ipam, subnet);
        } else if (_trafficType == TrafficType.Public) {
            vn.clearNetworkIpam();
            /* Subnet information for Public is stored in the vlan table */
            List<VlanVO> vlan_list = vlanDao.listVlansByNetworkId(_id);
            for (VlanVO vlan : vlan_list) {
                String cidr = NetUtils.ipAndNetMaskToCidr(vlan.getVlanGateway(), vlan.getVlanNetmask());
                int slash = cidr.indexOf('/');
                String ip_addr = cidr.substring(0, slash);
                int plen = Integer.parseInt(cidr.substring(slash + 1));
                VnSubnetsType subnet = new VnSubnetsType();
                subnet.addIpamSubnets(new SubnetType(ip_addr, plen), vlan.getVlanGateway());
                vn.addNetworkIpam(_ipam, subnet);
            }
        }

        if (_vn == null) {
View Full Code Here

Examples of net.juniper.contrail.api.types.VnSubnetsType

            }
            _ipam = ipam;
        }

        if (_prefix != null) {
            VnSubnetsType subnet = new VnSubnetsType();
            String[] addr_pair = _prefix.split("\\/");
            subnet.addIpamSubnets(new SubnetType(addr_pair[0], Integer.parseInt(addr_pair[1])), _gateway);
            vn.setNetworkIpam(_ipam, subnet);
        } else if (_trafficType == TrafficType.Public) {
            vn.clearNetworkIpam();
            /* Subnet information for Public is stored in the vlan table */
            List<VlanVO> vlan_list = vlanDao.listVlansByNetworkId(_id);
            for (VlanVO vlan : vlan_list) {
                String cidr = NetUtils.ipAndNetMaskToCidr(vlan.getVlanGateway(), vlan.getVlanNetmask());
                int slash = cidr.indexOf('/');
                String ip_addr = cidr.substring(0, slash);
                int plen = Integer.parseInt(cidr.substring(slash + 1));
                VnSubnetsType subnet = new VnSubnetsType();
                subnet.addIpamSubnets(new SubnetType(ip_addr, plen), vlan.getVlanGateway());
                vn.addNetworkIpam(_ipam, subnet);
            }
        }

        if (_vn == null) {
View Full Code Here

Examples of net.juniper.contrail.api.types.VnSubnetsType

            }
            _ipam = ipam;
        }

        if (_prefix != null) {
            VnSubnetsType subnet = new VnSubnetsType();
            String[] addr_pair = _prefix.split("\\/");
            subnet.addIpamSubnets(new SubnetType(addr_pair[0], Integer.parseInt(addr_pair[1])), _gateway);
            _vn.setNetworkIpam(_ipam, subnet);
        } else if (_trafficType == TrafficType.Public) {
            _vn.clearNetworkIpam();
            /* Subnet information for Public is stored in the vlan table */
            List<VlanVO> vlan_list = vlanDao.listVlansByNetworkId(_id);
            for (VlanVO vlan : vlan_list) {
                String cidr = NetUtils.ipAndNetMaskToCidr(vlan.getVlanGateway(), vlan.getVlanNetmask());
                int slash = cidr.indexOf('/');
                String ip_addr = cidr.substring(0, slash);
                int plen = Integer.parseInt(cidr.substring(slash + 1));
                VnSubnetsType subnet = new VnSubnetsType();
                subnet.addIpamSubnets(new SubnetType(ip_addr, plen), vlan.getVlanGateway());
                _vn.addNetworkIpam(_ipam, subnet);
            }
        }
        return;
    }
View Full Code Here

Examples of net.juniper.contrail.api.types.VnSubnetsType

            return false;
        }
       
        if (ipamRefs != null) {
            for (ObjectReference<VnSubnetsType> ref: ipamRefs) {
                VnSubnetsType vnSubnetType = ref.getAttr();
                if (vnSubnetType != null) {
                    List<VnSubnetsType.IpamSubnetType> subnets = vnSubnetType.getIpamSubnets();
                    if (subnets != null && !subnets.isEmpty()) {
                        VnSubnetsType.IpamSubnetType ipamSubnet = subnets.get(0);
                        vncSubnets.add(ipamSubnet.getDefaultGateway() +
                                ipamSubnet.getSubnet().getIpPrefix() +"/" + ipamSubnet.getSubnet().getIpPrefixLen())
                   
View Full Code Here

Examples of net.juniper.contrail.api.types.VnSubnetsType

        if (currentIpamRefs == null) {
            return true;
        }
       
        for (ObjectReference<VnSubnetsType> ref: currentIpamRefs) {
            VnSubnetsType vnSubnetType = ref.getAttr();
            if (vnSubnetType != null) {
                List<VnSubnetsType.IpamSubnetType> subnets = vnSubnetType.getIpamSubnets();
                if (subnets != null && !subnets.isEmpty()) {
                    VnSubnetsType.IpamSubnetType ipamSubnet = subnets.get(0);
                    currentSubnets.add(ipamSubnet.getDefaultGateway() + ipamSubnet.getSubnet().getIpPrefix() +
                            "/" + ipamSubnet.getSubnet().getIpPrefixLen())
                }
            }
        }
       
        for (ObjectReference<VnSubnetsType> ref: newIpamRefs) {
            VnSubnetsType vnSubnetType = ref.getAttr();
            if (vnSubnetType != null) {
                List<VnSubnetsType.IpamSubnetType> subnets = vnSubnetType.getIpamSubnets();
                if (subnets != null && !subnets.isEmpty()) {
                    VnSubnetsType.IpamSubnetType ipamSubnet = subnets.get(0);
                    newSubnets.add(ipamSubnet.getDefaultGateway() + ipamSubnet.getSubnet().getIpPrefix() +
                            "/" + ipamSubnet.getSubnet().getIpPrefixLen())
                }
View Full Code Here

Examples of net.juniper.contrail.api.types.VnSubnetsType

            assertNotNull(ipam);
        } catch (IOException ex) {
            fail(ex.getMessage());
        }

        VnSubnetsType subnet = new VnSubnetsType();
        subnet.addIpamSubnets(new SubnetType("10.0.2.0", 24), "10.0.2.254");

        net.addNetworkIpam(ipam, subnet);

        VirtualMachine vncVm = new VirtualMachine();
        vncVm.setName("test-vnc-only-vm-1");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.