Search in sources :

Example 6 with NodeStatusConfigView

use of com.sequenceiq.cloudbreak.telemetry.nodestatus.NodeStatusConfigView in project cloudbreak by hortonworks.

the class TelemetryDecorator method setupNodeStatusMonitor.

private void setupNodeStatusMonitor(Map<String, SaltPillarProperties> servicePillar, Stack stack) {
    char[] passwordInput = null;
    if (StringUtils.isNotBlank(stack.getCluster().getCdpNodeStatusMonitorPassword())) {
        passwordInput = stack.getCluster().getCdpNodeStatusMonitorPassword().toCharArray();
    }
    String accountId = Crn.safeFromString(stack.getResourceCrn()).getAccountId();
    boolean saltPingEnabled = entitlementService.nodestatusSaltPingEnabled(accountId);
    NodeStatusConfigView nodeStatusConfigView = nodeStatusConfigService.createNodeStatusConfig(stack.getCluster().getCdpNodeStatusMonitorUser(), passwordInput, saltPingEnabled);
    Map<String, Object> nodeStatusConfig = nodeStatusConfigView.toMap();
    servicePillar.put("nodestatus", new SaltPillarProperties("/nodestatus/init.sls", singletonMap("nodestatus", nodeStatusConfig)));
}
Also used : NodeStatusConfigView(com.sequenceiq.cloudbreak.telemetry.nodestatus.NodeStatusConfigView) SaltPillarProperties(com.sequenceiq.cloudbreak.orchestrator.model.SaltPillarProperties)

Aggregations

SaltPillarProperties (com.sequenceiq.cloudbreak.orchestrator.model.SaltPillarProperties)6 NodeStatusConfigView (com.sequenceiq.cloudbreak.telemetry.nodestatus.NodeStatusConfigView)6 TelemetryClusterDetails (com.sequenceiq.cloudbreak.telemetry.TelemetryClusterDetails)2 TelemetryCommonConfigView (com.sequenceiq.cloudbreak.telemetry.common.TelemetryCommonConfigView)2 DatabusConfigView (com.sequenceiq.cloudbreak.telemetry.databus.DatabusConfigView)2 MeteringConfigView (com.sequenceiq.cloudbreak.telemetry.metering.MeteringConfigView)2 MonitoringConfigView (com.sequenceiq.cloudbreak.telemetry.monitoring.MonitoringConfigView)2 Telemetry (com.sequenceiq.common.api.telemetry.model.Telemetry)2 HashMap (java.util.HashMap)2 Test (org.junit.Test)2 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)2