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));
}
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;
}
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;
}
Aggregations