Search in sources :

Example 21 with ClouderaManagerV4Request

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;
}
Also used : ClusterV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request) ClouderaManagerProductV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.cm.product.ClouderaManagerProductV4Request) StackV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.StackV4Request) ClouderaManagerRepositoryV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.cm.repository.ClouderaManagerRepositoryV4Request) ClouderaManagerV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.cm.ClouderaManagerV4Request)

Example 22 with ClouderaManagerV4Request

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;
}
Also used : GeneralClusterConfigs(com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs) InstanceGroupV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.instancegroup.InstanceGroupV4Request)

Aggregations

ClouderaManagerV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.cm.ClouderaManagerV4Request)20 ClusterV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request)16 ClouderaManagerRepositoryV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.cm.repository.ClouderaManagerRepositoryV4Request)10 Test (org.junit.jupiter.api.Test)10 ClouderaManagerProductV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.cm.product.ClouderaManagerProductV4Request)8 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)8 ClusterComponent (com.sequenceiq.cloudbreak.domain.stack.cluster.ClusterComponent)5 ClouderaManagerProduct (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct)4 Json (com.sequenceiq.cloudbreak.common.json.Json)4 Cluster (com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster)4 ComponentType (com.sequenceiq.cloudbreak.common.type.ComponentType)3 Set (java.util.Set)3 StackV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.StackV4Request)2 GatewayV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.gateway.GatewayV4Request)2 ThreadBasedUserCrnProvider (com.sequenceiq.cloudbreak.auth.ThreadBasedUserCrnProvider)2 EntitlementService (com.sequenceiq.cloudbreak.auth.altus.EntitlementService)2 ClouderaManagerRepo (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo)2 StackType (com.sequenceiq.cloudbreak.cloud.model.component.StackType)2 BadRequestException (com.sequenceiq.cloudbreak.common.exception.BadRequestException)2 NotFoundException (com.sequenceiq.cloudbreak.common.exception.NotFoundException)2