Search in sources :

Example 26 with AdlsGen2CloudStorageV1Parameters

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

the class AdlsGen2FileSystemToAdlsGen2CloudStorageParametersConverter method convert.

public AdlsGen2CloudStorageV1Parameters convert(AdlsGen2FileSystem source) {
    AdlsGen2CloudStorageV1Parameters adlsGen2CloudStorageParameters = new AdlsGen2CloudStorageV1Parameters();
    adlsGen2CloudStorageParameters.setAccountName(source.getAccountName());
    adlsGen2CloudStorageParameters.setAccountKey(source.getAccountKey());
    adlsGen2CloudStorageParameters.setSecure(source.isSecure());
    adlsGen2CloudStorageParameters.setManagedIdentity(source.getManagedIdentity());
    return adlsGen2CloudStorageParameters;
}
Also used : AdlsGen2CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters)

Example 27 with AdlsGen2CloudStorageV1Parameters

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

the class FluentConfigServiceTest method testCreateFluentConfigWithFullAdlsGen2Path.

@Test
public void testCreateFluentConfigWithFullAdlsGen2Path() {
    // GIVEN
    Logging logging = new Logging();
    logging.setStorageLocation("abfs://mycontainer@myaccount.dfs.core.windows.net/my/custom/path");
    AdlsGen2CloudStorageV1Parameters parameters = new AdlsGen2CloudStorageV1Parameters();
    parameters.setAccountKey("myAccountKey");
    parameters.setAccountName("myAccount");
    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("myaccount", result.getAzureStorageAccount());
    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 28 with AdlsGen2CloudStorageV1Parameters

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

the class FluentConfigServiceTest method testCreateFluentConfigWithDoublePath.

@Test(expected = CloudbreakServiceException.class)
public void testCreateFluentConfigWithDoublePath() {
    // GIVEN
    Logging logging = new Logging();
    logging.setStorageLocation("abfs://mycontainer/my/custom/path@myaccount.dfs.core.windows.net/my/custom/path");
    AdlsGen2CloudStorageV1Parameters parameters = new AdlsGen2CloudStorageV1Parameters();
    parameters.setAccountKey("myAccountKey");
    logging.setAdlsGen2(parameters);
    Telemetry telemetry = new Telemetry();
    telemetry.setLogging(logging);
    // WHEN
    underTest.createFluentConfigs(DEFAULT_FLUENT_CLUSTER_DETAILS, false, false, REGION_SAMPLE, telemetry);
}
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 29 with AdlsGen2CloudStorageV1Parameters

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

the class CloudStorageFolderResolverServiceTest method testUpdateStorageLocationAdlsGen2WithPrefix.

@Test
public void testUpdateStorageLocationAdlsGen2WithPrefix() {
    // GIVEN
    Telemetry telemetry = createTelemetry();
    telemetry.getLogging().setS3(null);
    telemetry.getLogging().setAdlsGen2(new AdlsGen2CloudStorageV1Parameters());
    telemetry.getLogging().setStorageLocation("abfs://mycontainer/prefix");
    // 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/prefix/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 30 with AdlsGen2CloudStorageV1Parameters

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

the class CloudStorageFolderResolverServiceTest method testUpdateStorageLocationAdlsGen2WithoutScheme.

@Test
public void testUpdateStorageLocationAdlsGen2WithoutScheme() {
    // 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)

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