mirror of https://github.com/apache/cloudstack.git
GlobalLoadBalancerResponse should contain the service type details and
GSLB rule is defaulted to have source IP as sticky method
This commit is contained in:
parent
4e5a8a0f8a
commit
85b1519fe5
|
|
@ -93,6 +93,9 @@ public class CreateGlobalLoadBalancerRuleCmd extends BaseAsyncCreateCmd {
|
|||
}
|
||||
|
||||
public String getStickyMethod() {
|
||||
if (stickyMethod == null) {
|
||||
return "sourceip";
|
||||
}
|
||||
return stickyMethod;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue