diff --git a/.travis.yml b/.travis.yml index c5c1d1991..8d7351e29 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,3 +36,4 @@ after_success: # infrastructure. This should prevent the buffer overflow from # https://github.com/travis-ci/travis-ci/issues/5227 sudo: false +dist: trusty \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSubnet.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSubnet.java index 823a42fb5..d3d577f8b 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSubnet.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronSubnet.java @@ -57,13 +57,15 @@ public class NeutronSubnet implements Subnet { private Ipv6AddressMode ipv6AddressMode; @JsonProperty("ipv6_ra_mode") private Ipv6RaMode ipv6RaMode; + @JsonProperty("subnetpool_id") + private String subnetPoolId; public NeutronSubnet() { } public NeutronSubnet(String id, String name, boolean enableDHCP, String networkId, String tenantId, List dnsNames, List pools, List hostRoutes, IPVersionType ipVersion, - String gateway, String cidr, Ipv6AddressMode ipv6AddressMode, Ipv6RaMode ipv6RaMode) { + String gateway, String cidr, Ipv6AddressMode ipv6AddressMode, Ipv6RaMode ipv6RaMode, String subnetPoolId) { this.id = id; this.name = name; this.enableDHCP = enableDHCP; @@ -77,6 +79,7 @@ public NeutronSubnet(String id, String name, boolean enableDHCP, String networkI this.cidr = cidr; this.ipv6AddressMode = ipv6AddressMode; this.ipv6RaMode = ipv6RaMode; + this.subnetPoolId = subnetPoolId; } public static SubnetBuilder builder() { @@ -218,6 +221,13 @@ public Ipv6RaMode getIpv6RaMode() { return ipv6RaMode; } + /** + * {@inheritDoc} + */ + public String getSubnetPoolId() { + return subnetPoolId; + } + /** * {@inheritDoc} */ @@ -227,7 +237,7 @@ public String toString() { .add("id", id).add("name", name).add("enableDHCP", enableDHCP).add("network-id", networkId) .add("tenant_id", tenantId).add("dns_nameservers", dnsNames).add("allocation_pools", pools) .add("host_routes", hostRoutes).add("ip_version", ipVersion).add("gateway_ip", gateway).add("cidr", cidr) - .add("ipv6AddressMode", ipv6AddressMode).add("ipv6RaMode", ipv6RaMode) + .add("ipv6AddressMode", ipv6AddressMode).add("ipv6RaMode", ipv6RaMode).add("subnetpool_id", subnetPoolId) .toString(); } @@ -238,7 +248,7 @@ public String toString() { public int hashCode() { return java.util.Objects.hash(id, name, enableDHCP, networkId, tenantId, dnsNames, pools, hostRoutes, ipVersion, gateway, - cidr, ipv6AddressMode, ipv6RaMode); + cidr, ipv6AddressMode, ipv6RaMode, subnetPoolId); } /** @@ -264,7 +274,8 @@ public boolean equals(Object obj) { java.util.Objects.equals(gateway, that.gateway) && java.util.Objects.equals(cidr, that.cidr) && java.util.Objects.equals(ipv6AddressMode, that.ipv6AddressMode) && - java.util.Objects.equals(ipv6RaMode, that.ipv6RaMode)) { + java.util.Objects.equals(ipv6RaMode, that.ipv6RaMode) && + java.util.Objects.equals(subnetPoolId, that.subnetPoolId)) { return true; } } @@ -281,8 +292,8 @@ public static class NeutronSubnetNoGateway extends NeutronSubnet { public NeutronSubnetNoGateway(String id, String name, boolean enableDHCP, String networkId, String tenantId, List dnsNames, List pools, List hostRoutes, - IPVersionType ipVersion, String cidr, Ipv6AddressMode ipv6AddressMode, Ipv6RaMode ipv6RaMode) { - super(id, name, enableDHCP, networkId, tenantId, dnsNames, pools, hostRoutes, ipVersion, null, cidr, ipv6AddressMode, ipv6RaMode); + IPVersionType ipVersion, String cidr, Ipv6AddressMode ipv6AddressMode, Ipv6RaMode ipv6RaMode, String subnetpoolId) { + super(id, name, enableDHCP, networkId, tenantId, dnsNames, pools, hostRoutes, ipVersion, null, cidr, ipv6AddressMode, ipv6RaMode, subnetpoolId); this.gateway = null; } } @@ -379,7 +390,7 @@ public SubnetBuilder ipv6RaMode(Ipv6RaMode ipv6RaMode) { public Subnet build() { if(isNoGateway) { return new NeutronSubnetNoGateway(m.id, m.name, m.enableDHCP, m.networkId, - m.tenantId, m.dnsNames, m.pools, m.hostRoutes, m.ipVersion, m.cidr, m.ipv6AddressMode, m.ipv6RaMode); + m.tenantId, m.dnsNames, m.pools, m.hostRoutes, m.ipVersion, m.cidr, m.ipv6AddressMode, m.ipv6RaMode, m.subnetPoolId); } return m; }