Search in sources :

Example 1 with DescribeAutoScalingInstancesRequest

use of com.amazonaws.services.autoscaling.model.DescribeAutoScalingInstancesRequest in project opencast by opencast.

the class AutoScalingTerminationStateService method getAutoScalingGroupName.

private String getAutoScalingGroupName() {
    DescribeAutoScalingInstancesRequest request = new DescribeAutoScalingInstancesRequest().withInstanceIds(instanceId);
    DescribeAutoScalingInstancesResult result = autoScaling.describeAutoScalingInstances(request);
    List<AutoScalingInstanceDetails> instances = result.getAutoScalingInstances();
    logger.debug("Found {} autoscaling instances", instances.size());
    if (!instances.isEmpty()) {
        AutoScalingInstanceDetails autoScalingInstance = instances.get(0);
        return autoScalingInstance.getAutoScalingGroupName();
    }
    return null;
}
Also used : DescribeAutoScalingInstancesRequest(com.amazonaws.services.autoscaling.model.DescribeAutoScalingInstancesRequest) AutoScalingInstanceDetails(com.amazonaws.services.autoscaling.model.AutoScalingInstanceDetails) DescribeAutoScalingInstancesResult(com.amazonaws.services.autoscaling.model.DescribeAutoScalingInstancesResult)

Aggregations

AutoScalingInstanceDetails (com.amazonaws.services.autoscaling.model.AutoScalingInstanceDetails)1 DescribeAutoScalingInstancesRequest (com.amazonaws.services.autoscaling.model.DescribeAutoScalingInstancesRequest)1 DescribeAutoScalingInstancesResult (com.amazonaws.services.autoscaling.model.DescribeAutoScalingInstancesResult)1