Search in sources :

Example 31 with AdlsGen2CloudStorageV1Parameters

use of com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters in project cloudbreak by hortonworks.

the class BackupConverter method convertAdlsV2.

private AdlsGen2CloudStorageV1Parameters convertAdlsV2(AdlsGen2CloudStorageV1Parameters adlsV2) {
    AdlsGen2CloudStorageV1Parameters adlsGen2CloudStorageV1Parameters = null;
    if (adlsV2 != null) {
        adlsGen2CloudStorageV1Parameters = new AdlsGen2CloudStorageV1Parameters();
        adlsGen2CloudStorageV1Parameters.setAccountKey(adlsV2.getAccountKey());
        adlsGen2CloudStorageV1Parameters.setAccountName(adlsV2.getAccountName());
        adlsGen2CloudStorageV1Parameters.setManagedIdentity(adlsV2.getManagedIdentity());
        adlsGen2CloudStorageV1Parameters.setSecure(adlsV2.isSecure());
    }
    return adlsGen2CloudStorageV1Parameters;
}
Also used : AdlsGen2CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters)

Example 32 with AdlsGen2CloudStorageV1Parameters

use of com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters in project cloudbreak by hortonworks.

the class TelemetryApiConverter method convertAdlsV2.

private AdlsGen2CloudStorageV1Parameters convertAdlsV2(AdlsGen2CloudStorageV1Parameters adlsV2) {
    AdlsGen2CloudStorageV1Parameters adlsGen2CloudStorageV1Parameters = null;
    if (adlsV2 != null) {
        adlsGen2CloudStorageV1Parameters = new AdlsGen2CloudStorageV1Parameters();
        adlsGen2CloudStorageV1Parameters.setAccountKey(adlsV2.getAccountKey());
        adlsGen2CloudStorageV1Parameters.setAccountName(adlsV2.getAccountName());
        adlsGen2CloudStorageV1Parameters.setManagedIdentity(adlsV2.getManagedIdentity());
        adlsGen2CloudStorageV1Parameters.setSecure(adlsV2.isSecure());
    }
    return adlsGen2CloudStorageV1Parameters;
}
Also used : AdlsGen2CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters)

Example 33 with AdlsGen2CloudStorageV1Parameters

use of com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters in project cloudbreak by hortonworks.

the class CloudBackupFolderResolverServiceTest method testUpdateStorageLocationAdlsGen2.

@Test
public void testUpdateStorageLocationAdlsGen2() {
    // GIVEN
    Backup backup = createBackup();
    backup.setS3(null);
    backup.setAdlsGen2(new AdlsGen2CloudStorageV1Parameters());
    backup.setStorageLocation("abfs://mycontainer@someaccount.dfs.core.windows.net");
    // WHEN
    underTest.updateStorageLocation(backup, FluentClusterType.FREEIPA.value(), "mycluster", "crn:cdp:cloudbreak:us-west-1:someone:stack:12345");
    // THEN
    assertEquals("https://someaccount.dfs.core.windows.net/mycontainer/cluster-backups/freeipa/mycluster_12345", backup.getStorageLocation());
}
Also used : AdlsGen2CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters) Backup(com.sequenceiq.freeipa.api.model.Backup) Test(org.junit.Test)

Example 34 with AdlsGen2CloudStorageV1Parameters

use of com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters in project cloudbreak by hortonworks.

the class CloudBackupFolderResolverServiceTest method testUpdateStorageLocationAdlsGen2WithoutScheme.

@Test
public void testUpdateStorageLocationAdlsGen2WithoutScheme() {
    // GIVEN
    Backup backup = createBackup();
    backup.setS3(null);
    backup.setAdlsGen2(new AdlsGen2CloudStorageV1Parameters());
    backup.setStorageLocation("mycontainer@someaccount");
    // WHEN
    underTest.updateStorageLocation(backup, FluentClusterType.FREEIPA.value(), "mycluster", "crn:cdp:cloudbreak:us-west-1:someone:stack:12345");
    // THEN
    assertEquals("https://someaccount.dfs.core.windows.net/mycontainer/cluster-backups/freeipa/mycluster_12345", backup.getStorageLocation());
}
Also used : AdlsGen2CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters) Backup(com.sequenceiq.freeipa.api.model.Backup) Test(org.junit.Test)

Example 35 with AdlsGen2CloudStorageV1Parameters

use of com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters in project cloudbreak by hortonworks.

the class StackToCloudStackConverterTest method testBuildFileSystemViewDifferentAzureManagedIdentity.

@Test
public void testBuildFileSystemViewDifferentAzureManagedIdentity() throws Exception {
    Telemetry telemetry = mock(Telemetry.class);
    Backup backup = mock(Backup.class);
    Logging logging = mock(Logging.class);
    AdlsGen2CloudStorageV1Parameters adlsGen2Logging = new AdlsGen2CloudStorageV1Parameters();
    adlsGen2Logging.setManagedIdentity("/subscriptions/id/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1");
    AdlsGen2CloudStorageV1Parameters adlsGen2Backup = new AdlsGen2CloudStorageV1Parameters();
    adlsGen2Backup.setManagedIdentity("/subscriptions/id/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2");
    when(stack.getTelemetry()).thenReturn(telemetry);
    when(telemetry.getLogging()).thenReturn(logging);
    when(stack.getBackup()).thenReturn(backup);
    when(backup.getAdlsGen2()).thenReturn(adlsGen2Logging);
    when(logging.getAdlsGen2()).thenReturn(adlsGen2Backup);
    expectedException.expect(BadRequestException.class);
    underTest.buildFileSystemView(stack);
}
Also used : Logging(com.sequenceiq.common.api.telemetry.model.Logging) AdlsGen2CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters) Backup(com.sequenceiq.freeipa.api.model.Backup) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) Test(org.junit.Test)

Aggregations

AdlsGen2CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters)42 Test (org.junit.Test)15 Telemetry (com.sequenceiq.common.api.telemetry.model.Telemetry)12 Logging (com.sequenceiq.common.api.telemetry.model.Logging)10 Test (org.junit.jupiter.api.Test)9 GcsCloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters)7 S3CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters)7 Backup (com.sequenceiq.freeipa.api.model.Backup)6 StorageIdentityBase (com.sequenceiq.common.api.cloudstorage.StorageIdentityBase)5 ValidationResult (com.sequenceiq.cloudbreak.validation.ValidationResult)4 CloudAdlsGen2View (com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudAdlsGen2View)3 CloudStorageRequest (com.sequenceiq.common.api.cloudstorage.CloudStorageRequest)3 WasbCloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.WasbCloudStorageV1Parameters)3 CloudGcsView (com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudGcsView)2 CloudS3View (com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudS3View)2 BackupRequest (com.sequenceiq.common.api.backup.request.BackupRequest)2 StorageLocationBase (com.sequenceiq.common.api.cloudstorage.StorageLocationBase)2 StackTags (com.sequenceiq.cloudbreak.cloud.model.StackTags)1 CloudFileSystemView (com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudFileSystemView)1 AwsInstanceTemplate (com.sequenceiq.cloudbreak.cloud.model.instance.AwsInstanceTemplate)1