Skip to content

Commit 7b5ef5b

Browse files
committed
Issue #277, Issue #282
1 parent 0946d56 commit 7b5ef5b

File tree

4 files changed

+25
-3
lines changed

4 files changed

+25
-3
lines changed

core/src/main/java/org/openstack4j/model/network/builder/RouterBuilder.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ public interface RouterBuilder extends Builder<RouterBuilder, Router> {
5252
*/
5353
RouterBuilder externalGateway(ExternalGateway externalGateway);
5454

55+
/**
56+
* Removes the external gateway from the router during an update operation
57+
*/
58+
RouterBuilder clearExternalGateway();
5559
/**
5660
* @see Router#getRoutes()
5761
*/

core/src/main/java/org/openstack4j/openstack/compute/domain/NovaQuotaSetUpdate.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,23 @@ public class NovaQuotaSetUpdate implements QuotaSetUpdate {
1818

1919
@JsonProperty("injected_files")
2020
private Integer injectedFiles;
21-
21+
22+
@JsonProperty
2223
private Integer gigabytes;
24+
25+
@JsonProperty
2326
private Integer ram;
2427

2528
@JsonProperty("floating_ips")
2629
private Integer floatingIps;
2730

31+
@JsonProperty
2832
private Integer instances;
2933

34+
@JsonProperty
3035
private Integer volumes;
3136

37+
@JsonProperty
3238
private Integer cores;
3339

3440
@JsonProperty("security_groups")

core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronExternalGateway.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import org.openstack4j.model.network.ExternalGateway;
44

5+
import com.fasterxml.jackson.annotation.JsonIgnore;
56
import com.fasterxml.jackson.annotation.JsonProperty;
67
import com.google.common.base.Objects;
78

@@ -21,7 +22,7 @@ public class NeutronExternalGateway implements ExternalGateway {
2122
private String networkId;
2223

2324
@JsonProperty("enable_snat")
24-
private boolean enableSnat = true;
25+
private Boolean enableSnat;
2526

2627
public NeutronExternalGateway() { }
2728

@@ -45,9 +46,10 @@ public String getNetworkId() {
4546
/**
4647
* {@inheritDoc}
4748
*/
49+
@JsonIgnore
4850
@Override
4951
public boolean isEnableSnat() {
50-
return enableSnat;
52+
return enableSnat != null && enableSnat;
5153
}
5254

5355
/**

core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronRouter.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,16 @@ public RouterBuilder externalGateway(ExternalGateway externalGateway) {
207207
m.externalGatewayInfo = (NeutronExternalGateway) externalGateway;
208208
return this;
209209
}
210+
211+
/**
212+
* {@inheritDoc}
213+
*/
214+
@Override
215+
public RouterBuilder clearExternalGateway() {
216+
m.externalGatewayInfo = new NeutronExternalGateway();
217+
return this;
218+
}
219+
210220

211221
/**
212222
* {@inheritDoc}

0 commit comments

Comments
 (0)