Search in sources :

Example 1 with DetachInstancesResult

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

the class AwsDownscaleServiceTest method downscaleOrderTest.

@Test
void downscaleOrderTest() {
    // We need to invoke  detach, terminate and update ASG in this order othervise a strange sporadic concurrency issue can occure on AWS side
    // The proper order is:
    // amazonASClient.detachInstances(...);
    // amazonEC2Client.terminateInstances(...);
    // amazonASClient.updateAutoScalingGroup(...);
    CloudStack stack = mock(CloudStack.class);
    List<CloudResource> resources = List.of(new CloudResource.Builder().name("i-1").type(ResourceType.AWS_INSTANCE).build());
    InstanceAuthentication instanceAuthentication = new InstanceAuthentication("sshkey", "", "cloudbreak");
    List<CloudInstance> cloudInstances = new ArrayList<>();
    InstanceTemplate workerTemplate = mock(InstanceTemplate.class);
    when(workerTemplate.getGroupName()).thenReturn("worker");
    CloudInstance workerInstance1 = new CloudInstance("i-worker1", workerTemplate, instanceAuthentication, "subnet-1", "az1");
    cloudInstances.add(workerInstance1);
    CloudContext context = CloudContext.Builder.builder().withId(1L).withName("teststack").withCrn("crn").withPlatform("AWS").withVariant("AWS").withLocation(Location.location(Region.region("eu-west-1"), AvailabilityZone.availabilityZone("eu-west-1a"))).withAccountId("1").build();
    AuthenticatedContext authenticatedContext = new AuthenticatedContext(context, new CloudCredential());
    AmazonAutoScalingClient amazonAutoScalingClient = mock(AmazonAutoScalingClient.class);
    DescribeAutoScalingGroupsResult describeAutoScalingGroupsResult = new DescribeAutoScalingGroupsResult();
    AutoScalingGroup autoScalingGroup = new AutoScalingGroup();
    autoScalingGroup.setInstances(List.of(new Instance().withInstanceId("i-worker1")));
    describeAutoScalingGroupsResult.setAutoScalingGroups(List.of(autoScalingGroup));
    when(amazonAutoScalingClient.describeAutoScalingGroups(any())).thenReturn(describeAutoScalingGroupsResult);
    when(awsClient.createAutoScalingClient(any(), anyString())).thenReturn(amazonAutoScalingClient);
    AmazonEc2Client amazonEC2Client = mock(AmazonEc2Client.class);
    when(awsClient.createEc2Client(any(), anyString())).thenReturn(amazonEC2Client);
    AmazonEC2Waiters amazonEC2Waiters = mock(AmazonEC2Waiters.class);
    when(amazonEC2Client.waiters()).thenReturn(amazonEC2Waiters);
    Waiter waiter = mock(Waiter.class);
    when(amazonEC2Waiters.instanceTerminated()).thenReturn(waiter);
    when(amazonAutoScalingClient.detachInstances(any())).thenReturn(new DetachInstancesResult());
    when(amazonEC2Client.terminateInstances(any())).thenReturn(new TerminateInstancesResult());
    when(cfStackUtil.getAutoscalingGroupName(any(), (String) any(), any())).thenReturn("autoscalegroup-1");
    mockDescribeInstances(amazonEC2Client);
    // create inOrder object passing any mocks that need to be verified in order
    InOrder inOrder = Mockito.inOrder(amazonAutoScalingClient, amazonEC2Client);
    underTest.downscale(authenticatedContext, stack, resources, cloudInstances);
    verify(loadBalancerService).removeLoadBalancerTargets(any(), any(), any());
    // Following will make sure that detach, ivoked before terminate and terminate invoked before update ASG!
    inOrder.verify(amazonAutoScalingClient).detachInstances(any());
    inOrder.verify(amazonEC2Client).terminateInstances(any());
    inOrder.verify(amazonAutoScalingClient).updateAutoScalingGroup(any());
}
Also used : AutoScalingGroup(com.amazonaws.services.autoscaling.model.AutoScalingGroup) InstanceAuthentication(com.sequenceiq.cloudbreak.cloud.model.InstanceAuthentication) InOrder(org.mockito.InOrder) CloudCredential(com.sequenceiq.cloudbreak.cloud.model.CloudCredential) CloudInstance(com.sequenceiq.cloudbreak.cloud.model.CloudInstance) Instance(com.amazonaws.services.autoscaling.model.Instance) CloudContext(com.sequenceiq.cloudbreak.cloud.context.CloudContext) ArrayList(java.util.ArrayList) CloudInstance(com.sequenceiq.cloudbreak.cloud.model.CloudInstance) AuthenticatedContext(com.sequenceiq.cloudbreak.cloud.context.AuthenticatedContext) CloudStack(com.sequenceiq.cloudbreak.cloud.model.CloudStack) AmazonEC2Waiters(com.amazonaws.services.ec2.waiters.AmazonEC2Waiters) DetachInstancesResult(com.amazonaws.services.autoscaling.model.DetachInstancesResult) AmazonAutoScalingClient(com.sequenceiq.cloudbreak.cloud.aws.client.AmazonAutoScalingClient) DescribeAutoScalingGroupsResult(com.amazonaws.services.autoscaling.model.DescribeAutoScalingGroupsResult) TerminateInstancesResult(com.amazonaws.services.ec2.model.TerminateInstancesResult) CloudResource(com.sequenceiq.cloudbreak.cloud.model.CloudResource) AmazonEc2Client(com.sequenceiq.cloudbreak.cloud.aws.common.client.AmazonEc2Client) Waiter(com.amazonaws.waiters.Waiter) InstanceTemplate(com.sequenceiq.cloudbreak.cloud.model.InstanceTemplate) Test(org.junit.jupiter.api.Test)

