IPv6: Update NetworkResponse and NicResponse

Conflicts:

        api/src/com/cloud/api/response/NetworkResponse.java
        api/src/com/cloud/api/response/NicResponse.java


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

Branch: refs/heads/network-refactor
Commit: f7047eba73b13e6128a1e7250f8b2f758294df99
Parents: 4f76eee
Author: Sheng Yang <[email protected]>
Authored: Tue Jan 29 19:54:06 2013 -0800
Committer: Sheng Yang <[email protected]>
Committed: Thu Jan 31 15:39:18 2013 -0800

----------------------------------------------------------------------
 .../com/cloud/api/response/NetworkResponse.java    |   14 +++++++++
 api/src/com/cloud/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/f7047eba/api/src/com/cloud/api/response/NetworkResponse.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/response/NetworkResponse.java 
b/api/src/com/cloud/api/response/NetworkResponse.java
index 0917cfa..b443e47 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<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(Long id) {
         this.id.setValue(id);
@@ -293,4 +299,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/f7047eba/api/src/com/cloud/api/response/NicResponse.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/response/NicResponse.java 
b/api/src/com/cloud/api/response/NicResponse.java
index 69d5c31..ee79b96 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;
     }
-    
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/f7047eba/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 91755c0..9dd9e29 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) {

Reply via email to