Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added subnetPoolId in the NeutronSubnet.java #1303

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> dnsNames,
List<NeutronPool> pools, List<NeutronHostRoute> 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;
Expand All @@ -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() {
Expand Down Expand Up @@ -218,6 +221,13 @@ public Ipv6RaMode getIpv6RaMode() {
return ipv6RaMode;
}

/**
* {@inheritDoc}
*/
public String getSubnetPoolId() {
return subnetPoolId;
}

/**
* {@inheritDoc}
*/
Expand All @@ -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();
}

Expand All @@ -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);
}

/**
Expand All @@ -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;
}
}
Expand All @@ -281,8 +292,8 @@ public static class NeutronSubnetNoGateway extends NeutronSubnet {

public NeutronSubnetNoGateway(String id, String name, boolean enableDHCP, String networkId, String tenantId,
List<String> dnsNames, List<NeutronPool> pools, List<NeutronHostRoute> 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;
}
}
Expand Down Expand Up @@ -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;
}
Expand Down