diff --git a/api/src/com/cloud/api/response/NetworkResponse.java b/api/src/com/cloud/api/response/NetworkResponse.java index 0917cfafdef..b443e476e84 100644 --- a/api/src/com/cloud/api/response/NetworkResponse.java +++ b/api/src/com/cloud/api/response/NetworkResponse.java @@ -139,6 +139,12 @@ public class NetworkResponse extends BaseResponse implements ControlledEntityRes @SerializedName(ApiConstants.TAGS) @Param(description="the list of resource tags associated with network", responseObject = ResourceTagResponse.class) private List tags; + + @SerializedName(ApiConstants.IP6_GATEWAY) @Param(description="the gateway of IPv6 network") + private String ip6Gateway; + + @SerializedName(ApiConstants.IP6_CIDR) @Param(description="the cidr of IPv6 network") + private String ip6Cidr; public void setId(Long id) { this.id.setValue(id); @@ -293,4 +299,12 @@ public class NetworkResponse extends BaseResponse implements ControlledEntityRes public void setTags(List tags) { this.tags = tags; } + + public void setIp6Gateway(String ip6Gateway) { + this.ip6Gateway = ip6Gateway; + } + + public void setIp6Cidr(String ip6Cidr) { + this.ip6Cidr = ip6Cidr; + } } diff --git a/api/src/com/cloud/api/response/NicResponse.java b/api/src/com/cloud/api/response/NicResponse.java index 69d5c31f66c..ee79b96b85f 100755 --- a/api/src/com/cloud/api/response/NicResponse.java +++ b/api/src/com/cloud/api/response/NicResponse.java @@ -59,6 +59,15 @@ public class NicResponse extends BaseResponse { @SerializedName("macaddress") @Param(description="true if nic is default, false otherwise") private String macAddress; + + @SerializedName(ApiConstants.IP6_GATEWAY) @Param(description="the gateway of IPv6 network") + private String ip6Gateway; + + @SerializedName(ApiConstants.IP6_CIDR) @Param(description="the cidr of IPv6 network") + private String ip6Cidr; + + @SerializedName(ApiConstants.IP6_ADDRESS) @Param(description="the IPv6 address of network") + private String ip6Address; public Long getId() { return id.getValue(); @@ -110,6 +119,18 @@ public class NicResponse extends BaseResponse { public void setMacAddress(String macAddress) { this.macAddress = macAddress; + } + + public void setIp6Gateway(String ip6Gateway) { + this.ip6Gateway = ip6Gateway; + } + + public void setIp6Cidr(String ip6Cidr) { + this.ip6Cidr = ip6Cidr; + } + + public void setIp6Address(String ip6Address) { + this.ip6Address = ip6Address; } @Override @@ -136,5 +157,4 @@ public class NicResponse extends BaseResponse { return false; return true; } - } diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java index 91755c0fd80..9dd9e29b966 100755 --- a/server/src/com/cloud/api/ApiResponseHelper.java +++ b/server/src/com/cloud/api/ApiResponseHelper.java @@ -3079,6 +3079,9 @@ public class ApiResponseHelper implements ResponseGenerator { if (network.getCidr() != null) { response.setNetmask(NetUtils.cidr2Netmask(network.getCidr())); } + + response.setIp6Gateway(network.getIp6Gateway()); + response.setIp6Cidr(network.getIp6Cidr()); //return vlan information only to Root admin if (network.getBroadcastUri() != null && UserContext.current().getCaller().getType() == Account.ACCOUNT_TYPE_ADMIN) {