Search in sources :

Example 1 with StackDetails

use of com.sequenceiq.cloudbreak.cloud.model.catalog.StackDetails in project cloudbreak by hortonworks.

the class ImageService method getComponents.

private List<Component> getComponents(Stack stack, Map<InstanceGroupType, String> userData, com.sequenceiq.cloudbreak.cloud.model.catalog.Image imgFromCatalog, String imageName, String imageCatalogUrl, String imageCatalogName, String imageId) throws JsonProcessingException, CloudbreakImageCatalogException {
    List<Component> components = new ArrayList<>();
    Image image = new Image(imageName, userData, imgFromCatalog.getOsType(), imageCatalogUrl, imageCatalogName, imageId);
    Component imageComponent = new Component(ComponentType.IMAGE, ComponentType.IMAGE.name(), new Json(image), stack);
    components.add(imageComponent);
    if (imgFromCatalog.getStackDetails() != null) {
        components.add(getAmbariComponent(stack, imgFromCatalog));
        StackDetails stackDetails = imgFromCatalog.getStackDetails();
        Component stackRepoComponent;
        if (!imgFromCatalog.getStackDetails().getRepo().getKnox().isEmpty()) {
            StackRepoDetails hdfRepo = createHDFRepo(stackDetails);
            stackRepoComponent = new Component(ComponentType.HDF_REPO_DETAILS, ComponentType.HDF_REPO_DETAILS.name(), new Json(hdfRepo), stack);
        } else {
            StackRepoDetails repo = createHDPRepo(stackDetails);
            stackRepoComponent = new Component(ComponentType.HDP_REPO_DETAILS, ComponentType.HDP_REPO_DETAILS.name(), new Json(repo), stack);
        }
        components.add(stackRepoComponent);
    }
    return components;
}
Also used : StackRepoDetails(com.sequenceiq.cloudbreak.cloud.model.component.StackRepoDetails) ArrayList(java.util.ArrayList) StackDetails(com.sequenceiq.cloudbreak.cloud.model.catalog.StackDetails) Json(com.sequenceiq.cloudbreak.domain.json.Json) Component(com.sequenceiq.cloudbreak.domain.Component) Image(com.sequenceiq.cloudbreak.cloud.model.Image)

Aggregations

Image (com.sequenceiq.cloudbreak.cloud.model.Image)1 StackDetails (com.sequenceiq.cloudbreak.cloud.model.catalog.StackDetails)1 StackRepoDetails (com.sequenceiq.cloudbreak.cloud.model.component.StackRepoDetails)1 Component (com.sequenceiq.cloudbreak.domain.Component)1 Json (com.sequenceiq.cloudbreak.domain.json.Json)1 ArrayList (java.util.ArrayList)1