Example 2 with DetachInstancesResult

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

the class AwsDownscaleServiceTest method downscaleWithLoadBalancers.

@Test
void downscaleWithLoadBalancers() {
    CloudStack stack = mock(CloudStack.class);
    List<CloudResource> resources = Collections.emptyList();
    InstanceAuthentication instanceAuthentication = new InstanceAuthentication("sshkey", "", "cloudbreak");
    InstanceTemplate workerTemplate = mock(InstanceTemplate.class);
    when(workerTemplate.getGroupName()).thenReturn("worker");
    List<CloudInstance> cloudInstances = List.of(new CloudInstance("i-worker1", workerTemplate, instanceAuthentication, "subnet-1", "az1"));
    CloudLoadBalancer privateLoadBalancer = new CloudLoadBalancer(LoadBalancerType.PRIVATE);
    CloudLoadBalancer publicLoadBalancer = new CloudLoadBalancer(LoadBalancerType.PUBLIC);
    CloudContext context = CloudContext.Builder.builder().withId(1L).withName("teststack").withCrn("crn").withPlatform("AWS").withVariant("AWS").withLocation(Location.location(Region.region("eu-west-1"), AvailabilityZone.availabilityZone("eu-west-1a"))).withAccountId("1").build();
    AuthenticatedContext authenticatedContext = new AuthenticatedContext(context, new CloudCredential());
    AmazonAutoScalingClient amazonAutoScalingClient = mock(AmazonAutoScalingClient.class);
    when(awsClient.createAutoScalingClient(any(), anyString())).thenReturn(amazonAutoScalingClient);
    AmazonEc2Client amazonEC2Client = mock(AmazonEc2Client.class);
    when(awsClient.createEc2Client(any(), anyString())).thenReturn(amazonEC2Client);
    AmazonEC2Waiters amazonEC2Waiters = mock(AmazonEC2Waiters.class);
    when(amazonEC2Client.waiters()).thenReturn(amazonEC2Waiters);
    Waiter waiter = mock(Waiter.class);
    when(amazonEC2Waiters.instanceTerminated()).thenReturn(waiter);
    when(cfStackUtil.getAutoscalingGroupName(any(), (String) any(), any())).thenReturn("autoscalegroup-1");
    when(stack.getLoadBalancers()).thenReturn(List.of(privateLoadBalancer, publicLoadBalancer));
    doNothing().when(loadBalancerService).removeLoadBalancerTargets(any(), any(), any());
    DescribeAutoScalingGroupsResult describeAutoScalingGroupsResult = new DescribeAutoScalingGroupsResult();
    AutoScalingGroup autoScalingGroup = new AutoScalingGroup();
    autoScalingGroup.setInstances(List.of(new Instance().withInstanceId("i-worker1")));
    describeAutoScalingGroupsResult.setAutoScalingGroups(List.of(autoScalingGroup));
    ArgumentCaptor<DescribeAutoScalingGroupsRequest> describeAutoScalingGroupsRequest = ArgumentCaptor.forClass(DescribeAutoScalingGroupsRequest.class);
    ArgumentCaptor<DetachInstancesRequest> detachInstancesRequestArgumentCaptor = ArgumentCaptor.forClass(DetachInstancesRequest.class);
    when(amazonAutoScalingClient.describeAutoScalingGroups(describeAutoScalingGroupsRequest.capture())).thenReturn(describeAutoScalingGroupsResult);
    when(amazonAutoScalingClient.detachInstances(detachInstancesRequestArgumentCaptor.capture())).thenReturn(new DetachInstancesResult());
    mockDescribeInstances(amazonEC2Client);
    underTest.downscale(authenticatedContext, stack, resources, cloudInstances);
    verify(loadBalancerService).removeLoadBalancerTargets(any(), any(), any());
}
Also used : AutoScalingGroup(com.amazonaws.services.autoscaling.model.AutoScalingGroup) InstanceAuthentication(com.sequenceiq.cloudbreak.cloud.model.InstanceAuthentication) CloudCredential(com.sequenceiq.cloudbreak.cloud.model.CloudCredential) CloudInstance(com.sequenceiq.cloudbreak.cloud.model.CloudInstance) Instance(com.amazonaws.services.autoscaling.model.Instance) CloudContext(com.sequenceiq.cloudbreak.cloud.context.CloudContext) CloudInstance(com.sequenceiq.cloudbreak.cloud.model.CloudInstance) AuthenticatedContext(com.sequenceiq.cloudbreak.cloud.context.AuthenticatedContext) CloudStack(com.sequenceiq.cloudbreak.cloud.model.CloudStack) AmazonEC2Waiters(com.amazonaws.services.ec2.waiters.AmazonEC2Waiters) DetachInstancesResult(com.amazonaws.services.autoscaling.model.DetachInstancesResult) DescribeAutoScalingGroupsRequest(com.amazonaws.services.autoscaling.model.DescribeAutoScalingGroupsRequest) CloudLoadBalancer(com.sequenceiq.cloudbreak.cloud.model.CloudLoadBalancer) AmazonAutoScalingClient(com.sequenceiq.cloudbreak.cloud.aws.client.AmazonAutoScalingClient) DescribeAutoScalingGroupsResult(com.amazonaws.services.autoscaling.model.DescribeAutoScalingGroupsResult) CloudResource(com.sequenceiq.cloudbreak.cloud.model.CloudResource) AmazonEc2Client(com.sequenceiq.cloudbreak.cloud.aws.common.client.AmazonEc2Client) Waiter(com.amazonaws.waiters.Waiter) DetachInstancesRequest(com.amazonaws.services.autoscaling.model.DetachInstancesRequest) InstanceTemplate(com.sequenceiq.cloudbreak.cloud.model.InstanceTemplate) Test(org.junit.jupiter.api.Test)

