use of com.cloudera.api.swagger.model.ApiClusterTemplateConfig in project cloudbreak by hortonworks.
the class HbaseCloudStorageServiceConfigProviderTest method testGetHbaseServiceConfigsWhenNoStorageConfiguredWithAttachedCluster.
@Test
public void testGetHbaseServiceConfigsWhenNoStorageConfiguredWithAttachedCluster() {
TemplatePreparationObject preparationObject = getTemplatePreparationObject(false, false);
String inputJson = getBlueprintText("input/clouderamanager.bp");
CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson);
List<ApiClusterTemplateConfig> serviceConfigs = underTest.getServiceConfigs(cmTemplateProcessor, preparationObject);
assertEquals(0, serviceConfigs.size());
}
use of com.cloudera.api.swagger.model.ApiClusterTemplateConfig in project cloudbreak by hortonworks.
the class HbaseCloudStorageServiceConfigProviderTest method testGetHbaseStorageServiceConfigsWhenDataLake721.
@Test
public void testGetHbaseStorageServiceConfigsWhenDataLake721() {
TemplatePreparationObject preparationObject = getTemplatePreparationObject(true, true, "7.2.1");
String inputJson = getBlueprintText("input/clouderamanager.bp");
CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson);
List<ApiClusterTemplateConfig> serviceConfigs = underTest.getServiceConfigs(cmTemplateProcessor, preparationObject);
assertEquals(1, serviceConfigs.size());
assertEquals("hdfs_rootdir", serviceConfigs.get(0).getName());
assertEquals("s3a://bucket/cluster1/hbase", serviceConfigs.get(0).getValue());
}
use of com.cloudera.api.swagger.model.ApiClusterTemplateConfig in project cloudbreak by hortonworks.
the class CentralCmTemplateUpdaterTest method configsAreInjected.
@Test
public void configsAreInjected() {
List<ApiClusterTemplateConfig> serviceConfigs = List.of(config("service_config_name", "service_config_value"));
List<ApiClusterTemplateConfig> roleConfigs = List.of(config("role_config_name", "role_config_value"));
ReflectionTestUtils.setField(cmTemplateConfigInjectorProcessor, "injectors", List.of(new CmTemplateConfigInjector() {
@Override
public List<ApiClusterTemplateConfig> getServiceConfigs(ApiClusterTemplateService service, TemplatePreparationObject source) {
return serviceConfigs;
}
@Override
public List<ApiClusterTemplateConfig> getRoleConfigs(ApiClusterTemplateRoleConfigGroup roleConfigGroup, ApiClusterTemplateService service, TemplatePreparationObject source) {
return roleConfigs;
}
}));
when(blueprintView.getBlueprintText()).thenReturn(getBlueprintText("input/namenode-ha.bp"));
ApiClusterTemplate generated = testGetCmTemplate();
assertMatchesBlueprintAtPath("output/namenode-ha-injected.bp", generated);
}
use of com.cloudera.api.swagger.model.ApiClusterTemplateConfig in project cloudbreak by hortonworks.
the class RangerRoleConfigProvider method getRoleConfigs.
@Override
protected List<ApiClusterTemplateConfig> getRoleConfigs(String roleType, TemplatePreparationObject source) {
switch(roleType) {
case RangerRoles.RANGER_ADMIN:
String cmVersion = getCmVersion(source);
List<ApiClusterTemplateConfig> configList = new ArrayList<>();
// In CM 7.2.1 and above, the ranger database parameters have moved to the service
// config (see above getServiceConfigs).
RdsView rangerRdsView = getRdsView(source);
if (!isVersionNewerOrEqualThanLimited(cmVersion, CLOUDERAMANAGER_VERSION_7_2_1)) {
addDbConfigs(rangerRdsView, configList, cmVersion);
}
addDbSslConfigsIfNeeded(rangerRdsView, configList, cmVersion);
VirtualGroupRequest virtualGroupRequest = source.getVirtualGroupRequest();
if (isVersionNewerOrEqualThanLimited(cmVersion, CLOUDERAMANAGER_VERSION_7_0_1)) {
String adminGroup = virtualGroupService.createOrGetVirtualGroup(virtualGroupRequest, UmsVirtualGroupRight.RANGER_ADMIN);
configList.add(config(RANGER_DEFAULT_POLICY_GROUPS, adminGroup));
}
if (isVersionNewerOrEqualThanLimited(cmVersion, CLOUDERAMANAGER_VERSION_7_6_0)) {
String hbaseAdminGroup = virtualGroupService.createOrGetVirtualGroup(virtualGroupRequest, UmsVirtualGroupRight.HBASE_ADMIN);
configList.add(config(RANGER_HBASE_ADMIN_VIRTUAL_GROUPS, hbaseAdminGroup));
}
return configList;
default:
return List.of();
}
}
use of com.cloudera.api.swagger.model.ApiClusterTemplateConfig in project cloudbreak by hortonworks.
the class StreamsMessagingManagerServiceConfigProvider method getServiceConfigs.
@Override
public List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject source) {
final List<ApiClusterTemplateConfig> configList;
String cdhVersion = source.getBlueprintView().getProcessor().getStackVersion() == null ? "" : source.getBlueprintView().getProcessor().getStackVersion();
if (isVersionNewerOrEqualThanLimited(cdhVersion, CLOUDERAMANAGER_VERSION_7_2_0)) {
RdsView smmRdsView = getRdsView(source);
configList = List.of(config(DATABASE_TYPE, dataBaseTypeForCM(smmRdsView.getDatabaseVendor())), config(DATABASE_NAME, smmRdsView.getDatabaseName()), config(DATABASE_HOST, smmRdsView.getHost()), config(DATABASE_PORT, smmRdsView.getPort()), config(DATABASE_USER, smmRdsView.getConnectionUserName()), config(DATABASE_PASSWORD, smmRdsView.getConnectionPassword()));
} else {
String cmHost = source.getGeneralClusterConfigs().getPrimaryGatewayInstanceDiscoveryFQDN().orElse(source.getGeneralClusterConfigs().getClusterManagerIp());
boolean ssl = source.getGeneralClusterConfigs().getAutoTlsEnabled();
configList = Lists.newArrayList(config("cm.metrics.host", cmHost), config("cm.metrics.username", source.getGeneralClusterConfigs().getCloudbreakAmbariUser()), config("cm.metrics.password", source.getGeneralClusterConfigs().getCloudbreakAmbariPassword()), config("cm.metrics.protocol", ssl ? "https" : "http"), config("cm.metrics.port", ssl ? "7183" : "7180"));
}
return configList;
}
Aggregations