Search in sources :

Example 11 with Features

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

the class FluentConfigServiceTest method setMetering.

private void setMetering(Telemetry telemetry) {
    Features features = new Features();
    features.addMetering(true);
    telemetry.setFeatures(features);
}
Also used : Features(com.sequenceiq.common.api.telemetry.model.Features)

Example 12 with Features

use of com.sequenceiq.common.api.telemetry.model.Features 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)

Example 13 with Features

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

the class AltusMachineUserServiceTest method setUp.

@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    stack = new Stack();
    User creator = new User();
    creator.setUserCrn(TEST_CRN);
    stack.setCreator(creator);
    stack.setType(StackType.WORKLOAD);
    stack.setResourceCrn(TEST_CRN);
    Cluster cluster = new Cluster();
    cluster.setId(1L);
    stack.setCluster(cluster);
    telemetry = new Telemetry();
    Features features = new Features();
    features.addClusterLogsCollection(true);
    telemetry.setFeatures(features);
    underTest = new AltusMachineUserService(altusIAMService, stackService, clusterService, componentConfigProviderService, regionAwareInternalCrnGeneratorFactory);
}
Also used : User(com.sequenceiq.cloudbreak.workspace.model.User) 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) Before(org.junit.Before)

Example 14 with Features

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

the class TelemetryApiConverterTest method testConvertWithDefaultFeatures.

@Test
public void testConvertWithDefaultFeatures() {
    // GIVEN
    TelemetryRequest telemetryRequest = new TelemetryRequest();
    FeaturesRequest fr = new FeaturesRequest();
    telemetryRequest.setFeatures(fr);
    // WHEN
    EnvironmentTelemetry result = underTest.convert(telemetryRequest, new Features(), ACCOUNT_ID);
    // THEN
    assertNull(result.getFeatures().getWorkloadAnalytics());
}
Also used : TelemetryRequest(com.sequenceiq.common.api.telemetry.request.TelemetryRequest) EnvironmentTelemetry(com.sequenceiq.environment.environment.dto.telemetry.EnvironmentTelemetry) Features(com.sequenceiq.common.api.telemetry.model.Features) EnvironmentFeatures(com.sequenceiq.environment.environment.dto.telemetry.EnvironmentFeatures) FeaturesRequest(com.sequenceiq.common.api.telemetry.request.FeaturesRequest) Test(org.junit.jupiter.api.Test)

Example 15 with Features

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

the class TelemetryApiConverterTest method testConvert.

@Test
public void testConvert() {
    // GIVEN
    TelemetryRequest telemetryRequest = new TelemetryRequest();
    LoggingRequest loggingRequest = new LoggingRequest();
    S3CloudStorageV1Parameters s3Params = new S3CloudStorageV1Parameters();
    s3Params.setInstanceProfile(INSTANCE_PROFILE_VALUE);
    loggingRequest.setS3(s3Params);
    telemetryRequest.setLogging(loggingRequest);
    telemetryRequest.setWorkloadAnalytics(new WorkloadAnalyticsRequest());
    FeaturesRequest fr = new FeaturesRequest();
    fr.addClusterLogsCollection(true);
    fr.addWorkloadAnalytics(true);
    fr.addMonitoring(true);
    telemetryRequest.setFeatures(fr);
    given(entitlementService.isCdpSaasEnabled(anyString())).willReturn(true);
    // WHEN
    EnvironmentTelemetry result = underTest.convert(telemetryRequest, new Features(), ACCOUNT_ID);
    // THEN
    assertEquals(INSTANCE_PROFILE_VALUE, result.getLogging().getS3().getInstanceProfile());
    assertEquals("http://myaddress/api/v1/receive", result.getMonitoring().getRemoteWriteUrl());
    assertTrue(result.getFeatures().getClusterLogsCollection().isEnabled());
    assertTrue(result.getFeatures().getWorkloadAnalytics().isEnabled());
    assertTrue(result.getFeatures().getUseSharedAltusCredential().isEnabled());
    assertTrue(result.getFeatures().getMonitoring().isEnabled());
    assertTrue(result.getFeatures().getCloudStorageLogging().isEnabled());
}
Also used : TelemetryRequest(com.sequenceiq.common.api.telemetry.request.TelemetryRequest) EnvironmentTelemetry(com.sequenceiq.environment.environment.dto.telemetry.EnvironmentTelemetry) S3CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters) Features(com.sequenceiq.common.api.telemetry.model.Features) EnvironmentFeatures(com.sequenceiq.environment.environment.dto.telemetry.EnvironmentFeatures) WorkloadAnalyticsRequest(com.sequenceiq.common.api.telemetry.request.WorkloadAnalyticsRequest) LoggingRequest(com.sequenceiq.common.api.telemetry.request.LoggingRequest) FeaturesRequest(com.sequenceiq.common.api.telemetry.request.FeaturesRequest) Test(org.junit.jupiter.api.Test)

Aggregations

Features (com.sequenceiq.common.api.telemetry.model.Features)33 Test (org.junit.jupiter.api.Test)19 EnvironmentTelemetry (com.sequenceiq.environment.environment.dto.telemetry.EnvironmentTelemetry)16 Telemetry (com.sequenceiq.common.api.telemetry.model.Telemetry)10 TelemetryRequest (com.sequenceiq.common.api.telemetry.request.TelemetryRequest)10 AccountTelemetry (com.sequenceiq.environment.telemetry.domain.AccountTelemetry)10 ExperimentalFeatures (com.sequenceiq.environment.environment.domain.ExperimentalFeatures)8 EnvironmentFeatures (com.sequenceiq.environment.environment.dto.telemetry.EnvironmentFeatures)8 NetworkDto (com.sequenceiq.environment.network.dto.NetworkDto)8 FeaturesRequest (com.sequenceiq.common.api.telemetry.request.FeaturesRequest)7 EnvironmentRequest (com.sequenceiq.environment.api.v1.environment.model.request.EnvironmentRequest)7 EnvironmentCreationDto (com.sequenceiq.environment.environment.dto.EnvironmentCreationDto)7 FreeIpaCreationDto (com.sequenceiq.environment.environment.dto.FreeIpaCreationDto)7 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)7 S3CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters)4 Logging (com.sequenceiq.common.api.telemetry.model.Logging)4 FeatureSetting (com.sequenceiq.common.api.type.FeatureSetting)4 EnvironmentBackup (com.sequenceiq.environment.environment.dto.EnvironmentBackup)4 BaseDiagnosticsCollectionRequest (com.sequenceiq.common.api.diagnostics.BaseDiagnosticsCollectionRequest)3 WorkloadAnalytics (com.sequenceiq.common.api.telemetry.model.WorkloadAnalytics)3