Search in sources :

Example 6 with FreeIpaUpgradeOptions

use of com.sequenceiq.freeipa.api.v1.freeipa.upgrade.model.FreeIpaUpgradeOptions in project cloudbreak by hortonworks.

the class UpgradeService method collectUpgradeOptions.

public FreeIpaUpgradeOptions collectUpgradeOptions(String accountId, String environmentCrn, String catalog) {
    Stack stack = stackService.getByEnvironmentCrnAndAccountIdWithListsAndMdcContext(environmentCrn, accountId);
    ImageInfoResponse currentImage = imageService.fetchCurrentImage(stack);
    String catalogForRequest = Optional.ofNullable(catalog).or(() -> Optional.ofNullable(currentImage.getCatalog())).orElse(currentImage.getCatalogName());
    List<ImageInfoResponse> targetImages = getTargetImages(catalogForRequest, stack, currentImage);
    return createFreeIpaUpgradeOptions(targetImages, currentImage);
}
Also used : ImageInfoResponse(com.sequenceiq.freeipa.api.v1.freeipa.upgrade.model.ImageInfoResponse) Stack(com.sequenceiq.freeipa.entity.Stack)

Aggregations

FreeIpaUpgradeOptions (com.sequenceiq.freeipa.api.v1.freeipa.upgrade.model.FreeIpaUpgradeOptions)5 Stack (com.sequenceiq.freeipa.entity.Stack)5 ImageInfoResponse (com.sequenceiq.freeipa.api.v1.freeipa.upgrade.model.ImageInfoResponse)4 ImageSettingsRequest (com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.image.ImageSettingsRequest)3 Test (org.junit.jupiter.api.Test)3 CloudbreakServiceException (com.sequenceiq.cloudbreak.common.exception.CloudbreakServiceException)1 ImageEntity (com.sequenceiq.freeipa.entity.ImageEntity)1