use of com.sequenceiq.common.api.telemetry.model.Logging 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());
}
use of com.sequenceiq.common.api.telemetry.model.Logging in project cloudbreak by hortonworks.
the class FluentConfigServiceTest method testCreateFluentConfigWithoutGcsProjectId.
@Test(expected = CloudbreakServiceException.class)
public void testCreateFluentConfigWithoutGcsProjectId() {
// GIVEN
Logging logging = new Logging();
logging.setStorageLocation("gs://mybucket/mypath");
logging.setGcs(new GcsCloudStorageV1Parameters());
Telemetry telemetry = new Telemetry();
telemetry.setLogging(logging);
// WHEN
underTest.createFluentConfigs(DEFAULT_FLUENT_CLUSTER_DETAILS, false, false, REGION_SAMPLE, telemetry);
}
use of com.sequenceiq.common.api.telemetry.model.Logging 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());
}
use of com.sequenceiq.common.api.telemetry.model.Logging 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());
}
use of com.sequenceiq.common.api.telemetry.model.Logging 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());
}
Aggregations