use of com.amazonaws.services.autoscaling.model.DescribeLaunchConfigurationsRequest in project cloudbreak by hortonworks.
the class LaunchConfigurationHandler method getLaunchConfigurations.
public List<LaunchConfiguration> getLaunchConfigurations(AmazonAutoScalingClient autoScalingClient, Collection<AutoScalingGroup> scalingGroups) {
DescribeLaunchConfigurationsRequest launchConfigurationsRequest = new DescribeLaunchConfigurationsRequest();
launchConfigurationsRequest.setLaunchConfigurationNames(scalingGroups.stream().map(AutoScalingGroup::getLaunchConfigurationName).collect(Collectors.toList()));
return autoScalingClient.describeLaunchConfigurations(launchConfigurationsRequest).getLaunchConfigurations();
}
use of com.amazonaws.services.autoscaling.model.DescribeLaunchConfigurationsRequest in project cloudbreak by hortonworks.
the class LaunchConfigurationHandlerTest method getLaunchConfigurations.
@Test
public void getLaunchConfigurations() {
when(autoScalingClient.describeLaunchConfigurations(any(DescribeLaunchConfigurationsRequest.class))).thenReturn(new DescribeLaunchConfigurationsResult());
Collection<AutoScalingGroup> autoScalingGroups = Lists.newArrayList(new AutoScalingGroup().withLaunchConfigurationName("a"), new AutoScalingGroup().withLaunchConfigurationName("b"));
underTest.getLaunchConfigurations(autoScalingClient, autoScalingGroups);
ArgumentCaptor<DescribeLaunchConfigurationsRequest> captor = ArgumentCaptor.forClass(DescribeLaunchConfigurationsRequest.class);
verify(autoScalingClient, times(1)).describeLaunchConfigurations(captor.capture());
assertEquals(autoScalingGroups.size(), captor.getValue().getLaunchConfigurationNames().size());
}
use of com.amazonaws.services.autoscaling.model.DescribeLaunchConfigurationsRequest in project titus-control-plane by Netflix.
the class AwsInstanceCloudConnector method getInstanceLaunchConfiguration.
@Override
public Observable<List<InstanceLaunchConfiguration>> getInstanceLaunchConfiguration(List<String> launchConfigurationIds) {
if (launchConfigurationIds.isEmpty()) {
return Observable.just(Collections.emptyList());
}
DescribeLaunchConfigurationsRequest request = new DescribeLaunchConfigurationsRequest().withLaunchConfigurationNames(launchConfigurationIds);
Observable<DescribeLaunchConfigurationsResult> observable = toObservable(request, autoScalingClient::describeLaunchConfigurationsAsync);
return observable.map(response -> toInstanceLaunchConfigurations(response.getLaunchConfigurations())).timeout(configuration.getAwsRequestTimeoutMs(), TimeUnit.MILLISECONDS);
}
Aggregations