use of com.sequenceiq.cloudbreak.domain.stack.Component in project cloudbreak by hortonworks.
the class ComponentConfigProviderService method replaceImageComponentWithNew.
public void replaceImageComponentWithNew(Component component) {
Component componentEntity = componentRepository.findComponentByStackIdComponentTypeName(component.getStack().getId(), component.getComponentType(), component.getName()).orElseThrow(NotFoundException.notFound("component", component.getName()));
componentEntity.setAttributes(component.getAttributes());
componentEntity.setName(component.getName());
componentRepository.save(componentEntity);
}
use of com.sequenceiq.cloudbreak.domain.stack.Component in project cloudbreak by hortonworks.
the class ImageService method addImage.
private void addImage(Stack stack, Map<InstanceGroupType, String> userData, StatedImage statedImage, String imageName, com.sequenceiq.cloudbreak.cloud.model.catalog.Image catalogBasedImage, Set<Component> components) {
Image image = new Image(imageName, userData, catalogBasedImage.getOs(), catalogBasedImage.getOsType(), statedImage.getImageCatalogUrl(), statedImage.getImageCatalogName(), catalogBasedImage.getUuid(), catalogBasedImage.getPackageVersions());
components.add(new Component(IMAGE, IMAGE.name(), new Json(image), stack));
}
use of com.sequenceiq.cloudbreak.domain.stack.Component in project cloudbreak by hortonworks.
the class ImageService method addCmRepo.
private void addCmRepo(Stack stack, Set<Component> components, com.sequenceiq.cloudbreak.cloud.model.catalog.Image catalogBasedImage) throws CloudbreakImageCatalogException {
if (catalogBasedImage.getStackDetails() != null) {
ImageStackDetails stackDetails = catalogBasedImage.getStackDetails();
StackType stackType = determineStackType(stackDetails);
ClouderaManagerRepo clouderaManagerRepo = getClouderaManagerRepo(catalogBasedImage, stackType);
components.add(new Component(CM_REPO_DETAILS, CM_REPO_DETAILS.name(), new Json(clouderaManagerRepo), stack));
} else {
LOGGER.debug("There are no stackDetails for stack {}, cannot determine CM repo version.", stack.getName());
}
}
use of com.sequenceiq.cloudbreak.domain.stack.Component in project cloudbreak by hortonworks.
the class ImageService method decorateImageWithUserDataForStack.
public void decorateImageWithUserDataForStack(Stack stack, Map<InstanceGroupType, String> userData) throws CloudbreakImageNotFoundException {
Image image = componentConfigProviderService.getImage(stack.getId());
image.setUserdata(userData);
Component imageComponent = new Component(IMAGE, IMAGE.name(), new Json(image), stack);
componentConfigProviderService.replaceImageComponentWithNew(imageComponent);
}
use of com.sequenceiq.cloudbreak.domain.stack.Component in project cloudbreak by hortonworks.
the class ClusterUpgradeTargetImageService method createTargetImageComponent.
private Component createTargetImageComponent(Long stackId, StatedImage targetImage) {
Stack stack = stackService.getById(stackId);
Image imageModel = stackImageService.getImageModelFromStatedImage(stack, getCurrentImage(stack), targetImage);
return new Component(ComponentType.IMAGE, TARGET_IMAGE, new Json(imageModel), stack);
}
Aggregations