Search in sources :

Example 1 with ConfigurationEndpoint

use of com.sequenceiq.periscope.api.endpoint.v1.ConfigurationEndpoint in project cloudbreak by hortonworks.

the class AutoscalingUtil method configureAutoScaling.

static void configureAutoScaling(AutoscaleClient autoscaleClient, Long clusterId, int cooldown, int clusterMinsize, int clusterMaxSize) {
    ConfigurationEndpoint configurationEndpoint = autoscaleClient.configurationEndpoint();
    ScalingConfigurationRequest scalingConfigurationRequest = new ScalingConfigurationRequest();
    scalingConfigurationRequest.setCoolDown(cooldown);
    scalingConfigurationRequest.setMinSize(clusterMinsize);
    scalingConfigurationRequest.setMaxSize(clusterMaxSize);
    configurationEndpoint.setScalingConfiguration(clusterId, scalingConfigurationRequest);
    ScalingConfigurationRequest scalingConfigurationTest = configurationEndpoint.getScalingConfiguration(clusterId);
    Assert.assertEquals(cooldown, scalingConfigurationTest.getCoolDown());
    Assert.assertEquals(clusterMinsize, scalingConfigurationTest.getMinSize());
    Assert.assertEquals(clusterMaxSize, scalingConfigurationTest.getMaxSize());
}
Also used : ScalingConfigurationRequest(com.sequenceiq.periscope.api.model.ScalingConfigurationRequest) ConfigurationEndpoint(com.sequenceiq.periscope.api.endpoint.v1.ConfigurationEndpoint)

Aggregations

ConfigurationEndpoint (com.sequenceiq.periscope.api.endpoint.v1.ConfigurationEndpoint)1 ScalingConfigurationRequest (com.sequenceiq.periscope.api.model.ScalingConfigurationRequest)1