Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public class CreateLoadBalancerRuleCmd extends BaseAsyncCreateCmd /*implements L
+ "rule will be created for. Required when public Ip address is not associated with any Guest network yet (VPC case)")
private Long networkId;

@Parameter(name = ApiConstants.PROTOCOL, type = CommandType.STRING, description = "The protocol for the LB such as tcp, udp or tcp-proxy.")
@Parameter(name = ApiConstants.PROTOCOL, type = CommandType.STRING, description = "The protocol for the LB such as tcp or tcp-proxy.")
private String lbProtocol;
Comment thread
davidjumani marked this conversation as resolved.

@Parameter(name = ApiConstants.FOR_DISPLAY, type = CommandType.BOOLEAN, description = "an optional field, whether to the display the rule to the end user or not", since = "4.4", authorized = {RoleType.Admin})
Expand Down Expand Up @@ -255,6 +255,12 @@ public List<String> getSourceCidrList() {
}

public String getLbProtocol() {
if (lbProtocol != null) {
lbProtocol = lbProtocol.toLowerCase();
if (!lbProtocol.equals(NetUtils.TCP_PROTO) && !lbProtocol.equals(NetUtils.TCP_PROXY_PROTO)) {
throw new InvalidParameterValueException("Invalid protocool. Supported protocols are tcp and tcp-proxy");
Comment thread
davidjumani marked this conversation as resolved.
Outdated
}
}
return lbProtocol;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ private List<String> getRulesForPool(final LoadBalancerTO lbTO, final boolean ke
.append(":")
.append(dest.getDestPort())
.append(" check");
if(lbTO.getLbProtocol() != null && lbTO.getLbProtocol().equals("tcp-proxy")) {
if(lbTO.getLbProtocol() != null && lbTO.getLbProtocol().equals(NetUtils.TCP_PROXY_PROTO)) {
sb.append(" send-proxy");
}
dstSubRule.add(sb.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ private static Map<Service, Map<Capability, String>> setCapabilities() {
final Map<Capability, String> lbCapabilities = new HashMap<Capability, String>();
lbCapabilities.put(Capability.SupportedLBAlgorithms, "roundrobin,leastconn,source");
lbCapabilities.put(Capability.SupportedLBIsolation, "dedicated");
lbCapabilities.put(Capability.SupportedProtocols, "tcp, udp, tcp-proxy");
lbCapabilities.put(Capability.SupportedProtocols, "tcp, tcp-proxy");
lbCapabilities.put(Capability.SupportedStickinessMethods, getHAProxyStickinessCapability());
lbCapabilities.put(Capability.LbSchemes, LoadBalancerContainer.Scheme.Public.toString());

Expand Down
4 changes: 0 additions & 4 deletions ui/scripts/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -3445,10 +3445,6 @@
id: 'tcp',
name: 'tcp',
description: _l('label.lb.protocol.tcp')
}, {
id: 'udp',
name: 'udp',
description: _l('label.lb.protocol.udp')
}, {
id: 'tcp-proxy',
name: 'tcp-proxy',
Expand Down
1 change: 1 addition & 0 deletions utils/src/main/java/com/cloud/utils/net/NetUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public class NetUtils {

public final static String UDP_PROTO = "udp";
public final static String TCP_PROTO = "tcp";
public final static String TCP_PROXY_PROTO = "tcp-proxy";
public final static String ANY_PROTO = "any";
public final static String ICMP_PROTO = "icmp";
public final static String ALL_PROTO = "all";
Expand Down