use of com.sequenceiq.cloudbreak.api.endpoint.v4.imagecatalog.responses.ClouderaManagerStackDetailsV4Response in project cloudbreak by hortonworks.
the class ImagesToImagesV4ResponseConverter method convertClouderaManagerStackDetailsToJson.
private ClouderaManagerStackDetailsV4Response convertClouderaManagerStackDetailsToJson(ImageStackDetails stackDetails) {
ClouderaManagerStackDetailsV4Response json = new ClouderaManagerStackDetailsV4Response();
json.setVersion(stackDetails.getVersion());
json.setRepository(convertClouderaManagerStackRepoDetailsToJson(stackDetails.getRepo()));
json.setStackBuildNumber(stackDetails.getStackBuildNumber());
return json;
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.imagecatalog.responses.ClouderaManagerStackDetailsV4Response in project cloudbreak by hortonworks.
the class ImagesToImagesV4ResponseConverter method getBaseImageResponses.
private List<BaseImageV4Response> getBaseImageResponses(Images source) {
Map<String, ImageBasedDefaultCDHInfo> imageBasedDefaultCDHInfoMap = imageBasedDefaultCDHEntries.getEntries(source);
List<ClouderaManagerStackDetailsV4Response> defaultCdhStacks = getDefaultCdhStackInfo(imageBasedDefaultCDHInfoMap);
List<BaseImageV4Response> baseImages = source.getBaseImages().stream().map(image -> {
BaseImageV4Response imgJson = new BaseImageV4Response();
copyImageFieldsToJson(image, imgJson);
imgJson.setCdhStacks(defaultCdhStacks);
imgJson.setRepository(new HashMap<>());
return imgJson;
}).collect(Collectors.toList());
return baseImages;
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.imagecatalog.responses.ClouderaManagerStackDetailsV4Response in project cloudbreak by hortonworks.
the class ImagesToImagesV4ResponseConverter method getDefaultCdhStackInfo.
private List<ClouderaManagerStackDetailsV4Response> getDefaultCdhStackInfo(Map<String, ImageBasedDefaultCDHInfo> defaultStackInfo) {
List<ClouderaManagerStackDetailsV4Response> result = new ArrayList<>();
for (ImageBasedDefaultCDHInfo info : defaultStackInfo.values()) {
ClouderaManagerStackDetailsV4Response json = new ClouderaManagerStackDetailsV4Response();
ClouderaManagerStackRepoDetailsV4Response repoJson = new ClouderaManagerStackRepoDetailsV4Response();
Map<String, String> stackRepo = info.getDefaultCDHInfo().getRepo().getStack();
if (stackRepo != null) {
repoJson.setStack(stackRepo);
}
json.setRepository(repoJson);
json.setVersion(info.getDefaultCDHInfo().getVersion());
result.add(json);
}
return result;
}
Aggregations