Search in sources :

Example 16 with FeaturesRequest

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

the class TelemetryConverterTest method testConvertFromRequestForGCS.

@Test
public void testConvertFromRequestForGCS() {
    // GIVEN
    TelemetryRequest telemetryRequest = new TelemetryRequest();
    LoggingRequest logging = new LoggingRequest();
    GcsCloudStorageV1Parameters gcsCloudStorageV1Parameters = new GcsCloudStorageV1Parameters();
    gcsCloudStorageV1Parameters.setServiceAccountEmail(EMAIL);
    logging.setGcs(gcsCloudStorageV1Parameters);
    FeaturesRequest featuresRequest = new FeaturesRequest();
    featuresRequest.addClusterLogsCollection(false);
    telemetryRequest.setLogging(logging);
    telemetryRequest.setFeatures(featuresRequest);
    // WHEN
    Telemetry result = underTest.convert(telemetryRequest);
    // THEN
    assertThat(result.getFeatures().getWorkloadAnalytics(), nullValue());
    assertThat(result.getFeatures().getClusterLogsCollection().isEnabled(), is(false));
    assertThat(result.getDatabusEndpoint(), is(DATABUS_ENDPOINT));
    assertThat(result.getLogging().getGcs(), notNullValue());
    assertThat(result.getLogging().getGcs().getServiceAccountEmail(), is(EMAIL));
}
Also used : TelemetryRequest(com.sequenceiq.common.api.telemetry.request.TelemetryRequest) LoggingRequest(com.sequenceiq.common.api.telemetry.request.LoggingRequest) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) GcsCloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters) FeaturesRequest(com.sequenceiq.common.api.telemetry.request.FeaturesRequest) Test(org.junit.jupiter.api.Test)

Example 17 with FeaturesRequest

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

the class TelemetryTestDto method withReportClusterLogs.

public TelemetryTestDto withReportClusterLogs() {
    FeaturesRequest featuresRequest = new FeaturesRequest();
    featuresRequest.addClusterLogsCollection(true);
    getRequest().setFeatures(featuresRequest);
    Map<String, Object> fluentAttributes = new HashMap<>();
    fluentAttributes.put("dbusIncludeSaltLogs", true);
    fluentAttributes.put("dbusClusterLogsCollectionDisableStop", true);
    getRequest().setFluentAttributes(fluentAttributes);
    return this;
}
Also used : HashMap(java.util.HashMap) FeaturesRequest(com.sequenceiq.common.api.telemetry.request.FeaturesRequest)

Example 18 with FeaturesRequest

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

the class StackToCreateFreeIpaRequestConverter method getFeaturesRequest.

private FeaturesRequest getFeaturesRequest(Features features) {
    FeaturesRequest request = null;
    if (features != null) {
        request = new FeaturesRequest();
        request.setClusterLogsCollection(features.getClusterLogsCollection());
        request.setMonitoring(features.getMonitoring());
        request.setCloudStorageLogging(features.getCloudStorageLogging());
        request.setWorkloadAnalytics(features.getWorkloadAnalytics());
    }
    LOGGER.debug("Created features request {} from features {}", request, features);
    return request;
}
Also used : FeaturesRequest(com.sequenceiq.common.api.telemetry.request.FeaturesRequest)

Aggregations

FeaturesRequest (com.sequenceiq.common.api.telemetry.request.FeaturesRequest)18 TelemetryRequest (com.sequenceiq.common.api.telemetry.request.TelemetryRequest)13 Test (org.junit.jupiter.api.Test)8 Features (com.sequenceiq.common.api.telemetry.model.Features)7 LoggingRequest (com.sequenceiq.common.api.telemetry.request.LoggingRequest)7 EnvironmentFeatures (com.sequenceiq.environment.environment.dto.telemetry.EnvironmentFeatures)6 EnvironmentTelemetry (com.sequenceiq.environment.environment.dto.telemetry.EnvironmentTelemetry)6 Telemetry (com.sequenceiq.common.api.telemetry.model.Telemetry)4 MonitoringRequest (com.sequenceiq.common.api.telemetry.request.MonitoringRequest)4 S3CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters)3 WorkloadAnalyticsRequest (com.sequenceiq.common.api.telemetry.request.WorkloadAnalyticsRequest)3 Test (org.junit.Test)2 GcsCloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters)1 FeaturesResponse (com.sequenceiq.common.api.telemetry.response.FeaturesResponse)1 LoggingResponse (com.sequenceiq.common.api.telemetry.response.LoggingResponse)1 MonitoringResponse (com.sequenceiq.common.api.telemetry.response.MonitoringResponse)1 TelemetryResponse (com.sequenceiq.common.api.telemetry.response.TelemetryResponse)1 FeatureSetting (com.sequenceiq.common.api.type.FeatureSetting)1 HashMap (java.util.HashMap)1