Search in sources :

Example 1 with TelemetryRequest

use of com.sequenceiq.common.api.telemetry.request.TelemetryRequest in project cloudbreak by hortonworks.

the class StackToStackV4RequestConverter method prepareTelemetryRequest.

private void prepareTelemetryRequest(Stack source, StackV4Request stackV4Request) {
    Telemetry telemetry = componentConfigProviderService.getTelemetry(source.getId());
    if (telemetry != null) {
        TelemetryRequest telemetryRequest = telemetryConverter.convertToRequest(telemetry);
        stackV4Request.setTelemetry(telemetryRequest);
    }
}
Also used : TelemetryRequest(com.sequenceiq.common.api.telemetry.request.TelemetryRequest) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry)

Example 2 with TelemetryRequest

use of com.sequenceiq.common.api.telemetry.request.TelemetryRequest in project cloudbreak by hortonworks.

the class TelemetryConverterTest method testConvertFromRequest.

@Test
public void testConvertFromRequest() {
    // GIVEN
    TelemetryRequest telemetryRequest = new TelemetryRequest();
    LoggingRequest logging = new LoggingRequest();
    logging.setS3(new S3CloudStorageV1Parameters());
    WorkloadAnalyticsRequest workloadAnalyticsRequest = new WorkloadAnalyticsRequest();
    FeaturesRequest featuresRequest = new FeaturesRequest();
    featuresRequest.addClusterLogsCollection(false);
    featuresRequest.addMonitoring(true);
    featuresRequest.addCloudStorageLogging(false);
    telemetryRequest.setLogging(logging);
    telemetryRequest.setFeatures(featuresRequest);
    telemetryRequest.setWorkloadAnalytics(workloadAnalyticsRequest);
    // WHEN
    Telemetry result = underTest.convert(telemetryRequest, StackType.WORKLOAD);
    // THEN
    assertNotNull(result.getFeatures().getWorkloadAnalytics());
    assertFalse(result.getFeatures().getClusterLogsCollection().isEnabled());
    assertFalse(result.getFeatures().getCloudStorageLogging().isEnabled());
    assertTrue(result.getFeatures().getMetering().isEnabled());
    assertTrue(result.getFeatures().getMonitoring().isEnabled());
    assertTrue(result.getFeatures().getWorkloadAnalytics().isEnabled());
    assertTrue(result.getFeatures().getUseSharedAltusCredential().isEnabled());
    assertEquals(DATABUS_ENDPOINT, result.getDatabusEndpoint());
    assertEquals(DATABUS_ENDPOINT, result.getWorkloadAnalytics().getDatabusEndpoint());
}
Also used : TelemetryRequest(com.sequenceiq.common.api.telemetry.request.TelemetryRequest) S3CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters) WorkloadAnalyticsRequest(com.sequenceiq.common.api.telemetry.request.WorkloadAnalyticsRequest) LoggingRequest(com.sequenceiq.common.api.telemetry.request.LoggingRequest) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) FeaturesRequest(com.sequenceiq.common.api.telemetry.request.FeaturesRequest) Test(org.junit.Test)

Example 3 with TelemetryRequest

use of com.sequenceiq.common.api.telemetry.request.TelemetryRequest in project cloudbreak by hortonworks.

the class TelemetryConverterTest method testConvertFromEnvAndSdxResponseWithoutInputs.

@Test
public void testConvertFromEnvAndSdxResponseWithoutInputs() {
    // GIVEN
    SdxClusterResponse sdxClusterResponse = null;
    // WHEN
    TelemetryRequest result = underTest.convert(null, sdxClusterResponse);
    // THEN
    assertNotNull(result.getWorkloadAnalytics());
    assertNotNull(result.getFeatures());
    assertTrue(result.getFeatures().getWorkloadAnalytics().isEnabled());
    assertNull(result.getLogging());
}
Also used : TelemetryRequest(com.sequenceiq.common.api.telemetry.request.TelemetryRequest) SdxClusterResponse(com.sequenceiq.sdx.api.model.SdxClusterResponse) Test(org.junit.Test)

Example 4 with TelemetryRequest

use of com.sequenceiq.common.api.telemetry.request.TelemetryRequest in project cloudbreak by hortonworks.

the class TelemetryConverterTest method testConvertFromRequestWithDefaultFeatures.

