use of org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.port.attributes.FixedIpsBuilder in project netvirt by opendaylight.
the class NeutronPortChangeListenerTest method addPort__Ipv4FixedIps.
@Test
public void addPort__Ipv4FixedIps() throws Exception {
PortBuilder pb = new PortBuilder();
pb.setUuid(new Uuid("12345678-1234-1234-1234-123456789012"));
pb.setNetworkId(new Uuid("12345678-1234-1234-1234-123456789012"));
pb.setMacAddress(new MacAddress("AA:BB:CC:DD:EE:FF"));
IpAddress ipv4 = new IpAddress(new Ipv4Address("2.2.2.2"));
FixedIpsBuilder fib = new FixedIpsBuilder();
fib.setIpAddress(ipv4);
List<FixedIps> fixedIps = new ArrayList<>();
fixedIps.add(fib.build());
pb.setFixedIps(fixedIps);
Port port = pb.build();
neutronPortChangeListener.add(InstanceIdentifier.create(Port.class), port);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.port.attributes.FixedIpsBuilder in project netvirt by opendaylight.
the class NeutronPortChangeListenerTest method addPort__Ipv6FixedIps.
@Test
public void addPort__Ipv6FixedIps() throws Exception {
PortBuilder pb = new PortBuilder();
pb.setUuid(new Uuid("12345678-1234-1234-1234-123456789012"));
pb.setNetworkId(new Uuid("12345678-1234-1234-1234-123456789012"));
pb.setMacAddress(new MacAddress("AA:BB:CC:DD:EE:FF"));
IpAddress ipv6 = new IpAddress(new Ipv6Address("1::1"));
FixedIpsBuilder fib = new FixedIpsBuilder();
fib.setIpAddress(ipv6);
List<FixedIps> fixedIps = new ArrayList<>();
fixedIps.add(fib.build());
pb.setFixedIps(fixedIps);
Port port = pb.build();
neutronPortChangeListener.add(InstanceIdentifier.create(Port.class), port);
}
Aggregations