use of com.sequenceiq.common.api.telemetry.response.FeaturesResponse in project cloudbreak by hortonworks.
the class TelemetryConverter method createFeaturesResponseFromSource.
private void createFeaturesResponseFromSource(TelemetryResponse response, Features features) {
if (features != null) {
LOGGER.debug("Setting feature telemetry response.");
FeaturesResponse featuresResponse = new FeaturesResponse();
featuresResponse.setWorkloadAnalytics(features.getWorkloadAnalytics());
featuresResponse.setClusterLogsCollection(features.getClusterLogsCollection());
featuresResponse.setMonitoring(features.getMonitoring());
featuresResponse.setMetering(features.getMetering());
featuresResponse.setUseSharedAltusCredential(features.getUseSharedAltusCredential());
setCloudStorageLoggingOnFeaturesModel(features, featuresResponse);
response.setFeatures(featuresResponse);
}
}
use of com.sequenceiq.common.api.telemetry.response.FeaturesResponse in project cloudbreak by hortonworks.
the class DiagnosticsCollectionValidatorTest method testWithValidEngDestination.
@Test
void testWithValidEngDestination() {
BaseDiagnosticsCollectionRequest request = new BaseDiagnosticsCollectionRequest();
request.setDestination(DiagnosticsDestination.ENG);
StackV4Response stackV4Response = new StackV4Response();
stackV4Response.setCrn(DATALAKE_CRN);
TelemetryResponse telemetry = new TelemetryResponse();
FeaturesResponse features = new FeaturesResponse();
FeatureSetting featureSetting = new FeatureSetting();
featureSetting.setEnabled(true);
features.setClusterLogsCollection(featureSetting);
telemetry.setFeatures(features);
stackV4Response.setTelemetry(telemetry);
underTest.validate(request, stackV4Response);
}
use of com.sequenceiq.common.api.telemetry.response.FeaturesResponse in project cloudbreak by hortonworks.
the class TelemetryConverter method createFeaturesResponseFromSource.
private FeaturesResponse createFeaturesResponseFromSource(Features features) {
FeaturesResponse featuresResponse = null;
if (features != null) {
featuresResponse = new FeaturesResponse();
featuresResponse.setClusterLogsCollection(features.getClusterLogsCollection());
featuresResponse.setUseSharedAltusCredential(features.getUseSharedAltusCredential());
if (features.getCloudStorageLogging() != null) {
featuresResponse.setCloudStorageLogging(features.getCloudStorageLogging());
} else {
featuresResponse.addCloudStorageLogging(true);
}
if (features.getMonitoring() != null) {
featuresResponse.setMonitoring(features.getMonitoring());
} else {
featuresResponse.addMonitoring(true);
}
}
return featuresResponse;
}
use of com.sequenceiq.common.api.telemetry.response.FeaturesResponse in project cloudbreak by hortonworks.
the class TelemetryConverterTest method testConvertFromEnvAndSdxResponseWithClusterLogsCollectionEnabled.
@Test
public void testConvertFromEnvAndSdxResponseWithClusterLogsCollectionEnabled() {
// GIVEN
TelemetryResponse response = new TelemetryResponse();
FeaturesResponse featuresResponse = new FeaturesResponse();
featuresResponse.addClusterLogsCollection(true);
response.setFeatures(featuresResponse);
// WHEN
TelemetryRequest result = underTest.convert(response, null);
// THEN
assertTrue(result.getFeatures().getClusterLogsCollection().isEnabled());
}
use of com.sequenceiq.common.api.telemetry.response.FeaturesResponse in project cloudbreak by hortonworks.
the class TelemetryConverterTest method testConvertFromEnvAndSdxResponseWithClusterLogsCollectionDisabled.
@Test
public void testConvertFromEnvAndSdxResponseWithClusterLogsCollectionDisabled() {
// GIVEN
TelemetryResponse response = new TelemetryResponse();
FeaturesResponse featuresResponse = new FeaturesResponse();
featuresResponse.addClusterLogsCollection(false);
response.setFeatures(featuresResponse);
// WHEN
TelemetryRequest result = underTest.convert(response, null);
// THEN
assertFalse(result.getFeatures().getClusterLogsCollection().isEnabled());
}
Aggregations