You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bf...@apache.org on 2013/04/12 19:38:03 UTC

[17/21] git commit: updated refs/heads/ui-vm-affinity to 6629eb7

GlobalLoadBalancerResponse should contain the service type details and
GSLB rule is defaulted to have source IP as sticky method


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

Branch: refs/heads/ui-vm-affinity
Commit: 85b1519fe5d09e7f0fa51c914ac725c5d928800f
Parents: 4e5a8a0
Author: Murali Reddy <mu...@citrix.com>
Authored: Fri Apr 12 19:16:36 2013 +0530
Committer: Murali Reddy <mu...@citrix.com>
Committed: Fri Apr 12 19:27:46 2013 +0530

----------------------------------------------------------------------
 .../ha/gslb/CreateGlobalLoadBalancerRuleCmd.java   |    3 +++
 .../api/response/GlobalLoadBalancerResponse.java   |    8 ++++++++
 server/src/com/cloud/api/ApiResponseHelper.java    |    2 ++
 3 files changed, 13 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/85b1519f/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/CreateGlobalLoadBalancerRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/CreateGlobalLoadBalancerRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/CreateGlobalLoadBalancerRuleCmd.java
index cd559d8..b08b6ae 100644
--- a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/CreateGlobalLoadBalancerRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/CreateGlobalLoadBalancerRuleCmd.java
@@ -93,6 +93,9 @@ public class CreateGlobalLoadBalancerRuleCmd extends BaseAsyncCreateCmd {
     }
 
     public String getStickyMethod() {
+        if (stickyMethod == null) {
+            return "sourceip";
+        }
         return stickyMethod;
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/85b1519f/api/src/org/apache/cloudstack/api/response/GlobalLoadBalancerResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/GlobalLoadBalancerResponse.java b/api/src/org/apache/cloudstack/api/response/GlobalLoadBalancerResponse.java
index 0fd064f..38e080b 100644
--- a/api/src/org/apache/cloudstack/api/response/GlobalLoadBalancerResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/GlobalLoadBalancerResponse.java
@@ -50,6 +50,10 @@ public class GlobalLoadBalancerResponse extends BaseResponse implements Controll
     @Param(description = "session persistence method used for the global load balancer")
     private String stickyMethod;
 
+    @SerializedName(ApiConstants.GSLB_SERVICE_TYPE)
+    @Param(description = "GSLB service type")
+    private String serviceType;
+
     @SerializedName(ApiConstants.REGION_ID)
     @Param(description = "Region Id in which global load balancer is created")
     private Integer regionId;
@@ -96,6 +100,10 @@ public class GlobalLoadBalancerResponse extends BaseResponse implements Controll
         this.stickyMethod = stickyMethod;
     }
 
+    public void setServiceType(String serviceType) {
+        this.serviceType = serviceType;
+    }
+
     public void setServiceDomainName(String domainName) {
         this.gslbDomainName = domainName;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/85b1519f/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 651a8be..50c137a 100755
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@ -768,11 +768,13 @@ public class ApiResponseHelper implements ResponseGenerator {
         GlobalLoadBalancerResponse response = new GlobalLoadBalancerResponse();
         response.setAlgorithm(globalLoadBalancerRule.getAlgorithm());
         response.setStickyMethod(globalLoadBalancerRule.getPersistence());
+        response.setServiceType(globalLoadBalancerRule.getServiceType());
         response.setServiceDomainName(globalLoadBalancerRule.getGslbDomain());
         response.setName(globalLoadBalancerRule.getName());
         response.setDescription(globalLoadBalancerRule.getDescription());
         response.setRegionIdId(globalLoadBalancerRule.getRegion());
         response.setId(globalLoadBalancerRule.getUuid());
+        response.setObjectName("globalloadbalancer");
         return response;
     }