Search in sources :

Example 46 with Telemetry

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

Example 47 with Telemetry

use of com.sequenceiq.common.api.telemetry.model.Telemetry in project cloudbreak by hortonworks.

the class CloudStorageFolderResolverServiceTest method testUpdateStorageLocationAdlsGen2.

@Test
public void testUpdateStorageLocationAdlsGen2() {
    // 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 48 with Telemetry

use of com.sequenceiq.common.api.telemetry.model.Telemetry in project cloudbreak by hortonworks.

the class CloudStorageFolderResolverServiceTest method testUpdateStorageLocationWithoutTelemetry.

@Test
public void testUpdateStorageLocationWithoutTelemetry() {
    // GIVEN
    Telemetry telemetry = null;
    // WHEN
    underTest.updateStorageLocation(telemetry, null, null, null);
    // THEN
    assertNull(telemetry);
}
Also used : Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) Test(org.junit.Test)

Example 49 with Telemetry

use of com.sequenceiq.common.api.telemetry.model.Telemetry in project cloudbreak by hortonworks.

the class CloudStorageFolderResolverServiceTest method testUpdateStorageLocationWithInvalidCrn.

@Test(expected = CrnParseException.class)
public void testUpdateStorageLocationWithInvalidCrn() {
    // GIVEN
    Telemetry telemetry = createTelemetry();
    // WHEN
    underTest.updateStorageLocation(telemetry, FluentClusterType.DATAHUB.value(), "mycluster", "crn:cdp:cloudbreak:us-west:someone:stack:12345");
}
Also used : Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) Test(org.junit.Test)

Example 50 with Telemetry

use of com.sequenceiq.common.api.telemetry.model.Telemetry in project cloudbreak by hortonworks.

the class ClouderaManagerMgmtTelemetryServiceTest method testUpdateServiceMonitorConfigs.

@Test
public void testUpdateServiceMonitorConfigs() throws ApiException {
    // GIVEN
    Stack stack = new Stack();
    stack.setStackVersion("7.2.16");
    stack.setResourceCrn("crn:cdp:datahub:us-west-1:accountId:cluster:name");
    Cluster cluster = new Cluster();
    cluster.setCloudbreakClusterManagerMonitoringUser("admin");
    cluster.setCloudbreakClusterManagerMonitoringPassword("admin123");
    stack.setCluster(cluster);
    Telemetry telemetry = new Telemetry();
    Features features = new Features();
    features.addMonitoring(true);
    telemetry.setFeatures(features);
    given(monitoringConfiguration.isEnabled()).willReturn(true);
    given(monitoringConfiguration.getClouderaManagerExporter()).willReturn(cmMonitoringConfiguration);
    given(monitoringConfiguration.isPaasSupport()).willReturn(true);
    given(cmMonitoringConfiguration.getPort()).willReturn(EXPORTER_PORT);
    given(clouderaManagerApiFactory.getMgmtRoleConfigGroupsResourceApi(apiClient)).willReturn(mgmtRoleConfigGroupsResourceApi);
    // WHEN
    underTest.updateServiceMonitorConfigs(stack, apiClient, telemetry);
    // THEN
    verify(mgmtRoleConfigGroupsResourceApi, times(1)).updateConfig(any(), anyString(), any());
}
Also used : Cluster(com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster) Features(com.sequenceiq.common.api.telemetry.model.Features) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) Stack(com.sequenceiq.cloudbreak.domain.stack.Stack) Test(org.junit.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