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;
}
Aggregations