Search in sources :

Example 1 with SuspendProcessesRequest

use of com.amazonaws.services.autoscaling.model.SuspendProcessesRequest in project cloudbreak by hortonworks.

the class AwsResourceConnector method suspendAutoScaling.

private void suspendAutoScaling(AuthenticatedContext ac, CloudStack stack) {
    AmazonAutoScalingClient amazonASClient = awsClient.createAutoScalingClient(new AwsCredentialView(ac.getCloudCredential()), ac.getCloudContext().getLocation().getRegion().value());
    for (Group group : stack.getGroups()) {
        String asGroupName = cfStackUtil.getAutoscalingGroupName(ac, group.getName(), ac.getCloudContext().getLocation().getRegion().value());
        amazonASClient.suspendProcesses(new SuspendProcessesRequest().withAutoScalingGroupName(asGroupName).withScalingProcesses(SUSPENDED_PROCESSES));
    }
}
Also used : AwsCredentialView(com.sequenceiq.cloudbreak.cloud.aws.view.AwsCredentialView) AutoScalingGroup(com.amazonaws.services.autoscaling.model.AutoScalingGroup) Group(com.sequenceiq.cloudbreak.cloud.model.Group) AmazonAutoScalingClient(com.amazonaws.services.autoscaling.AmazonAutoScalingClient) SuspendProcessesRequest(com.amazonaws.services.autoscaling.model.SuspendProcessesRequest)

Aggregations

AmazonAutoScalingClient (com.amazonaws.services.autoscaling.AmazonAutoScalingClient)1 AutoScalingGroup (com.amazonaws.services.autoscaling.model.AutoScalingGroup)1 SuspendProcessesRequest (com.amazonaws.services.autoscaling.model.SuspendProcessesRequest)1 AwsCredentialView (com.sequenceiq.cloudbreak.cloud.aws.view.AwsCredentialView)1 Group (com.sequenceiq.cloudbreak.cloud.model.Group)1