use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.cm.ClouderaManagerV4Request 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.cm.ClouderaManagerV4Request in project cloudbreak by hortonworks.
the class GeneralClusterConfigsProvider method generalClusterConfigs.
public GeneralClusterConfigs generalClusterConfigs(StackV4Request stack, String email, String clusterVariant) {
boolean gatewayInstanceMetadataPresented = false;
int nodeCount = 0;
for (InstanceGroupV4Request instanceGroup : stack.getInstanceGroups()) {
nodeCount += instanceGroup.getNodeCount();
}
GeneralClusterConfigs generalClusterConfigs = new GeneralClusterConfigs();
generalClusterConfigs.setIdentityUserEmail(email);
generalClusterConfigs.setClusterManagerIp(PENDING_DEFAULT_VALUE);
generalClusterConfigs.setInstanceGroupsPresented(false);
generalClusterConfigs.setPassword(stack.getCluster().getPassword());
if (stack.getCluster().getGateway() != null) {
gatewayInstanceMetadataPresented = true;
}
generalClusterConfigs.setGatewayInstanceMetadataPresented(gatewayInstanceMetadataPresented);
generalClusterConfigs.setClusterName(stack.getName());
generalClusterConfigs.setStackName(stack.getName());
generalClusterConfigs.setUuid(PENDING_DEFAULT_VALUE);
generalClusterConfigs.setUserName(stack.getCluster().getUserName());
generalClusterConfigs.setNodeCount(nodeCount);
generalClusterConfigs.setPrimaryGatewayInstanceDiscoveryFQDN(Optional.of(PENDING_DEFAULT_VALUE));
generalClusterConfigs.setVariant(clusterVariant);
Boolean autoTlsEnabled = Optional.ofNullable(stack.getCluster().getCm()).map(ClouderaManagerV4Request::getEnableAutoTls).orElse(Boolean.FALSE);
generalClusterConfigs.setAutoTlsEnabled(autoTlsEnabled);
return generalClusterConfigs;
}
Aggregations