use of com.sequenceiq.common.api.telemetry.model.Telemetry 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());
}
use of com.sequenceiq.common.api.telemetry.model.Telemetry in project cloudbreak by hortonworks.
the class CloudStorageFolderResolverServiceTest method testUpdateStorageLocationS3WithPrefix.
@Test
public void testUpdateStorageLocationS3WithPrefix() {
// GIVEN
Telemetry telemetry = createTelemetry();
telemetry.getLogging().setStorageLocation("s3://mybucket/prefix");
// WHEN
underTest.updateStorageLocation(telemetry, FluentClusterType.DATAHUB.value(), "mycluster", "crn:cdp:cloudbreak:us-west-1:someone:stack:12345");
// THEN
assertEquals("s3://mybucket/prefix/cluster-logs/datahub/mycluster_12345", telemetry.getLogging().getStorageLocation());
}
use of com.sequenceiq.common.api.telemetry.model.Telemetry in project cloudbreak by hortonworks.
the class CloudStorageFolderResolverServiceTest method testUpdateStorageLocationWithoutScheme.
@Test
public void testUpdateStorageLocationWithoutScheme() {
// GIVEN
Telemetry telemetry = createTelemetry();
telemetry.getLogging().setStorageLocation("mybucket");
// WHEN
underTest.updateStorageLocation(telemetry, FluentClusterType.DATAHUB.value(), "mycluster", "crn:cdp:cloudbreak:us-west-1:someone:stack:12345");
// THEN
assertEquals("s3://mybucket/cluster-logs/datahub/mycluster_12345", telemetry.getLogging().getStorageLocation());
}
use of com.sequenceiq.common.api.telemetry.model.Telemetry in project cloudbreak by hortonworks.
the class ClusterHostServiceRunner method addClouderaManagerConfig.
private void addClouderaManagerConfig(Stack stack, Cluster cluster, Map<String, SaltPillarProperties> servicePillar, ClouderaManagerRepo clouderaManagerRepo, GatewayConfig primaryGatewayConfig) throws CloudbreakOrchestratorFailedException {
Telemetry telemetry = componentConfigProviderService.getTelemetry(stack.getId());
DataBusCredential dataBusCredential = null;
if (StringUtils.isNotBlank(cluster.getDatabusCredential())) {
try {
dataBusCredential = new Json(cluster.getDatabusCredential()).get(DataBusCredential.class);
} catch (IOException e) {
LOGGER.error("Cannot read DataBus secrets from cluster entity. Continue without databus secrets", e);
}
}
telemetryDecorator.decoratePillar(servicePillar, stack, telemetry, dataBusCredential);
decoratePillarWithTags(stack, servicePillar);
decorateWithClouderaManagerEntrerpriseDetails(telemetry, servicePillar);
Optional<String> licenseOpt = decoratePillarWithClouderaManagerLicense(stack.getId(), servicePillar);
decoratePillarWithClouderaManagerRepo(clouderaManagerRepo, servicePillar, licenseOpt);
decoratePillarWithClouderaManagerDatabase(cluster, servicePillar);
decoratePillarWithClouderaManagerCommunicationSettings(stack, cluster, servicePillar);
decoratePillarWithClouderaManagerAutoTls(cluster, servicePillar);
csdParcelDecorator.decoratePillarWithCsdParcels(stack, servicePillar);
servicePillar.putAll(createPillarWithClouderaManagerSettings(clouderaManagerRepo, stack, primaryGatewayConfig));
}
use of com.sequenceiq.common.api.telemetry.model.Telemetry in project cloudbreak by hortonworks.
the class DiiagnosticsCollectionValidatorTest 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, createStackWithTelemetry(telemetry)));
assertTrue(thrown.getMessage().contains("S3, ABFS or GCS cloud storage logging setting should be enabled for FreeIPA"));
}
Aggregations