Search in sources :

Example 16 with AdlsGen2CloudStorageV1Parameters

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

the class FluentConfigServiceTest method testCreateFluentConfigWithAdlsGen2Path.

@Test
public void testCreateFluentConfigWithAdlsGen2Path() {
    // GIVEN
    Logging logging = new Logging();
    logging.setStorageLocation("abfs://mycontainer@myaccount.dfs.core.windows.net");
    AdlsGen2CloudStorageV1Parameters parameters = new AdlsGen2CloudStorageV1Parameters();
    parameters.setAccountKey("myAccountKey");
    logging.setAdlsGen2(parameters);
    Telemetry telemetry = new Telemetry();
    telemetry.setLogging(logging);
    // WHEN
    FluentConfigView result = underTest.createFluentConfigs(DEFAULT_FLUENT_CLUSTER_DETAILS, false, false, REGION_SAMPLE, telemetry);
    // THEN
    assertTrue(result.isEnabled());
    assertTrue(result.isCloudStorageLoggingEnabled());
    assertEquals("myAccountKey", result.getAzureStorageAccessKey());
    assertTrue(result.getLogFolderName().isBlank());
    assertEquals("mycontainer", result.getAzureContainer());
}
Also used : Logging(com.sequenceiq.common.api.telemetry.model.Logging) AdlsGen2CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) Test(org.junit.Test)

Example 17 with AdlsGen2CloudStorageV1Parameters

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

the class FluentConfigServiceTest method testCreateFluentConfigWithFullAdlsGen2PathWithContainer.

@Test
public void testCreateFluentConfigWithFullAdlsGen2PathWithContainer() {
    // GIVEN
    Logging logging = new Logging();
    logging.setStorageLocation("abfs://mycontainer/my/custom/path@myaccount.dfs.core.windows.net");
    AdlsGen2CloudStorageV1Parameters parameters = new AdlsGen2CloudStorageV1Parameters();
    parameters.setAccountKey("myAccountKey");
    logging.setAdlsGen2(parameters);
    Telemetry telemetry = new Telemetry();
    telemetry.setLogging(logging);
    // WHEN
    FluentConfigView result = underTest.createFluentConfigs(DEFAULT_FLUENT_CLUSTER_DETAILS, false, false, REGION_SAMPLE, telemetry);
    // THEN
    assertTrue(result.isEnabled());
    assertEquals("myAccountKey", result.getAzureStorageAccessKey());
    assertEquals("/my/custom/path", result.getLogFolderName());
    assertEquals("mycontainer", result.getAzureContainer());
}
Also used : Logging(com.sequenceiq.common.api.telemetry.model.Logging) AdlsGen2CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) Test(org.junit.Test)

Example 18 with AdlsGen2CloudStorageV1Parameters

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

the class CloudStorageFolderResolverServiceTest method testUpdateStorageLocationAdlsGen2.

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

Example 19 with AdlsGen2CloudStorageV1Parameters

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

the class StorageValidationServiceTest method whenAzureConfiguredWithManagedIdentityShouldNotThrowException.

@Test
public void whenAzureConfiguredWithManagedIdentityShouldNotThrowException() {
    SdxCloudStorageRequest cloudStorageRequest = new SdxCloudStorageRequest();
    cloudStorageRequest.setBaseLocation("abfs://example-path");
    cloudStorageRequest.setFileSystemType(FileSystemType.ADLS_GEN_2);
    AdlsGen2CloudStorageV1Parameters adlsGen2 = new AdlsGen2CloudStorageV1Parameters();
    adlsGen2.setManagedIdentity("managedidentity");
    cloudStorageRequest.setAdlsGen2(adlsGen2);
    underTest.validateCloudStorage("AZURE", cloudStorageRequest);
}
Also used : SdxCloudStorageRequest(com.sequenceiq.sdx.api.model.SdxCloudStorageRequest) AdlsGen2CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters) Test(org.junit.jupiter.api.Test)

Example 20 with AdlsGen2CloudStorageV1Parameters

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

the class EnvironmentBackupStorageConfigurationValidatorTest method validateBackupStorageConfigAzureWhenConfigValidationSuccess.

@Test
public void validateBackupStorageConfigAzureWhenConfigValidationSuccess() {
    when(environment.getCloudPlatform()).thenReturn(CloudConstants.AZURE);
    when(environment.getBackup()).thenReturn(backup);
    AdlsGen2CloudStorageV1Parameters adlsGen2 = new AdlsGen2CloudStorageV1Parameters();
    adlsGen2.setManagedIdentity("/subscriptions/12345678-1234-0234-8234-123456789123/resourceGroups/test/" + "providers/Microsoft.ManagedIdentity/userAssignedIdentities/cdp-assumer");
    when(backup.getAdlsGen2()).thenReturn(adlsGen2);
    ValidationResult result = underTest.validateBackupStorageConfiguration(environment);
    assertFalse(result.hasError());
}
Also used : AdlsGen2CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters) ValidationResult(com.sequenceiq.cloudbreak.validation.ValidationResult) Test(org.junit.jupiter.api.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