use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request in project cloudbreak by hortonworks.
the class RdsConfigValidatorTest method acceptsMultipleDatabasesOfDifferentType.
@Test
public void acceptsMultipleDatabasesOfDifferentType() {
ClusterV4Request request = requestWithDatabases(DatabaseType.HIVE, DatabaseType.HUE, DatabaseType.RANGER);
subject.validateRdsConfigs(request, null, workspace);
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request in project cloudbreak by hortonworks.
the class RdsConfigValidatorTest method rejectsMultipleDatabasesOfSameType.
@Test
public void rejectsMultipleDatabasesOfSameType() {
ClusterV4Request request = requestWithDatabases(DatabaseType.HIVE, DatabaseType.HUE, DatabaseType.HIVE, DatabaseType.RANGER, DatabaseType.RANGER);
BadRequestException exception = assertThrows(BadRequestException.class, () -> subject.validateRdsConfigs(request, null, workspace));
assertTrue(exception.getMessage().contains("HIVE"));
assertFalse(exception.getMessage().contains("HUE"));
assertTrue(exception.getMessage().contains("RANGER"));
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request in project cloudbreak by hortonworks.
the class StackRuntimeVersionValidatorTest method createStackRequest.
private StackV4Request createStackRequest(String dataHubVersion) {
ClouderaManagerRepositoryV4Request clouderaManagerRepositoryV4Request = new ClouderaManagerRepositoryV4Request();
clouderaManagerRepositoryV4Request.setVersion("do-not-use-this-version");
ClouderaManagerV4Request clouderaManagerV4Request = new ClouderaManagerV4Request();
clouderaManagerV4Request.setProducts(List.of(new ClouderaManagerProductV4Request().withName("CDH").withVersion(dataHubVersion)));
clouderaManagerV4Request.setRepository(clouderaManagerRepositoryV4Request);
ClusterV4Request clusterV4Request = new ClusterV4Request();
clusterV4Request.setCm(clouderaManagerV4Request);
StackV4Request stackV4Request = new StackV4Request();
stackV4Request.setCluster(clusterV4Request);
stackV4Request.setEnvironmentCrn(ENVIRONMENT_CRN);
return stackV4Request;
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request in project cloudbreak by hortonworks.
the class StackRuntimeVersionValidatorTest method createStackRequestWithoutCm.
private StackV4Request createStackRequestWithoutCm() {
ClusterV4Request clusterV4Request = new ClusterV4Request();
StackV4Request stackV4Request = new StackV4Request();
stackV4Request.setCluster(clusterV4Request);
stackV4Request.setEnvironmentCrn(ENVIRONMENT_CRN);
return stackV4Request;
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request in project cloudbreak by hortonworks.
the class DistroXClusterToClusterConverter method convert.
public ClusterV4Request convert(DistroXV1Request request, DetailedEnvironmentResponse environment) {
DistroXClusterV1Request source = request.getCluster();
ClusterV4Request response = new ClusterV4Request();
if (isEmpty(source.getExposedServices())) {
source.setExposedServices(List.of("ALL"));
}
response.setGateway(gatewayConverter.convert(source.getExposedServices()));
response.setName(null);
response.setDatabases(source.getDatabases());
response.setBlueprintName(source.getBlueprintName());
response.setCustomConfigurationsName(source.getCustomConfigurationsName());
response.setUserName(source.getUserName());
response.setPassword(source.getPassword());
response.setProxyConfigCrn(getIfNotNull(source.getProxy(), proxy -> getProxyCrnByName(ThreadBasedUserCrnProvider.getAccountId(), proxy)));
response.setCm(getIfNotNull(source.getCm(), cmConverter::convert));
response.setCloudStorage(cloudStorageDecorator.decorate(source.getBlueprintName(), request.getName(), source.getCloudStorage(), environment));
response.setValidateBlueprint(source.getValidateBlueprint());
response.setCustomContainer(null);
response.setCustomQueue(null);
return response;
}
Aggregations