use of com.sequenceiq.common.api.telemetry.model.Logging in project cloudbreak by hortonworks.
the class TelemetryConverter method createLoggingRequestFromSource.
private LoggingRequest createLoggingRequestFromSource(Telemetry telemetry) {
LoggingRequest loggingRequest = null;
Logging logging = telemetry.getLogging();
if (logging != null) {
loggingRequest = new LoggingRequest();
loggingRequest.setS3(logging.getS3());
loggingRequest.setAdlsGen2(logging.getAdlsGen2());
loggingRequest.setGcs(logging.getGcs());
loggingRequest.setCloudwatch(CloudwatchParams.copy(logging.getCloudwatch()));
loggingRequest.setStorageLocation(logging.getStorageLocation());
}
return loggingRequest;
}
use of com.sequenceiq.common.api.telemetry.model.Logging in project cloudbreak by hortonworks.
the class TelemetryConverter method createLoggingFromRequest.
private Logging createLoggingFromRequest(TelemetryRequest request) {
Logging logging = null;
if (request.getLogging() != null) {
LOGGER.debug("Create loggging telemetry settings from logging request.");
LoggingRequest loggingRequest = request.getLogging();
logging = new Logging();
logging.setStorageLocation(loggingRequest.getStorageLocation());
logging.setS3(loggingRequest.getS3());
logging.setAdlsGen2(loggingRequest.getAdlsGen2());
logging.setGcs(loggingRequest.getGcs());
logging.setCloudwatch(CloudwatchParams.copy(loggingRequest.getCloudwatch()));
}
return logging;
}
use of com.sequenceiq.common.api.telemetry.model.Logging in project cloudbreak by hortonworks.
the class DiagnosticsCollectionValidatorTest method testValidateWithCloudStorageWithEmptyTelemetryLoggingSetting.
@Test
void testValidateWithCloudStorageWithEmptyTelemetryLoggingSetting() {
BaseDiagnosticsCollectionRequest request = new BaseDiagnosticsCollectionRequest();
request.setDestination(DiagnosticsDestination.CLOUD_STORAGE);
Telemetry telemetry = new Telemetry();
telemetry.setLogging(new Logging());
BadRequestException thrown = assertThrows(BadRequestException.class, () -> underTest.validate(request, createStack(), telemetry));
assertTrue(thrown.getMessage().contains("S3, ABFS or GCS cloud storage logging setting should be enabled for Data Hub"));
}
use of com.sequenceiq.common.api.telemetry.model.Logging in project cloudbreak by hortonworks.
the class FluentConfigServiceTest method testCreateFluentConfig.
@Test
public void testCreateFluentConfig() {
// GIVEN
Logging logging = new Logging();
logging.setStorageLocation("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());
assertEquals(Crn.Region.EU_1.getName(), result.toMap().get("environmentRegion"));
}
use of com.sequenceiq.common.api.telemetry.model.Logging 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());
}
Aggregations