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;
}
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;
}
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());
}
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());
}
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);
}
Aggregations