cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kis...@apache.org
Subject [26/48] git commit: refs/heads/regions - IPv6: Fix VlanIpRangeResponse
Date Fri, 01 Feb 2013 06:11:34 GMT
IPv6: Fix VlanIpRangeResponse


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

Branch: refs/heads/regions
Commit: f57cbaacd690e8d8ba5bb2c5d6b5be68e9c7478b
Parents: f45576b
Author: Sheng Yang <sheng.yang@citrix.com>
Authored: Wed Jan 30 20:01:04 2013 -0800
Committer: Sheng Yang <sheng.yang@citrix.com>
Committed: Wed Jan 30 20:01:04 2013 -0800

----------------------------------------------------------------------
 .../api/response/VlanIpRangeResponse.java          |   33 +++++++++++++++
 server/src/com/cloud/api/ApiResponseHelper.java    |   18 +++++++-
 2 files changed, 48 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/f57cbaac/api/src/org/apache/cloudstack/api/response/VlanIpRangeResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/VlanIpRangeResponse.java b/api/src/org/apache/cloudstack/api/response/VlanIpRangeResponse.java
index bfde739..e3cac68 100644
--- a/api/src/org/apache/cloudstack/api/response/VlanIpRangeResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/VlanIpRangeResponse.java
@@ -80,6 +80,19 @@ public class VlanIpRangeResponse extends BaseResponse implements ControlledEntit
     @SerializedName(ApiConstants.PHYSICAL_NETWORK_ID) @Param(description="the physical network
this belongs to")
     private String physicalNetworkId;
 
+    @SerializedName(ApiConstants.START_IPV6) @Param(description="the start ipv6 of the VLAN
IP range")
+    private String startIpv6;
+
+    @SerializedName(ApiConstants.END_IPV6) @Param(description="the end ipv6 of the VLAN IP
range")
+    private String endIpv6;
+    
+    @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;
     }
@@ -157,4 +170,24 @@ public class VlanIpRangeResponse extends BaseResponse implements ControlledEntit
     public String getphysicalNetworkId() {
         return physicalNetworkId;
     }
+
+	public String getStartIpv6() {
+		return startIpv6;
+	}
+
+	public void setStartIpv6(String startIpv6) {
+		this.startIpv6 = startIpv6;
+	}
+
+	public void setEndIpv6(String endIpv6) {
+		this.endIpv6 = endIpv6;
+	}
+
+	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/f57cbaac/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 b6a9a37..0c562e9 100755
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@ -481,9 +481,21 @@ public class ApiResponseHelper implements ResponseGenerator {
 
         // get start ip and end ip of corresponding vlan
         String ipRange = vlan.getIpRange();
-        String[] range = ipRange.split("-");
-        vlanResponse.setStartIp(range[0]);
-        vlanResponse.setEndIp(range[1]);
+        if (ipRange != null) {
+        	String[] range = ipRange.split("-");
+        	vlanResponse.setStartIp(range[0]);
+        	vlanResponse.setEndIp(range[1]);
+        }
+
+        vlanResponse.setIp6Gateway(vlan.getIp6Gateway());
+        vlanResponse.setIp6Cidr(vlan.getIp6Cidr());
+        
+        String ip6Range = vlan.getIp6Range();
+        if (ip6Range != null) {
+        	String[] range = ip6Range.split("-");
+        	vlanResponse.setStartIpv6(range[0]);
+        	vlanResponse.setEndIpv6(range[1]);
+        }
 
         if (vlan.getNetworkId() != null) {
             Network nw = ApiDBUtils.findNetworkById(vlan.getNetworkId());


Mime
View raw message