Search in sources :

Example 6 with ClouderaManagerV4Request

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.cm.ClouderaManagerV4Request in project cloudbreak by hortonworks.

the class StackCreatorServiceTest method testShouldUseBaseCMImageWithProductsAndPlatformIsYarn.

@Test
public void testShouldUseBaseCMImageWithProductsAndPlatformIsYarn() {
    ClusterV4Request clusterV4Request = new ClusterV4Request();
    ClouderaManagerV4Request cmRequest = new ClouderaManagerV4Request();
    ClouderaManagerProductV4Request cdpRequest = new ClouderaManagerProductV4Request();
    cdpRequest.setName("CDP");
    cdpRequest.setParcel("parcel");
    cdpRequest.setVersion("version");
    cdpRequest.setCsd(List.of("csd"));
    cmRequest.setProducts(List.of(cdpRequest));
    clusterV4Request.setCm(cmRequest);
    boolean base = underTest.shouldUseBaseCMImage(clusterV4Request, YARN_PLATFORM);
    assertTrue(base);
}
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) ClouderaManagerV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.cm.ClouderaManagerV4Request) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 7 with ClouderaManagerV4Request

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.cm.ClouderaManagerV4Request in project cloudbreak by hortonworks.

the class StackCreatorServiceTest method testShouldUseBaseCMImageShouldReturnTrueWithCMImageWithCmRepoAndImageIsNotPresentAndPlatformIsNotYarn.

@Test
public void testShouldUseBaseCMImageShouldReturnTrueWithCMImageWithCmRepoAndImageIsNotPresentAndPlatformIsNotYarn() {
    ClusterV4Request clusterV4Request = new ClusterV4Request();
    ClouderaManagerV4Request cmRequest = new ClouderaManagerV4Request();
    ClouderaManagerRepositoryV4Request cmRepoRequest = new ClouderaManagerRepositoryV4Request();
    cmRequest.setRepository(cmRepoRequest);
    clusterV4Request.setCm(cmRequest);
    boolean base = underTest.shouldUseBaseCMImage(clusterV4Request, AWS_PLATFORM);
    assertTrue(base);
}
Also used : ClusterV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request) 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) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 8 with ClouderaManagerV4Request

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.cm.ClouderaManagerV4Request in project cloudbreak by hortonworks.

the class YcloudHybridCloudTest method validateRequestParameters.

private SdxInternalTestDto validateRequestParameters(TestContext tc, SdxInternalTestDto dto, SdxClient client) {
    assertNotNull(dto);
    SdxInternalClusterRequest sdxRequest = dto.getRequest();
    assertNotNull(sdxRequest);
    StackV4Request stackRequest = sdxRequest.getStackV4Request();
    assertNotNull(stackRequest);
    ClusterV4Request clusterRequest = stackRequest.getCluster();
    assertNotNull(clusterRequest);
    ClouderaManagerV4Request cmRequest = clusterRequest.getCm();
    assertNotNull(cmRequest);
    validateInstanceGroups(stackRequest.getInstanceGroups());
    validateRepository(cmRequest.getRepository());
    validateProducts(cmRequest.getProducts());
    return dto;
}
Also used : ClusterV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request) SdxInternalClusterRequest(com.sequenceiq.sdx.api.model.SdxInternalClusterRequest) StackV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.StackV4Request) ClouderaManagerV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.cm.ClouderaManagerV4Request)

Example 9 with ClouderaManagerV4Request

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.cm.ClouderaManagerV4Request in project cloudbreak by hortonworks.

the class DistroXClusterToClusterConverterTest method testConvertWithoutEnvCmConversionShouldHappenIfInputCmIsNotNull.

@Test
void testConvertWithoutEnvCmConversionShouldHappenIfInputCmIsNotNull() {
    ClouderaManagerV4Request cmConversionResult = new ClouderaManagerV4Request();
    when(cmConverter.convert(distroXV1RequestInput.getCluster().getCm())).thenReturn(cmConversionResult);
    when(regionAwareInternalCrnGenerator.getInternalCrnForServiceAsString()).thenReturn("crn");
    when(regionAwareInternalCrnGeneratorFactory.iam()).thenReturn(regionAwareInternalCrnGenerator);
    ClusterV4Request result = testConvertDistroXV1Request();
    assertNotNull(result);
    assertEquals(cmConversionResult, result.getCm());
    verify(cmConverter, times(1)).convert(any(ClouderaManagerV1Request.class));
    verify(cmConverter, times(1)).convert(distroXV1RequestInput.getCluster().getCm());
}
Also used : ClusterV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request) ClouderaManagerV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.cm.ClouderaManagerV4Request) ClouderaManagerV1Request(com.sequenceiq.distrox.api.v1.distrox.model.cluster.cm.ClouderaManagerV1Request) Test(org.junit.jupiter.api.Test)

Example 10 with ClouderaManagerV4Request

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.cm.ClouderaManagerV4Request in project cloudbreak by hortonworks.

the class ClouderaManagerV1ToClouderaManagerV4Converter method convert.

public ClouderaManagerV4Request convert(ClouderaManagerV1Request source) {
    ClouderaManagerV4Request response = new ClouderaManagerV4Request();
    doIfNotNull(source.getProducts(), products -> response.setProducts(products.stream().map(this::convertProduct).collect(Collectors.toList())));
    response.setRepository(getIfNotNull(source.getRepository(), repositoryConverter::convert));
    response.setEnableAutoTls(source.getEnableAutoTls());
    return response;
}
Also used : ClouderaManagerV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.cm.ClouderaManagerV4Request)

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