use of com.sequenceiq.common.api.type.LoadBalancerSku in project cloudbreak by hortonworks.
the class LoadBalancerConfigService method createLoadBalancers.
public Set<LoadBalancer> createLoadBalancers(Stack stack, DetailedEnvironmentResponse environment, StackV4Request source) {
LoadBalancerSku sku = getLoadBalancerSku(source);
boolean azureLoadBalancerDisabled = CloudPlatform.AZURE.toString().equalsIgnoreCase(stack.getCloudPlatform()) && LoadBalancerSku.NONE.equals(sku);
if (azureLoadBalancerDisabled) {
Optional<TargetGroup> oozieTargetGroup = setupOozieHATargetGroup(stack, true);
if (oozieTargetGroup.isPresent()) {
throw new CloudbreakServiceException("Unsupported setup: Load balancers are disabled, but Oozie HA is configured. " + "Either enable Azure load balancers, or use a non-HA Oozie setup.");
}
LOGGER.debug("Azure load balancers have been explicitly disabled.");
return Collections.emptySet();
}
boolean loadBalancerFlagEnabled = source != null && source.isEnableLoadBalancer();
Set<LoadBalancer> loadBalancers = setupLoadBalancers(stack, environment, false, loadBalancerFlagEnabled, sku);
if (stack.getCloudPlatform().equalsIgnoreCase(CloudPlatform.AZURE.toString())) {
configureLoadBalancerAvailabilitySets(stack.getName(), loadBalancers);
configureLoadBalancerSku(source, loadBalancers);
}
return loadBalancers;
}
Aggregations