Search in sources :

Example 86 with Telemetry

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());
}
Also used : AdlsGen2CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) Test(org.junit.Test)

Example 87 with Telemetry

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());
}
Also used : Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) Test(org.junit.Test)

Example 88 with Telemetry

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());
}
Also used : Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) Test(org.junit.Test)

Example 89 with Telemetry

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));
}
Also used : Json(com.sequenceiq.cloudbreak.common.json.Json) IOException(java.io.IOException) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) DataBusCredential(com.sequenceiq.common.api.telemetry.model.DataBusCredential)

Example 90 with Telemetry

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"));
}
Also used : Logging(com.sequenceiq.common.api.telemetry.model.Logging) BaseDiagnosticsCollectionRequest(com.sequenceiq.common.api.diagnostics.BaseDiagnosticsCollectionRequest) BadRequestException(com.sequenceiq.cloudbreak.common.exception.BadRequestException) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) Test(org.junit.jupiter.api.Test)

Aggregations

Telemetry (com.sequenceiq.common.api.telemetry.model.Telemetry)109 Test (org.junit.Test)55 Test (org.junit.jupiter.api.Test)31 Logging (com.sequenceiq.common.api.telemetry.model.Logging)30 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)20 S3CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters)16 TelemetryRequest (com.sequenceiq.common.api.telemetry.request.TelemetryRequest)15 BaseDiagnosticsCollectionRequest (com.sequenceiq.common.api.diagnostics.BaseDiagnosticsCollectionRequest)13 AdlsGen2CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters)12 Backup (com.sequenceiq.freeipa.api.model.Backup)12 HashMap (java.util.HashMap)12 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)11 BadRequestException (com.sequenceiq.cloudbreak.common.exception.BadRequestException)10 Features (com.sequenceiq.common.api.telemetry.model.Features)10 Cluster (com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster)8 SaltPillarProperties (com.sequenceiq.cloudbreak.orchestrator.model.SaltPillarProperties)8 ApiClient (com.cloudera.api.swagger.client.ApiClient)7 GcsCloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters)7 WorkloadAnalytics (com.sequenceiq.common.api.telemetry.model.WorkloadAnalytics)6 TelemetryResponse (com.sequenceiq.common.api.telemetry.response.TelemetryResponse)6