mirror of https://github.com/apache/jclouds.git
Add access IPs in Server
This commit is contained in:
parent
02353b93d5
commit
5c0ca0b7c1
|
@ -39,6 +39,8 @@ public class Server extends Resource {
|
||||||
private Map<String, String> metadata = Maps.newHashMap();
|
private Map<String, String> metadata = Maps.newHashMap();
|
||||||
|
|
||||||
private Addresses addresses;
|
private Addresses addresses;
|
||||||
|
private String accessIPv4;
|
||||||
|
private String accessIPv6;
|
||||||
private String adminPass;
|
private String adminPass;
|
||||||
private String flavorRef;
|
private String flavorRef;
|
||||||
private String hostId;
|
private String hostId;
|
||||||
|
@ -221,6 +223,36 @@ public class Server extends Resource {
|
||||||
this.securityGroups = securityGroups;
|
this.securityGroups = securityGroups;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the accessIPv4
|
||||||
|
*/
|
||||||
|
public String getAccessIPv4() {
|
||||||
|
return accessIPv4;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param accessIPv4
|
||||||
|
* the accessIPv4 to set
|
||||||
|
*/
|
||||||
|
public void setAccessIPv4(String accessIPv4) {
|
||||||
|
this.accessIPv4 = accessIPv4;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the accessIPv6
|
||||||
|
*/
|
||||||
|
public String getAccessIPv6() {
|
||||||
|
return accessIPv6;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param accessIPv6
|
||||||
|
* the accessIPv6 to set
|
||||||
|
*/
|
||||||
|
public void setAccessIPv6(String accessIPv6) {
|
||||||
|
this.accessIPv6 = accessIPv6;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
|
@ -237,6 +269,8 @@ public class Server extends Resource {
|
||||||
result = prime * result + ((name == null) ? 0 : name.hashCode());
|
result = prime * result + ((name == null) ? 0 : name.hashCode());
|
||||||
result = prime * result + ((flavor == null) ? 0 : flavor.hashCode());
|
result = prime * result + ((flavor == null) ? 0 : flavor.hashCode());
|
||||||
result = prime * result + ((image == null) ? 0 : image.hashCode());
|
result = prime * result + ((image == null) ? 0 : image.hashCode());
|
||||||
|
result = prime * result + ((accessIPv4 == null) ? 0 : accessIPv4.hashCode());
|
||||||
|
result = prime * result + ((accessIPv6 == null) ? 0 : accessIPv6.hashCode());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -311,6 +345,16 @@ public class Server extends Resource {
|
||||||
return false;
|
return false;
|
||||||
} else if (!image.equals(other.image))
|
} else if (!image.equals(other.image))
|
||||||
return false;
|
return false;
|
||||||
|
if (accessIPv4 == null) {
|
||||||
|
if (other.accessIPv4 != null)
|
||||||
|
return false;
|
||||||
|
} else if (!accessIPv4.equals(other.accessIPv4))
|
||||||
|
return false;
|
||||||
|
if (accessIPv6 == null) {
|
||||||
|
if (other.accessIPv6 != null)
|
||||||
|
return false;
|
||||||
|
} else if (!accessIPv6.equals(other.accessIPv6))
|
||||||
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -320,9 +364,12 @@ public class Server extends Resource {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "Server [addresses=" + addresses + ", adminPass=" + adminPass + ", flavorRef="
|
return "Server [addresses=" + addresses + ", accessIPv4=" + accessIPv4
|
||||||
+ flavorRef + ", hostId=" + hostId + ", id=" + id + ", imageRef=" + imageRef
|
+ ", accessIPv6=" + accessIPv6 + ", adminPass=" + adminPass
|
||||||
+ ", metadata=" + metadata + ", uuid=" + uuid + ", name=" + name + ", keyName=" + keyName + " , securityGroups=" + securityGroups + "]";
|
+ ", flavorRef=" + flavorRef + ", hostId=" + hostId + ", id="
|
||||||
|
+ id + ", imageRef=" + imageRef + ", metadata=" + metadata
|
||||||
|
+ ", uuid=" + uuid + ", name=" + name + ", keyName=" + keyName
|
||||||
|
+ " , securityGroups=" + securityGroups + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,6 +83,8 @@ public class ParseServerFromJsonResponseDiabloTest {
|
||||||
assertEquals(response.getAddresses(), addresses1);
|
assertEquals(response.getAddresses(), addresses1);
|
||||||
assertEquals(response.getMetadata(), ImmutableMap.of("Server Label", "Web Head 1", "Image Version", "2.1"));
|
assertEquals(response.getMetadata(), ImmutableMap.of("Server Label", "Web Head 1", "Image Version", "2.1"));
|
||||||
assertEquals(response.getAddresses(), addresses1);
|
assertEquals(response.getAddresses(), addresses1);
|
||||||
|
assertEquals(response.getAccessIPv4(), "67.23.10.132");
|
||||||
|
assertEquals(response.getAccessIPv6(), "::babe:67.23.10.132");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue