Search in sources :

Example 21 with S3CloudStorageV1Parameters

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

the class LoggingRequestValidatorTest method testValidateInvalidLocation.

@Test
public void testValidateInvalidLocation() {
    // GIVEN
    LoggingRequest loggingRequest = new LoggingRequest();
    loggingRequest.setS3(new S3CloudStorageV1Parameters());
    loggingRequest.setStorageLocation("?ds: da");
    // WHEN
    boolean result = underTest.isValid(loggingRequest, context);
    // THEN
    assertFalse(result);
}
Also used : S3CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters) LoggingRequest(com.sequenceiq.common.api.telemetry.request.LoggingRequest) Test(org.junit.jupiter.api.Test)

Example 22 with S3CloudStorageV1Parameters

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

the class LoggingRequestValidatorTest method testValidateValidBasePathWhenUsingS3a.

@Test
public void testValidateValidBasePathWhenUsingS3a() {
    // GIVEN
    LoggingRequest loggingRequest = new LoggingRequest();
    loggingRequest.setS3(new S3CloudStorageV1Parameters());
    loggingRequest.setStorageLocation("s3://basePath/custom");
    // WHEN
    boolean result = underTest.isValid(loggingRequest, context);
    // THEN
    assertTrue(result);
}
Also used : S3CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters) LoggingRequest(com.sequenceiq.common.api.telemetry.request.LoggingRequest) Test(org.junit.jupiter.api.Test)

Example 23 with S3CloudStorageV1Parameters

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

the class FluentConfigServiceTest method testCreateFluentConfigWithS3Path.

@Test
public void testCreateFluentConfigWithS3Path() {
    // GIVEN
    Logging logging = new Logging();
    logging.setStorageLocation("s3://mybucket/cluster-logs/datahub/cl1");
    logging.setS3(new S3CloudStorageV1Parameters());
    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("cluster-logs/datahub/cl1", result.getLogFolderName());
    assertEquals("mybucket", result.getS3LogArchiveBucketName());
}
Also used : Logging(com.sequenceiq.common.api.telemetry.model.Logging) S3CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) Test(org.junit.Test)

Example 24 with S3CloudStorageV1Parameters

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

the class FluentConfigServiceTest method testCreateFluentConfigWithCustomPath.

@Test
public void testCreateFluentConfigWithCustomPath() {
    // GIVEN
    Logging logging = new Logging();
    logging.setStorageLocation("mybucket/custom");
    logging.setS3(new S3CloudStorageV1Parameters());
    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("custom", result.getLogFolderName());
    assertEquals("mybucket", result.getS3LogArchiveBucketName());
}
Also used : Logging(com.sequenceiq.common.api.telemetry.model.Logging) S3CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) Test(org.junit.Test)

Example 25 with S3CloudStorageV1Parameters

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

the class FluentConfigServiceTest method testCreateFluentConfigWithS3APath.

@Test
public void testCreateFluentConfigWithS3APath() {
    // GIVEN
    Logging logging = new Logging();
    logging.setStorageLocation("s3a://mybucket/cluster-logs/datahub/cl1");
    logging.setS3(new S3CloudStorageV1Parameters());
    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("cluster-logs/datahub/cl1", result.getLogFolderName());
    assertEquals("mybucket", result.getS3LogArchiveBucketName());
}
Also used : Logging(com.sequenceiq.common.api.telemetry.model.Logging) S3CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) Test(org.junit.Test)

Aggregations

S3CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters)59 Test (org.junit.jupiter.api.Test)27 Telemetry (com.sequenceiq.common.api.telemetry.model.Telemetry)16 Logging (com.sequenceiq.common.api.telemetry.model.Logging)15 LoggingRequest (com.sequenceiq.common.api.telemetry.request.LoggingRequest)12 Test (org.junit.Test)12 GcsCloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters)10 SdxCloudStorageRequest (com.sequenceiq.sdx.api.model.SdxCloudStorageRequest)10 StorageIdentityBase (com.sequenceiq.common.api.cloudstorage.StorageIdentityBase)8 TelemetryResponse (com.sequenceiq.common.api.telemetry.response.TelemetryResponse)8 AdlsGen2CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters)7 TelemetryRequest (com.sequenceiq.common.api.telemetry.request.TelemetryRequest)7 LoggingResponse (com.sequenceiq.common.api.telemetry.response.LoggingResponse)7 Backup (com.sequenceiq.freeipa.api.model.Backup)7 CloudStorageRequest (com.sequenceiq.common.api.cloudstorage.CloudStorageRequest)5 StorageLocationBase (com.sequenceiq.common.api.cloudstorage.StorageLocationBase)5 DetailedEnvironmentResponse (com.sequenceiq.environment.api.v1.environment.model.response.DetailedEnvironmentResponse)5 ClusterV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request)4 Features (com.sequenceiq.common.api.telemetry.model.Features)4 SdxClusterRequest (com.sequenceiq.sdx.api.model.SdxClusterRequest)4