Example 3 with DetachInstancesResult

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

the class AwsDownscaleServiceTest method downscaleASG.

@Test
void downscaleASG() {
    CloudStack stack = mock(CloudStack.class);
    List<CloudResource> resources = List.of(new CloudResource.Builder().name("i-1").type(ResourceType.AWS_INSTANCE).build(), new CloudResource.Builder().name("i-2").type(ResourceType.AWS_INSTANCE).build(), new CloudResource.Builder().name("i-3").type(ResourceType.AWS_INSTANCE).build());
    InstanceAuthentication instanceAuthentication = new InstanceAuthentication("sshkey", "", "cloudbreak");
    List<CloudInstance> cloudInstances = new ArrayList<>();
    InstanceTemplate workerTemplate = mock(InstanceTemplate.class);
    when(workerTemplate.getGroupName()).thenReturn("worker");
    CloudInstance workerInstance1 = new CloudInstance("i-worker1", workerTemplate, instanceAuthentication, "subnet-1", "az1");
    CloudInstance workerInstance2 = new CloudInstance("i-worker2", workerTemplate, instanceAuthentication, "subnet-1", "az1");
    CloudInstance workerInstance3 = new CloudInstance("i-worker3", workerTemplate, instanceAuthentication, "subnet-1", "az1");
    cloudInstances.add(workerInstance1);
    cloudInstances.add(workerInstance2);
    cloudInstances.add(workerInstance3);
    AmazonAutoScalingClient amazonAutoScalingClient = mock(AmazonAutoScalingClient.class);
    when(awsClient.createAutoScalingClient(any(), anyString())).thenReturn(amazonAutoScalingClient);
    AmazonEc2Client amazonEC2Client = mock(AmazonEc2Client.class);
    when(awsClient.createEc2Client(any(), anyString())).thenReturn(amazonEC2Client);
    CloudContext context = CloudContext.Builder.builder().withId(1L).withName("teststack").withCrn("crn").withPlatform("AWS").withVariant("AWS").withLocation(Location.location(Region.region("eu-west-1"), AvailabilityZone.availabilityZone("eu-west-1a"))).withAccountId("1").build();
    AuthenticatedContext authenticatedContext = new AuthenticatedContext(context, new CloudCredential());
    AmazonEC2Waiters amazonEC2Waiters = mock(AmazonEC2Waiters.class);
    when(amazonEC2Client.waiters()).thenReturn(amazonEC2Waiters);
    Waiter waiter = mock(Waiter.class);
    when(amazonEC2Waiters.instanceTerminated()).thenReturn(waiter);
    when(cfStackUtil.getAutoscalingGroupName(any(), (String) any(), any())).thenReturn("autoscalegroup-1");
    DescribeAutoScalingGroupsResult describeAutoScalingGroupsResult = new DescribeAutoScalingGroupsResult();
    AutoScalingGroup autoScalingGroup = new AutoScalingGroup();
    autoScalingGroup.setInstances(List.of(new Instance().withInstanceId("i-worker1")));
    describeAutoScalingGroupsResult.setAutoScalingGroups(List.of(autoScalingGroup));
    ArgumentCaptor<DescribeAutoScalingGroupsRequest> describeAutoScalingGroupsRequest = ArgumentCaptor.forClass(DescribeAutoScalingGroupsRequest.class);
    ArgumentCaptor<DetachInstancesRequest> detachInstancesRequestArgumentCaptor = ArgumentCaptor.forClass(DetachInstancesRequest.class);
    when(amazonAutoScalingClient.describeAutoScalingGroups(describeAutoScalingGroupsRequest.capture())).thenReturn(describeAutoScalingGroupsResult);
    when(amazonAutoScalingClient.detachInstances(detachInstancesRequestArgumentCaptor.capture())).thenReturn(new DetachInstancesResult());
    mockDescribeInstances(amazonEC2Client);
    underTest.downscale(authenticatedContext, stack, resources, cloudInstances);
    List<DetachInstancesRequest> allValues = detachInstancesRequestArgumentCaptor.getAllValues();
    assertThat(allValues.get(0).getInstanceIds(), contains("i-worker1"));
    verify(amazonAutoScalingClient, times(1)).detachInstances(any());
    verify(loadBalancerService).removeLoadBalancerTargets(any(), any(), any());
    assertEquals(describeAutoScalingGroupsRequest.getValue().getAutoScalingGroupNames(), List.of("autoscalegroup-1"));
}
Also used : CloudInstance(com.sequenceiq.cloudbreak.cloud.model.CloudInstance) Instance(com.amazonaws.services.autoscaling.model.Instance) ArrayList(java.util.ArrayList) AuthenticatedContext(com.sequenceiq.cloudbreak.cloud.context.AuthenticatedContext) DetachInstancesResult(com.amazonaws.services.autoscaling.model.DetachInstancesResult) AmazonEc2Client(com.sequenceiq.cloudbreak.cloud.aws.common.client.AmazonEc2Client) AutoScalingGroup(com.amazonaws.services.autoscaling.model.AutoScalingGroup) InstanceAuthentication(com.sequenceiq.cloudbreak.cloud.model.InstanceAuthentication) CloudCredential(com.sequenceiq.cloudbreak.cloud.model.CloudCredential) CloudContext(com.sequenceiq.cloudbreak.cloud.context.CloudContext) CloudInstance(com.sequenceiq.cloudbreak.cloud.model.CloudInstance) CloudStack(com.sequenceiq.cloudbreak.cloud.model.CloudStack) AmazonEC2Waiters(com.amazonaws.services.ec2.waiters.AmazonEC2Waiters) DescribeAutoScalingGroupsRequest(com.amazonaws.services.autoscaling.model.DescribeAutoScalingGroupsRequest) AmazonAutoScalingClient(com.sequenceiq.cloudbreak.cloud.aws.client.AmazonAutoScalingClient) DescribeAutoScalingGroupsResult(com.amazonaws.services.autoscaling.model.DescribeAutoScalingGroupsResult) CloudResource(com.sequenceiq.cloudbreak.cloud.model.CloudResource) Waiter(com.amazonaws.waiters.Waiter) DetachInstancesRequest(com.amazonaws.services.autoscaling.model.DetachInstancesRequest) InstanceTemplate(com.sequenceiq.cloudbreak.cloud.model.InstanceTemplate) Test(org.junit.jupiter.api.Test)

