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