Search in sources :

Example 36 with S3CloudStorageV1Parameters

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

the class LoggingRequestValidatorTest method testValidateValidBucket.

@Test
public void testValidateValidBucket() {
    // GIVEN
    LoggingRequest loggingRequest = new LoggingRequest();
    loggingRequest.setS3(new S3CloudStorageV1Parameters());
    loggingRequest.setStorageLocation("mybucket");
    // 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 37 with S3CloudStorageV1Parameters

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

the class LoggingRequestValidatorTest method testValidateValidBasePathWhenUsingS3N.

@Test
public void testValidateValidBasePathWhenUsingS3N() {
    // GIVEN
    LoggingRequest loggingRequest = new LoggingRequest();
    loggingRequest.setS3(new S3CloudStorageV1Parameters());
    loggingRequest.setStorageLocation("s3n://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 38 with S3CloudStorageV1Parameters

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

the class LoggingRequestValidatorTest method testValidateValidBucketUri.

@Test
public void testValidateValidBucketUri() {
    // GIVEN
    LoggingRequest loggingRequest = new LoggingRequest();
    loggingRequest.setS3(new S3CloudStorageV1Parameters());
    loggingRequest.setStorageLocation("s3://mybucket/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 39 with S3CloudStorageV1Parameters

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

the class TelemetryConverterTest method testConvertToResponseWithEnabledClusterLogsCollectionFeatures.

@Test
public void testConvertToResponseWithEnabledClusterLogsCollectionFeatures() {
    // GIVEN
    Logging logging = new Logging();
    S3CloudStorageV1Parameters s3Params = new S3CloudStorageV1Parameters();
    s3Params.setInstanceProfile(INSTANCE_PROFILE_VALUE);
    logging.setS3(s3Params);
    Telemetry telemetry = new Telemetry();
    telemetry.setLogging(logging);
    Features features = new Features();
    features.setWorkloadAnalytics(null);
    features.addClusterLogsCollection(true);
    telemetry.setFeatures(features);
    // WHEN
    TelemetryResponse result = underTest.convert(telemetry);
    // THEN
    assertEquals(INSTANCE_PROFILE_VALUE, result.getLogging().getS3().getInstanceProfile());
    assertTrue(result.getFeatures().getClusterLogsCollection().isEnabled());
    assertNull(result.getFeatures().getWorkloadAnalytics());
    assertNull(result.getFeatures().getMetering());
}
Also used : Logging(com.sequenceiq.common.api.telemetry.model.Logging) TelemetryResponse(com.sequenceiq.common.api.telemetry.response.TelemetryResponse) S3CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters) Features(com.sequenceiq.common.api.telemetry.model.Features) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) Test(org.junit.Test)

Example 40 with S3CloudStorageV1Parameters

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

the class TelemetryConverterTest method testConvertToResponse.

@Test
public void testConvertToResponse() {
    // GIVEN
    Logging logging = new Logging();
    S3CloudStorageV1Parameters s3Params = new S3CloudStorageV1Parameters();
    s3Params.setInstanceProfile(INSTANCE_PROFILE_VALUE);
    logging.setS3(s3Params);
    Telemetry telemetry = new Telemetry();
    telemetry.setLogging(logging);
    // WHEN
    TelemetryResponse result = underTest.convert(telemetry);
    // THEN
    assertEquals(INSTANCE_PROFILE_VALUE, result.getLogging().getS3().getInstanceProfile());
}
Also used : Logging(com.sequenceiq.common.api.telemetry.model.Logging) TelemetryResponse(com.sequenceiq.common.api.telemetry.response.TelemetryResponse) 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