Example 4 with DetachInstancesResult

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

the class AwsDownscaleService method detachInstances.

private void detachInstances(String asGroupName, List<String> instanceIdsForAutoScalingGroup, List<String> instanceIdsToDownscale, AmazonAutoScalingClient amazonASClient) {
    try {
        List<String> instanceIdsToDetach = instanceIdsForAutoScalingGroup.stream().filter(instanceIdsToDownscale::contains).collect(Collectors.toList());
        if (instanceIdsToDownscale.size() != instanceIdsToDetach.size()) {
            LOGGER.info("Some instances were already detached. Requesting to detach [{}] from original list [{}].", instanceIdsToDetach, instanceIdsToDownscale);
        }
        for (int i = 0; i < instanceIdsToDetach.size(); i += MAX_DETACH_INSTANCE_SIZE) {
            List<String> idPartition = instanceIdsToDetach.subList(i, i + Math.min(instanceIdsToDetach.size() - i, MAX_DETACH_INSTANCE_SIZE));
            DetachInstancesRequest detachInstancesRequest = new DetachInstancesRequest().withAutoScalingGroupName(asGroupName).withInstanceIds(idPartition).withShouldDecrementDesiredCapacity(true);
            LOGGER.info("Detach instances from asGroupName: {}, instanceIdsToDetach: {}, detachInstancesRequest: {}", asGroupName, instanceIdsToDetach, detachInstancesRequest);
            DetachInstancesResult result = amazonASClient.detachInstances(detachInstancesRequest);
            LOGGER.info("Detach instances from asGroupName: {}, instanceIdsToDetach: {}, result: {}", asGroupName, instanceIdsToDetach, result);
        }
    } catch (AmazonServiceException e) {
        LOGGER.info("Detach instances failed: {}", instanceIdsToDownscale, e);
        throw e;
    }
}
Also used : AmazonServiceException(com.amazonaws.AmazonServiceException) DetachInstancesResult(com.amazonaws.services.autoscaling.model.DetachInstancesResult) DetachInstancesRequest(com.amazonaws.services.autoscaling.model.DetachInstancesRequest)

