use of com.cloudera.api.swagger.model.ApiClusterTemplateVariable in project cloudbreak by hortonworks.
the class HueConfigProvider method getServiceConfigVariables.
@Override
public List<ApiClusterTemplateVariable> getServiceConfigVariables(TemplatePreparationObject source) {
List<ApiClusterTemplateVariable> result = new ArrayList<>();
RdsView hueRdsView = getRdsView(source);
result.add(new ApiClusterTemplateVariable().name(HUE_DATABASE_HOST).value(hueRdsView.getHost()));
result.add(new ApiClusterTemplateVariable().name(HUE_DATABASE_PORT).value(hueRdsView.getPort()));
result.add(new ApiClusterTemplateVariable().name(HUE_DATABASE_NAME).value(hueRdsView.getDatabaseName()));
result.add(new ApiClusterTemplateVariable().name(HUE_HUE_DATABASE_TYPE).value(hueRdsView.getSubprotocol()));
result.add(new ApiClusterTemplateVariable().name(HUE_HUE_DATABASE_USER).value(hueRdsView.getConnectionUserName()));
result.add(new ApiClusterTemplateVariable().name(HUE_DATABASE_PASSWORD).value(hueRdsView.getConnectionPassword()));
configureKnoxProxyHostsConfigVariables(source, result);
return result;
}
use of com.cloudera.api.swagger.model.ApiClusterTemplateVariable in project cloudbreak by hortonworks.
the class HueConfigProvider method configureKnoxProxyHostsConfigVariables.
private void configureKnoxProxyHostsConfigVariables(TemplatePreparationObject source, List<ApiClusterTemplateVariable> result) {
GatewayView gateway = source.getGatewayView();
String cdhVersion = getCdhVersionString(source);
GeneralClusterConfigs generalClusterConfigs = source.getGeneralClusterConfigs();
if (externalFQDNShouldConfigured(gateway, generalClusterConfigs)) {
Set<String> proxyHosts = new HashSet<>();
if (generalClusterConfigs.getPrimaryGatewayInstanceDiscoveryFQDN().isPresent()) {
proxyHosts.add(generalClusterConfigs.getPrimaryGatewayInstanceDiscoveryFQDN().get());
}
if (StringUtils.isNotEmpty(generalClusterConfigs.getExternalFQDN())) {
proxyHosts.add(generalClusterConfigs.getExternalFQDN());
}
if (generalClusterConfigs.getLoadBalancerGatewayFqdn().isPresent()) {
proxyHosts.add(generalClusterConfigs.getLoadBalancerGatewayFqdn().get());
}
if (!proxyHosts.isEmpty()) {
String proxyHostsString = String.join(",", proxyHosts);
if (isVersionNewerOrEqualThanLimited(cdhVersion, CLOUDERAMANAGER_VERSION_7_1_0)) {
LOGGER.debug("Using {} settings of [{}]", HUE_KNOX_PROXYHOSTS, proxyHostsString);
result.add(new ApiClusterTemplateVariable().name(HUE_KNOX_PROXYHOSTS).value(proxyHostsString));
} else {
LOGGER.debug("Adding knox proxy hosts [{}] to {}", proxyHostsString, HUE_SAFETY_VALVE);
String valveValue = SAFETY_VALVE_KNOX_PROXYHOSTS_KEY_PATTERN.concat(proxyHostsString);
result.add(new ApiClusterTemplateVariable().name(HUE_SAFETY_VALVE).value(valveValue));
}
}
}
}
Aggregations