public static List<Neutron_IPs> convertMDSalIpToNeutronIp(List<FixedIps> fixedIps) { List<Neutron_IPs> ips = null; if (fixedIps != null) { ips = new ArrayList<>(); for (FixedIps mdIP : fixedIps) { Neutron_IPs ip = new Neutron_IPs(); ip.setIpAddress(String.valueOf(mdIP.getIpAddress().getValue())); ip.setSubnetUUID(mdIP.getSubnetId().getValue()); ips.add(ip); } } return ips; }
public NeutronPort createNeutronPort(String networkId, String subnetId, String id, String owner, String ipaddr, String mac, NeutronSecurityGroup... secGroups) { INeutronPortCRUD iNeutronPortCRUD = (INeutronPortCRUD) ServiceHelper.getGlobalInstance(INeutronPortCRUD.class, this); NeutronPort np = new NeutronPort(); np.initDefaults(); np.setID(id); np.setDeviceOwner(owner); np.setMacAddress(mac); np.setNetworkUUID(networkId); List<org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_IPs> srcAddressList = new ArrayList<>(); org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_IPs nip = new org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_IPs(); nip.setIpAddress(ipaddr); nip.setSubnetUUID(subnetId); srcAddressList.add(nip); np.setFixedIPs(srcAddressList); List<NeutronSecurityGroup> nsgs = Arrays.asList(secGroups); np.setSecurityGroups(nsgs); iNeutronPortCRUD.addPort(np); return np; }
for (ExternalFixedIps mdFixedIP : router.getExternalGatewayInfo().getExternalFixedIps()) { Neutron_IPs fixedIP = new Neutron_IPs(); fixedIP.setSubnetUUID(String.valueOf(mdFixedIP.getSubnetId().getValue())); fixedIP.setIpAddress(String.valueOf(mdFixedIP.getIpAddress().getValue())); fixedIPs.add(fixedIP);
for (ExternalFixedIps mdFixedIP : router.getExternalGatewayInfo().getExternalFixedIps()) { Neutron_IPs fixedIP = new Neutron_IPs(); fixedIP.setSubnetUUID(String.valueOf(mdFixedIP.getSubnetId().getValue())); fixedIP.setIpAddress(String.valueOf(mdFixedIP.getIpAddress().getValue())); fixedIPs.add(fixedIP);
Neutron_IPs ip = new Neutron_IPs(); ip.setIpAddress(String.valueOf(mdIP.getIpAddress().getValue())); ip.setSubnetUUID(mdIP.getSubnetId().getValue()); ips.add(ip);
Neutron_IPs ip = new Neutron_IPs(); ip.setIpAddress(String.valueOf(mdIP.getIpAddress().getValue())); ip.setSubnetUUID(mdIP.getSubnetId().getValue()); ips.add(ip);