Skip to content

Commit 238d19e

Browse files
author
synapticloop
committed
fixed public_ip address
1 parent 382ba0d commit 238d19e

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/main/java/synapticloop/scaleway/api/model/IP.java

-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
*/
1818

1919
import com.fasterxml.jackson.annotation.JsonProperty;
20-
import com.fasterxml.jackson.annotation.JsonSetter;
2120

2221
public class IP {
2322
@JsonProperty("id") private String id;
@@ -29,9 +28,6 @@ public class IP {
2928

3029
public String getId() { return id; }
3130

32-
@JsonSetter("public_ip")
33-
private void setPublicIP(String publicIp) { this.ipAddress = publicIp; }
34-
3531
public String getIpAddress() { return ipAddress; }
3632

3733
public String getOrganizationId() { return this.organizationId; }

src/main/java/synapticloop/scaleway/api/model/Server.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
public class Server extends ServerBase {
2525

2626
@JsonProperty("id") private String id;
27+
@JsonProperty("public_ip") private IP publicIp;
2728
@JsonProperty("private_ip") private String privateIp;
2829
@JsonProperty("extra_networks") private String[] extraNetworks;
2930
@JsonProperty("state") private State state;
@@ -108,7 +109,7 @@ public void setLocation(Location location) {
108109
this.location = location;
109110
}
110111

111-
public IPv6 getIpv6() { return ipv6; }
112+
public IPv6 getIPv6() { return ipv6; }
112113

113114
public String getArch() {
114115
return arch;

src/main/java/synapticloop/scaleway/api/model/ServerBase.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class ServerBase {
3030
@JsonProperty("commercial_type") private ServerType serverType;
3131
@JsonProperty("dynamic_ip_required") private boolean dynamicIpRequired;
3232
@JsonProperty("enable_ipv6") private boolean ipv6Enabled;
33-
@JsonProperty("public_ip") private String publicIP;
33+
@JsonProperty("public_ip") private IP publicIP;
3434
@JsonProperty("security_group") private SecurityGroup securityGroup;
3535
@JsonProperty("bootscript") private BootScript bootscript;
3636

@@ -91,11 +91,11 @@ public void setIpv6Enabled(boolean ipv6Enabled) {
9191
this.ipv6Enabled = ipv6Enabled;
9292
}
9393

94-
public String getPublicIP() {
94+
public IP getPublicIP() {
9595
return publicIP;
9696
}
9797

98-
public void setPublicIP(String publicIP) {
98+
public void setPublicIP(IP publicIP) {
9999
this.publicIP = publicIP;
100100
}
101101

src/test/java/synapticloop/scaleway/api/ServerTest.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public void testCreateAndDeleteServer() throws ScalewayApiException {
3333
assertEquals(server.getCreationDate(), returnedServer.getCreationDate());
3434
assertEquals(server.getHostname(), returnedServer.getHostname());
3535
assertEquals(server.getId(), returnedServer.getId());
36-
assertEquals(server.getIpv6(), returnedServer.getIpv6());
36+
assertEquals(server.getIPv6(), returnedServer.getIPv6());
3737
assertEquals(server.getModificationDate(), returnedServer.getModificationDate());
3838
assertEquals(server.getName(), returnedServer.getName());
3939
assertEquals(server.getOrganization(), returnedServer.getOrganization());
@@ -113,7 +113,10 @@ public void testPowerCycleServer() throws ScalewayApiException {
113113
boolean isStarted = false;
114114
while(!isStarted) {
115115
ServerTask taskStatus = scalewayApiClient.getTaskStatus(powerOnServerTask.getId());
116-
LOGGER.debug("Server task with id '{}' is in current state '{}' (progress '{}')", taskStatus.getId(), taskStatus.getStatus(), taskStatus.getProgress());
116+
LOGGER.debug("Server task with id '{}' is in current state '{}' (progress '{}')",
117+
taskStatus.getId(),
118+
taskStatus.getStatus(),
119+
taskStatus.getProgress());
117120
try {
118121
Thread.sleep(10000);
119122
} catch (InterruptedException ex) {

0 commit comments

Comments
 (0)