Skip to content

Commit 481af07

Browse files
Syed Ahmedmurali-reddy
authored andcommitted
Adding protocol parameter to loadbalancer response
1 parent 67b071b commit 481af07

5 files changed

Lines changed: 23 additions & 0 deletions

File tree

api/src/com/cloud/network/rules/LoadBalancer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ public interface LoadBalancer extends FirewallRule, LoadBalancerContainer {
2525

2626
int getDefaultPortEnd();
2727

28+
2829
}

api/src/com/cloud/network/rules/LoadBalancerContainer.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ public enum Scheme {
2727
String getDescription();
2828

2929
String getAlgorithm();
30+
31+
String getLbProtocol();
3032

3133
Scheme getScheme();
3234

api/src/org/apache/cloudstack/api/response/LoadBalancerResponse.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ public class LoadBalancerResponse extends BaseResponse implements ControlledEnti
9191
@Param(description = "the id of the zone the rule belongs to")
9292
private String zoneId;
9393

94+
@SerializedName(ApiConstants.PROTOCOL)
95+
@Param(description = "the protocol of the loadbalanacer rule")
96+
private String lbProtocol;
97+
98+
9499
@SerializedName(ApiConstants.TAGS) @Param(description="the list of resource tags associated with load balancer", responseObject = ResourceTagResponse.class)
95100
private List<ResourceTagResponse> tags;
96101

@@ -170,4 +175,7 @@ public void setNetworkId(String networkId) {
170175
this.networkId = networkId;
171176
}
172177

178+
public void setLbProtocol(String lbProtocol) {
179+
this.lbProtocol = lbProtocol;
180+
}
173181
}

engine/schema/src/org/apache/cloudstack/lb/ApplicationLoadBalancerRuleVO.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ public class ApplicationLoadBalancerRuleVO extends FirewallRuleVO implements App
5858

5959
@Column(name="source_ip_address_network_id")
6060
Long sourceIpNetworkId;
61+
62+
@Column(name="lb_protocol")
63+
String lbProtocol;
64+
6165

6266
@Column(name="source_ip_address")
6367
@Enumerated(value=EnumType.STRING)
@@ -111,6 +115,11 @@ public String getAlgorithm() {
111115
return algorithm;
112116
}
113117

118+
@Override
119+
public String getLbProtocol() {
120+
return lbProtocol;
121+
}
122+
114123
@Override
115124
public int getDefaultPortStart() {
116125
return defaultPortStart;
@@ -130,4 +139,6 @@ public Scheme getScheme() {
130139
public int getInstancePort() {
131140
return defaultPortStart;
132141
}
142+
143+
133144
}

server/src/com/cloud/api/ApiResponseHelper.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,7 @@ public LoadBalancerResponse createLoadBalancerResponse(LoadBalancer loadBalancer
748748
lbResponse.setPublicPort(Integer.toString(loadBalancer.getSourcePortStart()));
749749
lbResponse.setPrivatePort(Integer.toString(loadBalancer.getDefaultPortStart()));
750750
lbResponse.setAlgorithm(loadBalancer.getAlgorithm());
751+
lbResponse.setLbProtocol(loadBalancer.getLbProtocol());
751752
FirewallRule.State state = loadBalancer.getState();
752753
String stateToSet = state.toString();
753754
if (state.equals(FirewallRule.State.Revoke)) {

0 commit comments

Comments
 (0)