Search in sources :

Example 1 with RepositoryInfo

use of com.sequenceiq.cloudbreak.cloud.model.component.RepositoryInfo in project cloudbreak by hortonworks.

the class StackMatrixService method getImageBasedCMStackDescriptor.

private ClouderaManagerStackDescriptorV4Response getImageBasedCMStackDescriptor(DefaultCDHInfo stackInfo, Image image) {
    ClouderaManagerStackDescriptorV4Response stackDescriptorV4 = stackInfoToClouderaManagerStackDescriptorV4ResponseConverter.convert(stackInfo);
    RepositoryInfo cmInfo = new RepositoryInfo();
    cmInfo.setVersion(image.getPackageVersion(ImagePackageVersion.CM));
    cmInfo.setRepo(image.getRepo().entrySet().stream().collect(Collectors.toMap(Entry::getKey, e -> {
        RepositoryDetails repo = new RepositoryDetails();
        repo.setBaseurl(e.getValue());
        return repo;
    })));
    ClouderaManagerInfoV4Response cmInfoJson = repositoryInfoToClouderaManagerInfoV4ResponseConverter.convert(cmInfo);
    stackDescriptorV4.setClouderaManager(cmInfoJson);
    for (ClouderaManagerProduct parcel : stackInfo.getParcels()) {
        stackDescriptorV4.getProducts().add(ClouderaManagerProductToClouderaManagerProductV4Response.convert(parcel));
    }
    stackDescriptorV4.setProductDefinitions(stackInfo.getCsd());
    return stackDescriptorV4;
}
Also used : RepositoryDetails(com.sequenceiq.cloudbreak.cloud.model.component.RepositoryDetails) ClouderaManagerInfoV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.util.responses.ClouderaManagerInfoV4Response) Entry(java.util.Map.Entry) RepositoryInfo(com.sequenceiq.cloudbreak.cloud.model.component.RepositoryInfo) ClouderaManagerStackDescriptorV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.util.responses.ClouderaManagerStackDescriptorV4Response) ClouderaManagerProduct(com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct)

Example 2 with RepositoryInfo

use of com.sequenceiq.cloudbreak.cloud.model.component.RepositoryInfo in project cloudbreak by hortonworks.

the class RepoTestUtil method getClouderaManagerInfo.

public static RepositoryInfo getClouderaManagerInfo(String version) {
    RepositoryInfo cmInfo = new RepositoryInfo();
    cmInfo.setVersion(version);
    cmInfo.setRepo(getCMRepo(version));
    return cmInfo;
}
Also used : RepositoryInfo(com.sequenceiq.cloudbreak.cloud.model.component.RepositoryInfo)

Aggregations

RepositoryInfo (com.sequenceiq.cloudbreak.cloud.model.component.RepositoryInfo)2 ClouderaManagerInfoV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.util.responses.ClouderaManagerInfoV4Response)1 ClouderaManagerStackDescriptorV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.util.responses.ClouderaManagerStackDescriptorV4Response)1 ClouderaManagerProduct (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct)1 RepositoryDetails (com.sequenceiq.cloudbreak.cloud.model.component.RepositoryDetails)1 Entry (java.util.Map.Entry)1