Example usage for com.amazonaws.services.autoscaling.model CompleteLifecycleActionRequest setAutoScalingGroupName

List of usage examples for com.amazonaws.services.autoscaling.model CompleteLifecycleActionRequest setAutoScalingGroupName

Introduction

In this page you can find the example usage for com.amazonaws.services.autoscaling.model CompleteLifecycleActionRequest setAutoScalingGroupName.

Prototype


public void setAutoScalingGroupName(String autoScalingGroupName) 

Source Link

Document

The name of the Auto Scaling group.

Usage

From source file:com.pinterest.arcee.autoscaling.AwsAutoScaleGroupManager.java

License:Apache License

@Override
public void completeLifecycleAction(String hookId, String tokenId, String groupName) throws Exception {
    List<String> lifecycleHooks = getLifecycleHookIds(groupName);
    if (!lifecycleHooks.contains(hookId)) {
        return;/*from ww w . j  a  v  a2  s .c o  m*/
    }

    CompleteLifecycleActionRequest completeLifecycleActionRequest = new CompleteLifecycleActionRequest();
    completeLifecycleActionRequest.setLifecycleHookName(hookId);
    completeLifecycleActionRequest.setLifecycleActionToken(tokenId);
    completeLifecycleActionRequest.setAutoScalingGroupName(groupName);
    // CONTINUE action will allow asg proceed to terminate instances earlier than timeout limit
    completeLifecycleActionRequest.setLifecycleActionResult(AutoScalingConstants.LIFECYCLE_ACTION_CONTINUE);
    aasClient.completeLifecycleAction(completeLifecycleActionRequest);
}