* For backwards compatibility, we preserve the existing List<String> of
* security group names by explicitly populating it from the full list
* of security group info.
*/
if (response instanceof DescribeSpotInstanceRequestsResult) {
DescribeSpotInstanceRequestsResult result = (DescribeSpotInstanceRequestsResult)response;
for (SpotInstanceRequest spotInstanceRequest : result.getSpotInstanceRequests()) {
LaunchSpecification launchSpecification = spotInstanceRequest.getLaunchSpecification();
populateLaunchSpecificationSecurityGroupNames(launchSpecification);
}
} else if (response instanceof RequestSpotInstancesResult) {
RequestSpotInstancesResult result = (RequestSpotInstancesResult)response;
for (SpotInstanceRequest spotInstanceRequest : result.getSpotInstanceRequests()) {
LaunchSpecification launchSpecification = spotInstanceRequest.getLaunchSpecification();
populateLaunchSpecificationSecurityGroupNames(launchSpecification);
}
} else if (response instanceof DescribeInstancesResult) {
DescribeInstancesResult result = (DescribeInstancesResult)response;
for (Reservation reservation : result.getReservations()) {
populateReservationSecurityGroupNames(reservation);
}
} else if (response instanceof RunInstancesResult) {
RunInstancesResult result = (RunInstancesResult)response;
populateReservationSecurityGroupNames(result.getReservation());
}
}