Search in sources :

Example 6 with ScalingPolicy

use of com.sequenceiq.periscope.domain.ScalingPolicy in project cloudbreak by hortonworks.

the class ScalingPolicyResponseConverter method convert.

@Override
public ScalingPolicy convert(ScalingPolicyResponse source) {
    ScalingPolicy policy = new ScalingPolicy();
    policy.setAdjustmentType(source.getAdjustmentType());
    policy.setName(source.getName());
    policy.setScalingAdjustment(source.getScalingAdjustment());
    policy.setHostGroup(source.getHostGroup());
    return policy;
}
Also used : ScalingPolicy(com.sequenceiq.periscope.domain.ScalingPolicy)

Example 7 with ScalingPolicy

use of com.sequenceiq.periscope.domain.ScalingPolicy in project cloudbreak by hortonworks.

the class ScalingService method getScalingPolicy.

private ScalingPolicy getScalingPolicy(Long clusterId, Long policyId) {
    ScalingPolicy policy = policyRepository.findByCluster(clusterId, policyId);
    if (policy == null) {
        throw new NotFoundException("Scaling policy not found");
    }
    alertService.getBaseAlert(clusterId, policy.getAlertId());
    return policy;
}
Also used : ScalingPolicy(com.sequenceiq.periscope.domain.ScalingPolicy)

Aggregations

ScalingPolicy (com.sequenceiq.periscope.domain.ScalingPolicy)7 BaseAlert (com.sequenceiq.periscope.domain.BaseAlert)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 AlertOperator (com.sequenceiq.periscope.api.model.AlertOperator)1 PrometheusAlert (com.sequenceiq.periscope.domain.PrometheusAlert)1 ConversionFailedException (org.springframework.core.convert.ConversionFailedException)1