Example 5 with DetachInstancesResult

use of com.amazonaws.services.autoscaling.model.DetachInstancesResult in project titus-control-plane by Netflix.

the class AwsInstanceCloudConnector method doDetach.

private Completable doDetach(String instanceGroup, List<String> instanceIds, boolean shrink) {
    DetachInstancesRequest request = new DetachInstancesRequest().withAutoScalingGroupName(instanceGroup).withInstanceIds(instanceIds).withShouldDecrementDesiredCapacity(shrink);
    Observable<DetachInstancesResult> observable = toObservable(request, autoScalingClient::detachInstancesAsync);
    return observable.doOnCompleted(() -> logger.info("Detached instances: {}", instanceIds)).doOnError(e -> logger.warn("Failed to detach instances: {}, due to {}", instanceIds, e.getMessage())).toCompletable();
}
Also used : InstanceLaunchConfiguration(com.netflix.titus.api.connector.cloud.InstanceLaunchConfiguration) BiFunction(java.util.function.BiFunction) CollectionsExt(com.netflix.titus.common.util.CollectionsExt) TerminateInstancesResult(com.amazonaws.services.ec2.model.TerminateInstancesResult) LoggerFactory(org.slf4j.LoggerFactory) DescribeLaunchConfigurationsResult(com.amazonaws.services.autoscaling.model.DescribeLaunchConfigurationsResult) Collections.singletonList(java.util.Collections.singletonList) PreDestroy(javax.annotation.PreDestroy) Future(java.util.concurrent.Future) CreateTagsRequest(com.amazonaws.services.ec2.model.CreateTagsRequest) DescribeInstancesRequest(com.amazonaws.services.ec2.model.DescribeInstancesRequest) CloudConnectorException(com.netflix.titus.api.connector.cloud.CloudConnectorException) Map(java.util.Map) Schedulers(rx.schedulers.Schedulers) Either(com.netflix.titus.common.util.tuple.Either) ResourceDimension(com.netflix.titus.api.model.ResourceDimension) Reservation(com.amazonaws.services.ec2.model.Reservation) AutoScalingGroup(com.amazonaws.services.autoscaling.model.AutoScalingGroup) DescribeInstancesResult(com.amazonaws.services.ec2.model.DescribeInstancesResult) Scheduler(rx.Scheduler) Collectors(java.util.stream.Collectors) List(java.util.List) AutoScalingInstanceDetails(com.amazonaws.services.autoscaling.model.AutoScalingInstanceDetails) UpdateAutoScalingGroupResult(com.amazonaws.services.autoscaling.model.UpdateAutoScalingGroupResult) Tag(com.amazonaws.services.ec2.model.Tag) ProxyConfiguration(com.netflix.titus.common.util.guice.annotation.ProxyConfiguration) Optional(java.util.Optional) ObservableExt(com.netflix.titus.common.util.rx.ObservableExt) Completable(rx.Completable) AwsInstanceType(com.netflix.titus.common.aws.AwsInstanceType) ProxyType(com.netflix.titus.common.util.guice.ProxyType) Singleton(javax.inject.Singleton) Function(java.util.function.Function) Supplier(java.util.function.Supplier) ArrayList(java.util.ArrayList) Observable(rx.Observable) Inject(javax.inject.Inject) Strings(com.google.common.base.Strings) UpdateAutoScalingGroupRequest(com.amazonaws.services.autoscaling.model.UpdateAutoScalingGroupRequest) Pair(com.netflix.titus.common.util.tuple.Pair) InstanceCloudConnector(com.netflix.titus.api.connector.cloud.InstanceCloudConnector) AwsInstanceDescriptor(com.netflix.titus.common.aws.AwsInstanceDescriptor) DescribeAutoScalingInstancesResult(com.amazonaws.services.autoscaling.model.DescribeAutoScalingInstancesResult) DescribeAutoScalingGroupsResult(com.amazonaws.services.autoscaling.model.DescribeAutoScalingGroupsResult) Filter(com.amazonaws.services.ec2.model.Filter) Named(javax.inject.Named) TagDescription(com.amazonaws.services.autoscaling.model.TagDescription) Instance(com.netflix.titus.api.connector.cloud.Instance) AmazonWebServiceRequest(com.amazonaws.AmazonWebServiceRequest) Logger(org.slf4j.Logger) DescribeLaunchConfigurationsRequest(com.amazonaws.services.autoscaling.model.DescribeLaunchConfigurationsRequest) DetachInstancesRequest(com.amazonaws.services.autoscaling.model.DetachInstancesRequest) InstanceState(com.netflix.titus.api.connector.cloud.Instance.InstanceState) SuspendedProcess(com.amazonaws.services.autoscaling.model.SuspendedProcess) CreateTagsResult(com.amazonaws.services.ec2.model.CreateTagsResult) AmazonEC2Async(com.amazonaws.services.ec2.AmazonEC2Async) Mono(reactor.core.publisher.Mono) TerminateInstancesRequest(com.amazonaws.services.ec2.model.TerminateInstancesRequest) Emitter(rx.Emitter) DescribeAutoScalingGroupsRequest(com.amazonaws.services.autoscaling.model.DescribeAutoScalingGroupsRequest) Activator(com.netflix.titus.common.util.guice.annotation.Activator) TimeUnit(java.util.concurrent.TimeUnit) DescribeAutoScalingInstancesRequest(com.amazonaws.services.autoscaling.model.DescribeAutoScalingInstancesRequest) AsyncHandler(com.amazonaws.handlers.AsyncHandler) AmazonEC2Exception(com.amazonaws.services.ec2.model.AmazonEC2Exception) InstanceGroup(com.netflix.titus.api.connector.cloud.InstanceGroup) AmazonAutoScalingAsync(com.amazonaws.services.autoscaling.AmazonAutoScalingAsync) Collections(java.util.Collections) DetachInstancesResult(com.amazonaws.services.autoscaling.model.DetachInstancesResult) LaunchConfiguration(com.amazonaws.services.autoscaling.model.LaunchConfiguration) DetachInstancesResult(com.amazonaws.services.autoscaling.model.DetachInstancesResult) DetachInstancesRequest(com.amazonaws.services.autoscaling.model.DetachInstancesRequest)

