You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ki...@apache.org on 2013/02/01 07:11:34 UTC

[16/48] git commit: refs/heads/regions - IPv6: Update NetworkResponse and NicResponse

IPv6: Update NetworkResponse and NicResponse


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/b1972f6c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/b1972f6c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/b1972f6c

Branch: refs/heads/regions
Commit: b1972f6c113b64a137d3080a2fa98f239114e5ba
Parents: 85d0546
Author: Sheng Yang <sh...@citrix.com>
Authored: Tue Jan 29 19:54:06 2013 -0800
Committer: Sheng Yang <sh...@citrix.com>
Committed: Tue Jan 29 22:01:31 2013 -0800

----------------------------------------------------------------------
 .../cloudstack/api/response/NetworkResponse.java   |   14 +++++++++
 .../cloudstack/api/response/NicResponse.java       |   22 ++++++++++++++-
 server/src/com/cloud/api/ApiResponseHelper.java    |    3 ++
 3 files changed, 38 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/b1972f6c/api/src/org/apache/cloudstack/api/response/NetworkResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/NetworkResponse.java b/api/src/org/apache/cloudstack/api/response/NetworkResponse.java
index 64cc953..ba8ea32 100644
--- a/api/src/org/apache/cloudstack/api/response/NetworkResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/NetworkResponse.java
@@ -144,6 +144,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<ResourceTagResponse> 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(String id) {
         this.id = id;
     }
@@ -298,4 +304,12 @@ public class NetworkResponse extends BaseResponse implements ControlledEntityRes
     public void setTags(List<ResourceTagResponse> tags) {
         this.tags = tags;
     }
+
+	public void setIp6Gateway(String ip6Gateway) {
+		this.ip6Gateway = ip6Gateway;
+	}
+
+	public void setIp6Cidr(String ip6Cidr) {
+		this.ip6Cidr = ip6Cidr;
+	}
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/b1972f6c/api/src/org/apache/cloudstack/api/response/NicResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/NicResponse.java b/api/src/org/apache/cloudstack/api/response/NicResponse.java
index a6ca5b8..467addc 100644
--- a/api/src/org/apache/cloudstack/api/response/NicResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/NicResponse.java
@@ -60,6 +60,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 String getId() {
         return id;
     }
@@ -112,6 +121,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
     public int hashCode() {
@@ -139,5 +160,4 @@ public class NicResponse extends BaseResponse {
             return false;
         return true;
     }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/b1972f6c/server/src/com/cloud/api/ApiResponseHelper.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java
index 1c8849a..b6a9a37 100755
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@ -2151,6 +2151,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) {