@Test
public void testConvertFromRequestWithDefaultFeatures() {
    // GIVEN
    TelemetryRequest telemetryRequest = new TelemetryRequest();
    // WHEN
    Telemetry result = underTest.convert(telemetryRequest, StackType.WORKLOAD);
    // THEN
    assertFalse(result.getFeatures().getClusterLogsCollection().isEnabled());
    assertTrue(result.getFeatures().getMetering().isEnabled());
    assertTrue(result.getFeatures().getCloudStorageLogging().isEnabled());
}
Also used : TelemetryRequest(com.sequenceiq.common.api.telemetry.request.TelemetryRequest) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) Test(org.junit.Test)

Example 5 with TelemetryRequest

use of com.sequenceiq.common.api.telemetry.request.TelemetryRequest in project cloudbreak by hortonworks.

the class TelemetryConverterTest method testConvertFromEnvAndSdxResponseWithoutWAInput.

@Test
public void testConvertFromEnvAndSdxResponseWithoutWAInput() {
    // GIVEN
    TelemetryResponse response = new TelemetryResponse();
    LoggingResponse loggingResponse = new LoggingResponse();
    S3CloudStorageV1Parameters s3Params = new S3CloudStorageV1Parameters();
    s3Params.setInstanceProfile(INSTANCE_PROFILE_VALUE);
    loggingResponse.setS3(s3Params);
    response.setLogging(loggingResponse);
    SdxClusterResponse sdxClusterResponse = new SdxClusterResponse();
    sdxClusterResponse.setCrn("crn:cdp:cloudbreak:us-west-1:someone:sdxcluster:sdxId");
    sdxClusterResponse.setName("sdxName");
    // WHEN
    TelemetryRequest result = underTest.convert(response, sdxClusterResponse);
    // THEN
    assertTrue(result.getFeatures().getWorkloadAnalytics().isEnabled());
    assertEquals(INSTANCE_PROFILE_VALUE, result.getLogging().getS3().getInstanceProfile());
    assertEquals("sdxId", result.getWorkloadAnalytics().getAttributes().get("databus.header.sdx.id").toString());
    assertEquals("sdxName", result.getWorkloadAnalytics().getAttributes().get("databus.header.sdx.name").toString());
}
Also used : TelemetryResponse(com.sequenceiq.common.api.telemetry.response.TelemetryResponse) TelemetryRequest(com.sequenceiq.common.api.telemetry.request.TelemetryRequest) S3CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters) LoggingResponse(com.sequenceiq.common.api.telemetry.response.LoggingResponse) SdxClusterResponse(com.sequenceiq.sdx.api.model.SdxClusterResponse) Test(org.junit.Test)

Aggregations

TelemetryRequest (com.sequenceiq.common.api.telemetry.request.TelemetryRequest)47 Test (org.junit.Test)19 Telemetry (com.sequenceiq.common.api.telemetry.model.Telemetry)15 Test (org.junit.jupiter.api.Test)15 FeaturesRequest (com.sequenceiq.common.api.telemetry.request.FeaturesRequest)13 Features (com.sequenceiq.common.api.telemetry.model.Features)10 EnvironmentTelemetry (com.sequenceiq.environment.environment.dto.telemetry.EnvironmentTelemetry)10 LoggingRequest (com.sequenceiq.common.api.telemetry.request.LoggingRequest)9 TelemetryResponse (com.sequenceiq.common.api.telemetry.response.TelemetryResponse)9 EnvironmentFeatures (com.sequenceiq.environment.environment.dto.telemetry.EnvironmentFeatures)9 S3CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters)7 FeaturesResponse (com.sequenceiq.common.api.telemetry.response.FeaturesResponse)6 SdxClusterResponse (com.sequenceiq.sdx.api.model.SdxClusterResponse)6 MonitoringRequest (com.sequenceiq.common.api.telemetry.request.MonitoringRequest)4 WorkloadAnalyticsRequest (com.sequenceiq.common.api.telemetry.request.WorkloadAnalyticsRequest)3 FeatureSetting (com.sequenceiq.common.api.type.FeatureSetting)3 AltusDatabusConfiguration (com.sequenceiq.cloudbreak.altus.AltusDatabusConfiguration)2 ObjectStorageValidateRequest (com.sequenceiq.cloudbreak.cloud.model.objectstorage.ObjectStorageValidateRequest)2 ObjectStorageValidateResponse (com.sequenceiq.cloudbreak.cloud.model.objectstorage.ObjectStorageValidateResponse)2 Json (com.sequenceiq.cloudbreak.common.json.Json)2