Search in sources :

Example 1 with RepositoryDetails

use of com.sequenceiq.cloudbreak.cloud.model.component.RepositoryDetails 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 RepositoryDetails

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

the class RepoTestUtil method getCMRepo.

public static Map<String, RepositoryDetails> getCMRepo(String version) {
    Map<String, RepositoryDetails> cmRepo = new HashMap<>();
    RepositoryDetails redhat7RepositoryDetails = new RepositoryDetails();
    redhat7RepositoryDetails.setBaseurl("http://redhat7-base/" + version);
    redhat7RepositoryDetails.setGpgkey("http://redhat7-gpg/" + version);
    cmRepo.put("redhat7", redhat7RepositoryDetails);
    return cmRepo;
}
Also used : RepositoryDetails(com.sequenceiq.cloudbreak.cloud.model.component.RepositoryDetails) HashMap(java.util.HashMap)

Aggregations

RepositoryDetails (com.sequenceiq.cloudbreak.cloud.model.component.RepositoryDetails)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 RepositoryInfo (com.sequenceiq.cloudbreak.cloud.model.component.RepositoryInfo)1 HashMap (java.util.HashMap)1 Entry (java.util.Map.Entry)1