use of com.sequenceiq.periscope.api.model.DistroXAutoscaleClusterRequest in project cloudbreak by hortonworks.
the class DistroXAutoScaleClusterV1EndpointTest method testEnableStopStartScalingViaConfigUpdateWithPreExistingTimeAlerts.
@Test(expected = BadRequestException.class)
public void testEnableStopStartScalingViaConfigUpdateWithPreExistingTimeAlerts() {
DistroXAutoscaleClusterRequest distroXAutoscaleClusterRequest = new DistroXAutoscaleClusterRequest();
distroXAutoscaleClusterRequest.setEnableAutoscaling(true);
List<TimeAlertRequest> timeAlertRequests = getTimeAlertRequests(2, List.of("compute", "compute"));
distroXAutoscaleClusterRequest.setTimeAlertRequests(timeAlertRequests);
distroXAutoScaleClusterV1Endpoint.updateAutoscaleConfigByClusterCrn(TEST_CLUSTER_CRN, distroXAutoscaleClusterRequest);
distroXAutoscaleClusterRequest.setTimeAlertRequests(null);
distroXAutoscaleClusterRequest.setUseStopStartMechanism(true);
distroXAutoScaleClusterV1Endpoint.updateAutoscaleConfigByClusterCrn(TEST_CLUSTER_CRN, distroXAutoscaleClusterRequest);
}
use of com.sequenceiq.periscope.api.model.DistroXAutoscaleClusterRequest in project cloudbreak by hortonworks.
the class DistroXAutoScaleClusterV1EndpointTest method testEnableStopStartScalingViaStateUpdateWithPreExistingTimeAlerts.
@Test(expected = BadRequestException.class)
public void testEnableStopStartScalingViaStateUpdateWithPreExistingTimeAlerts() {
DistroXAutoscaleClusterRequest distroXAutoscaleClusterRequest = new DistroXAutoscaleClusterRequest();
distroXAutoscaleClusterRequest.setEnableAutoscaling(true);
List<TimeAlertRequest> timeAlertRequests = getTimeAlertRequests(2, List.of("compute", "compute"));
distroXAutoscaleClusterRequest.setTimeAlertRequests(timeAlertRequests);
distroXAutoScaleClusterV1Endpoint.updateAutoscaleConfigByClusterCrn(TEST_CLUSTER_CRN, distroXAutoscaleClusterRequest);
distroXAutoScaleClusterV1Endpoint.enableAutoscaleForClusterCrn(TEST_CLUSTER_CRN, AutoscaleClusterState.enableStopStart());
}
use of com.sequenceiq.periscope.api.model.DistroXAutoscaleClusterRequest in project cloudbreak by hortonworks.
the class DistroXAutoScaleClusterV1EndpointTest method testUpdateAutoscaleConfigWithTimeAlertsAndStopStartEnabled.
@Test(expected = BadRequestException.class)
public void testUpdateAutoscaleConfigWithTimeAlertsAndStopStartEnabled() {
List<TimeAlertRequest> timeAlertRequests = getTimeAlertRequests(2, List.of("compute", "compute"));
DistroXAutoscaleClusterRequest distroXAutoscaleClusterRequest = new DistroXAutoscaleClusterRequest();
distroXAutoscaleClusterRequest.setTimeAlertRequests(timeAlertRequests);
distroXAutoscaleClusterRequest.setEnableAutoscaling(true);
distroXAutoscaleClusterRequest.setUseStopStartMechanism(true);
distroXAutoScaleClusterV1Endpoint.updateAutoscaleConfigByClusterName(TEST_CLUSTER_NAME, distroXAutoscaleClusterRequest);
}
use of com.sequenceiq.periscope.api.model.DistroXAutoscaleClusterRequest in project cloudbreak by hortonworks.
the class DistroXAutoScaleClusterV1EndpointTest method testUpdateAutoscaleConfigByClusterCrnForMultipleLoadAlertsAndHostGroups.
@Test(expected = BadRequestException.class)
public void testUpdateAutoscaleConfigByClusterCrnForMultipleLoadAlertsAndHostGroups() {
List<LoadAlertRequest> loadAlertRequests = getLoadAlertRequests(2, List.of("group1", "group2"));
DistroXAutoscaleClusterRequest distroXAutoscaleClusterRequest = new DistroXAutoscaleClusterRequest();
distroXAutoscaleClusterRequest.setLoadAlertRequests(loadAlertRequests);
distroXAutoscaleClusterRequest.setEnableAutoscaling(true);
distroXAutoScaleClusterV1Endpoint.updateAutoscaleConfigByClusterCrn(TEST_CLUSTER_CRN, distroXAutoscaleClusterRequest);
}
use of com.sequenceiq.periscope.api.model.DistroXAutoscaleClusterRequest in project cloudbreak by hortonworks.
the class DistroXAutoScaleClusterV1EndpointTest method testCreateTimeAlertWithPreExistingStopStartLoadAlert.
@Test(expected = BadRequestException.class)
public void testCreateTimeAlertWithPreExistingStopStartLoadAlert() {
DistroXAutoscaleClusterRequest autoscaleRequest = new DistroXAutoscaleClusterRequest();
List<LoadAlertRequest> loadAlertRequests = getLoadAlertRequests(1, List.of("compute"));
autoscaleRequest.setLoadAlertRequests(loadAlertRequests);
autoscaleRequest.setUseStopStartMechanism(true);
autoscaleRequest.setEnableAutoscaling(true);
distroXAutoScaleClusterV1Endpoint.updateAutoscaleConfigByClusterName(TEST_CLUSTER_NAME, autoscaleRequest);
List<TimeAlertRequest> timeAlertRequests = getTimeAlertRequests(2, List.of("compute", "compute"));
autoscaleRequest.setTimeAlertRequests(timeAlertRequests);
autoscaleRequest.setLoadAlertRequests(null);
autoscaleRequest.setUseStopStartMechanism(null);
distroXAutoScaleClusterV1Endpoint.updateAutoscaleConfigByClusterName(TEST_CLUSTER_NAME, autoscaleRequest);
}
Aggregations