Aggregations

DetachInstancesResult (com.amazonaws.services.autoscaling.model.DetachInstancesResult)5 AutoScalingGroup (com.amazonaws.services.autoscaling.model.AutoScalingGroup)4 DescribeAutoScalingGroupsResult (com.amazonaws.services.autoscaling.model.DescribeAutoScalingGroupsResult)4 DetachInstancesRequest (com.amazonaws.services.autoscaling.model.DetachInstancesRequest)4 DescribeAutoScalingGroupsRequest (com.amazonaws.services.autoscaling.model.DescribeAutoScalingGroupsRequest)3 Instance (com.amazonaws.services.autoscaling.model.Instance)3 AmazonEC2Waiters (com.amazonaws.services.ec2.waiters.AmazonEC2Waiters)3 Waiter (com.amazonaws.waiters.Waiter)3 ArrayList (java.util.ArrayList)3 TerminateInstancesResult (com.amazonaws.services.ec2.model.TerminateInstancesResult)2 AmazonAutoScalingClient (com.sequenceiq.cloudbreak.cloud.aws.client.AmazonAutoScalingClient)2 AmazonEc2Client (com.sequenceiq.cloudbreak.cloud.aws.common.client.AmazonEc2Client)2 AuthenticatedContext (com.sequenceiq.cloudbreak.cloud.context.AuthenticatedContext)2 CloudContext (com.sequenceiq.cloudbreak.cloud.context.CloudContext)2 CloudCredential (com.sequenceiq.cloudbreak.cloud.model.CloudCredential)2 CloudInstance (com.sequenceiq.cloudbreak.cloud.model.CloudInstance)2 CloudResource (com.sequenceiq.cloudbreak.cloud.model.CloudResource)2 CloudStack (com.sequenceiq.cloudbreak.cloud.model.CloudStack)2 InstanceAuthentication (com.sequenceiq.cloudbreak.cloud.model.InstanceAuthentication)2 InstanceTemplate (com.sequenceiq.cloudbreak.cloud.model.InstanceTemplate)2