Search in sources :

Example 1 with Backup

use of com.sequenceiq.freeipa.api.model.Backup in project cloudbreak by hortonworks.

the class StackToCloudStackConverter method buildFileSystemView.

public Optional<CloudFileSystemView> buildFileSystemView(Stack stack) {
    Telemetry telemetry = stack.getTelemetry();
    Backup backup = stack.getBackup();
    Optional<CloudFileSystemView> fileSystemView = Optional.empty();
    if (telemetry != null && telemetry.getLogging() != null && backup != null) {
        checkLoggingAndBackupFileSystemConflicting(telemetry.getLogging(), backup);
    }
    if (telemetry != null && telemetry.getLogging() != null) {
        fileSystemView = buildFileSystemViewFromTelemetry(telemetry.getLogging());
    }
    if (fileSystemView.isEmpty() && backup != null) {
        fileSystemView = buildFileSystemViewFromBackup(backup);
    }
    return fileSystemView;
}
Also used : Backup(com.sequenceiq.freeipa.api.model.Backup) CloudFileSystemView(com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudFileSystemView) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry)

Example 2 with Backup

use of com.sequenceiq.freeipa.api.model.Backup in project cloudbreak by hortonworks.

the class BackupConverter method convert.

public Backup convert(BackupRequest request) {
    Backup backup = null;
    if (freeIpaBackupEnabled && request != null) {
        backup = new Backup();
        backup.setMonthlyFullEnabled(backupConfiguration.isMonthlyFullEnabled());
        backup.setInitialFullEnabled(backupConfiguration.isRunInitialFullAfterInstall());
        backup.setHourlyEnabled(backupConfiguration.isHourlyEnabled());
        decorateBackupFromBackupRequest(backup, request);
    }
    return backup;
}
Also used : Backup(com.sequenceiq.freeipa.api.model.Backup)

Example 3 with Backup

use of com.sequenceiq.freeipa.api.model.Backup in project cloudbreak by hortonworks.

the class BackupConverter method convert.

public Backup convert(TelemetryRequest request) {
    Backup backup = null;
    if (freeIpaBackupEnabled && request != null && request.getLogging() != null) {
        backup = new Backup();
        backup.setMonthlyFullEnabled(backupConfiguration.isMonthlyFullEnabled());
        backup.setInitialFullEnabled(backupConfiguration.isRunInitialFullAfterInstall());
        backup.setHourlyEnabled(backupConfiguration.isHourlyEnabled());
        decorateBackupFromLoggingRequest(backup, request.getLogging());
    }
    return backup;
}
Also used : Backup(com.sequenceiq.freeipa.api.model.Backup)

Example 4 with Backup

use of com.sequenceiq.freeipa.api.model.Backup in project cloudbreak by hortonworks.

the class CloudBackupFolderResolverServiceTest method testUpdateStorageLocationWithoutBackup.

@Test
public void testUpdateStorageLocationWithoutBackup() {
    // GIVEN
    Backup backup = null;
    // WHEN
    underTest.updateStorageLocation(backup, FluentClusterType.FREEIPA.value(), "mycluster", "crn:cdp:cloudbreak:us-west-1:someone:stack:12345");
    // THEN
    assertNull(backup);
}
Also used : Backup(com.sequenceiq.freeipa.api.model.Backup) Test(org.junit.Test)

Example 5 with Backup

use of com.sequenceiq.freeipa.api.model.Backup in project cloudbreak by hortonworks.

the class CloudBackupFolderResolverServiceTest method testUpdateStorageLocationWithInvalidCrn.

@Test(expected = CrnParseException.class)
public void testUpdateStorageLocationWithInvalidCrn() {
    // GIVEN
    Backup backup = createBackup();
    // WHEN
    underTest.updateStorageLocation(backup, FluentClusterType.FREEIPA.value(), "mycluster", "crn:cdp:cloudbreak:us-west:someone:stack:12345");
}
Also used : Backup(com.sequenceiq.freeipa.api.model.Backup) Test(org.junit.Test)

Aggregations

Backup (com.sequenceiq.freeipa.api.model.Backup)30 Test (org.junit.Test)13 Telemetry (com.sequenceiq.common.api.telemetry.model.Telemetry)12 Test (org.junit.jupiter.api.Test)10 S3CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters)7 Logging (com.sequenceiq.common.api.telemetry.model.Logging)7 BackupRequest (com.sequenceiq.common.api.backup.request.BackupRequest)6 AdlsGen2CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters)6 Stack (com.sequenceiq.freeipa.entity.Stack)5 CloudFileSystemView (com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudFileSystemView)4 GcsCloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters)4 DetailedEnvironmentResponse (com.sequenceiq.environment.api.v1.environment.model.response.DetailedEnvironmentResponse)4 CreateFreeIpaRequest (com.sequenceiq.freeipa.api.v1.freeipa.stack.model.create.CreateFreeIpaRequest)4 InstanceGroup (com.sequenceiq.freeipa.entity.InstanceGroup)4 StackAuthentication (com.sequenceiq.freeipa.entity.StackAuthentication)4 ImageSettingsRequest (com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.image.ImageSettingsRequest)3 FreeIpa (com.sequenceiq.freeipa.entity.FreeIpa)3 Network (com.sequenceiq.freeipa.entity.Network)3 TelemetryRequest (com.sequenceiq.common.api.telemetry.request.TelemetryRequest)2 FreeIpaServerRequest (com.sequenceiq.freeipa.api.v1.freeipa.stack.model.FreeIpaServerRequest)2