Search in sources :

Example 1 with TargetDescription

use of com.amazonaws.services.elasticloadbalancingv2.model.TargetDescription in project cloudbreak by hortonworks.

the class CloudFormationStackUtil method addLoadBalancerTargets.

public void addLoadBalancerTargets(AuthenticatedContext ac, CloudLoadBalancer loadBalancer, List<CloudResource> resourcesToAdd) {
    String region = ac.getCloudContext().getLocation().getRegion().value();
    AmazonElasticLoadBalancingClient amazonElbClient = awsClient.createElasticLoadBalancingClient(new AwsCredentialView(ac.getCloudCredential()), region);
    for (Map.Entry<TargetGroupPortPair, Set<Group>> entry : loadBalancer.getPortToTargetGroupMapping().entrySet()) {
        // Get a list of the new instances in the target groups
        Set<String> updatedInstanceIds = getInstanceIdsForGroups(resourcesToAdd, entry.getValue());
        // Find target group ARN
        AwsLoadBalancerScheme scheme = loadBalancerTypeConverter.convert(loadBalancer.getType());
        String targetGroupArn = getResourceArnByLogicalId(ac, AwsTargetGroup.getTargetGroupName(entry.getKey().getTrafficPort(), scheme), region);
        // Use ARN to fetch a list of current targets
        DescribeTargetHealthResult targetHealthResult = amazonElbClient.describeTargetHealth(new DescribeTargetHealthRequest().withTargetGroupArn(targetGroupArn));
        List<TargetDescription> targetDescriptions = targetHealthResult.getTargetHealthDescriptions().stream().map(TargetHealthDescription::getTarget).collect(Collectors.toList());
        Set<String> alreadyRegisteredInstanceIds = targetDescriptions.stream().map(TargetDescription::getId).collect(Collectors.toSet());
        // Remove any targets that have already been registered from the list being processed
        updatedInstanceIds.removeAll(alreadyRegisteredInstanceIds);
        // Register any new instances
        if (!updatedInstanceIds.isEmpty()) {
            List<TargetDescription> targetsToAdd = updatedInstanceIds.stream().map(instanceId -> new TargetDescription().withId(instanceId)).collect(Collectors.toList());
            RegisterTargetsResult registerTargetsResult = amazonElbClient.registerTargets(new RegisterTargetsRequest().withTargetGroupArn(targetGroupArn).withTargets(targetsToAdd));
        }
    }
}
Also used : RegisterTargetsRequest(com.amazonaws.services.elasticloadbalancingv2.model.RegisterTargetsRequest) DescribeLoadBalancersRequest(com.amazonaws.services.elasticloadbalancingv2.model.DescribeLoadBalancersRequest) CloudInstance(com.sequenceiq.cloudbreak.cloud.model.CloudInstance) TargetHealthDescription(com.amazonaws.services.elasticloadbalancingv2.model.TargetHealthDescription) AmazonCloudFormationClient(com.sequenceiq.cloudbreak.cloud.aws.client.AmazonCloudFormationClient) AwsCredentialView(com.sequenceiq.cloudbreak.cloud.aws.common.view.AwsCredentialView) AuthenticatedContext(com.sequenceiq.cloudbreak.cloud.context.AuthenticatedContext) DescribeInstancesRequest(com.amazonaws.services.ec2.model.DescribeInstancesRequest) Map(java.util.Map) CloudLoadBalancer(com.sequenceiq.cloudbreak.cloud.model.CloudLoadBalancer) AwsTargetGroup(com.sequenceiq.cloudbreak.cloud.aws.common.loadbalancer.AwsTargetGroup) Splitter(com.google.common.base.Splitter) CommonStatus(com.sequenceiq.common.api.type.CommonStatus) DescribeFileSystemsResult(com.amazonaws.services.elasticfilesystem.model.DescribeFileSystemsResult) AmazonServiceException(com.amazonaws.AmazonServiceException) DescribeTargetHealthResult(com.amazonaws.services.elasticloadbalancingv2.model.DescribeTargetHealthResult) Collection(java.util.Collection) Output(com.amazonaws.services.cloudformation.model.Output) Set(java.util.Set) Retry(com.sequenceiq.cloudbreak.service.Retry) Collectors(java.util.stream.Collectors) Backoff(org.springframework.retry.annotation.Backoff) Objects(java.util.Objects) List(java.util.List) AmazonAutoScalingClient(com.sequenceiq.cloudbreak.cloud.aws.client.AmazonAutoScalingClient) Group(com.sequenceiq.cloudbreak.cloud.model.Group) PRIVATE_ID(com.sequenceiq.cloudbreak.cloud.model.CloudResource.PRIVATE_ID) LoadBalancerTypeConverter(com.sequenceiq.cloudbreak.cloud.aws.common.loadbalancer.LoadBalancerTypeConverter) DescribeTargetHealthRequest(com.amazonaws.services.elasticloadbalancingv2.model.DescribeTargetHealthRequest) LoadBalancer(com.amazonaws.services.elasticloadbalancingv2.model.LoadBalancer) TargetGroupPortPair(com.sequenceiq.cloudbreak.cloud.model.TargetGroupPortPair) INSTANCE_TYPE(com.sequenceiq.cloudbreak.cloud.model.CloudResource.INSTANCE_TYPE) DescribeStacksRequest(com.amazonaws.services.cloudformation.model.DescribeStacksRequest) AmazonElasticLoadBalancingClient(com.sequenceiq.cloudbreak.cloud.aws.common.client.AmazonElasticLoadBalancingClient) AmazonEfsClient(com.sequenceiq.cloudbreak.cloud.aws.common.client.AmazonEfsClient) Supplier(java.util.function.Supplier) DescribeLoadBalancersResult(com.amazonaws.services.elasticloadbalancingv2.model.DescribeLoadBalancersResult) ArrayList(java.util.ArrayList) Inject(javax.inject.Inject) Value(org.springframework.beans.factory.annotation.Value) CloudConnectorException(com.sequenceiq.cloudbreak.cloud.exception.CloudConnectorException) Service(org.springframework.stereotype.Service) DescribeAutoScalingGroupsResult(com.amazonaws.services.autoscaling.model.DescribeAutoScalingGroupsResult) AwsLoadBalancerScheme(com.sequenceiq.cloudbreak.cloud.aws.common.loadbalancer.AwsLoadBalancerScheme) Retryable(org.springframework.retry.annotation.Retryable) DescribeStackResourceRequest(com.amazonaws.services.cloudformation.model.DescribeStackResourceRequest) TargetDescription(com.amazonaws.services.elasticloadbalancingv2.model.TargetDescription) ResourceType(com.sequenceiq.common.api.type.ResourceType) Logger(org.slf4j.Logger) Iterator(java.util.Iterator) FileSystemDescription(com.amazonaws.services.elasticfilesystem.model.FileSystemDescription) CloudResource(com.sequenceiq.cloudbreak.cloud.model.CloudResource) DescribeFileSystemsRequest(com.amazonaws.services.elasticfilesystem.model.DescribeFileSystemsRequest) RegisterTargetsResult(com.amazonaws.services.elasticloadbalancingv2.model.RegisterTargetsResult) DescribeAutoScalingGroupsRequest(com.amazonaws.services.autoscaling.model.DescribeAutoScalingGroupsRequest) SdkClientException(com.amazonaws.SdkClientException) LoggerFactory.getLogger(org.slf4j.LoggerFactory.getLogger) Instance(com.amazonaws.services.autoscaling.model.Instance) DescribeStackResourceResult(com.amazonaws.services.cloudformation.model.DescribeStackResourceResult) Collections(java.util.Collections) DescribeTargetHealthRequest(com.amazonaws.services.elasticloadbalancingv2.model.DescribeTargetHealthRequest) Set(java.util.Set) AmazonElasticLoadBalancingClient(com.sequenceiq.cloudbreak.cloud.aws.common.client.AmazonElasticLoadBalancingClient) TargetDescription(com.amazonaws.services.elasticloadbalancingv2.model.TargetDescription) DescribeTargetHealthResult(com.amazonaws.services.elasticloadbalancingv2.model.DescribeTargetHealthResult) RegisterTargetsResult(com.amazonaws.services.elasticloadbalancingv2.model.RegisterTargetsResult) AwsCredentialView(com.sequenceiq.cloudbreak.cloud.aws.common.view.AwsCredentialView) RegisterTargetsRequest(com.amazonaws.services.elasticloadbalancingv2.model.RegisterTargetsRequest) Map(java.util.Map) TargetGroupPortPair(com.sequenceiq.cloudbreak.cloud.model.TargetGroupPortPair) AwsLoadBalancerScheme(com.sequenceiq.cloudbreak.cloud.aws.common.loadbalancer.AwsLoadBalancerScheme)

Example 2 with TargetDescription

use of com.amazonaws.services.elasticloadbalancingv2.model.TargetDescription in project cloudbreak by hortonworks.

the class AwsNativeLoadBalancerLaunchService method registerTarget.

private void registerTarget(AmazonElasticLoadBalancingClient loadBalancingClient, Long stackId, AwsTargetGroup targetGroup) {
    LOGGER.debug("Registering targets to target group '{}'", targetGroup.getArn());
    Set<TargetDescription> targetDescriptions = targetGroup.getInstanceIds().stream().map(privateId -> {
        String instanceId = persistenceRetriever.notifyRetrieve(stackId, privateId, CommonStatus.CREATED, ResourceType.AWS_INSTANCE).orElseThrow(() -> {
            String notFoundMsg = String.format("No AWS instance resource found with private id('%s') for stack('%s')", privateId, stackId);
            return new CloudConnectorException(notFoundMsg);
        }).getInstanceId();
        return new TargetDescription().withPort(targetGroup.getPort()).withId(instanceId);
    }).collect(toSet());
    RegisterTargetsRequest registerTargetsRequest = new RegisterTargetsRequest().withTargetGroupArn(targetGroup.getArn()).withTargets(targetDescriptions);
    LOGGER.info("Registering target group of load balancer('{}') to instances: '{}'", targetGroup.getArn(), String.join(",", targetGroup.getInstanceIds()));
    loadBalancingClient.registerTargets(registerTargetsRequest);
}
Also used : AwsResourceNameService(com.sequenceiq.cloudbreak.cloud.aws.common.service.AwsResourceNameService) CloudContext(com.sequenceiq.cloudbreak.cloud.context.CloudContext) CreateTargetGroupResult(com.amazonaws.services.elasticloadbalancingv2.model.CreateTargetGroupResult) RegisterTargetsRequest(com.amazonaws.services.elasticloadbalancingv2.model.RegisterTargetsRequest) LoggerFactory(org.slf4j.LoggerFactory) DescribeListenersResult(com.amazonaws.services.elasticloadbalancingv2.model.DescribeListenersResult) DescribeLoadBalancersRequest(com.amazonaws.services.elasticloadbalancingv2.model.DescribeLoadBalancersRequest) CreateListenerResult(com.amazonaws.services.elasticloadbalancingv2.model.CreateListenerResult) StringUtils(org.apache.commons.lang3.StringUtils) AwsListener(com.sequenceiq.cloudbreak.cloud.aws.common.loadbalancer.AwsListener) DescribeTargetGroupsRequest(com.amazonaws.services.elasticloadbalancingv2.model.DescribeTargetGroupsRequest) AuthenticatedContext(com.sequenceiq.cloudbreak.cloud.context.AuthenticatedContext) Map(java.util.Map) AwsTargetGroup(com.sequenceiq.cloudbreak.cloud.aws.common.loadbalancer.AwsTargetGroup) Collectors.toSet(java.util.stream.Collectors.toSet) CommonStatus(com.sequenceiq.common.api.type.CommonStatus) ResourceStatus(com.sequenceiq.cloudbreak.cloud.model.ResourceStatus) DescribeTargetGroupsResult(com.amazonaws.services.elasticloadbalancingv2.model.DescribeTargetGroupsResult) AmazonServiceException(com.amazonaws.AmazonServiceException) Action(com.amazonaws.services.elasticloadbalancingv2.model.Action) Collection(java.util.Collection) CloudResourceStatus(com.sequenceiq.cloudbreak.cloud.model.CloudResourceStatus) Set(java.util.Set) LoadBalancerTypeEnum(com.amazonaws.services.elasticloadbalancingv2.model.LoadBalancerTypeEnum) Collectors(java.util.stream.Collectors) CreateLoadBalancerRequest(com.amazonaws.services.elasticloadbalancingv2.model.CreateLoadBalancerRequest) CloudStack(com.sequenceiq.cloudbreak.cloud.model.CloudStack) List(java.util.List) IpAddressType(com.amazonaws.services.elasticloadbalancingv2.model.IpAddressType) Tag(com.amazonaws.services.elasticloadbalancingv2.model.Tag) Group(com.sequenceiq.cloudbreak.cloud.model.Group) DescribeListenersRequest(com.amazonaws.services.elasticloadbalancingv2.model.DescribeListenersRequest) Optional(java.util.Optional) CreateListenerRequest(com.amazonaws.services.elasticloadbalancingv2.model.CreateListenerRequest) AmazonElasticLoadBalancingClient(com.sequenceiq.cloudbreak.cloud.aws.common.client.AmazonElasticLoadBalancingClient) DescribeLoadBalancersResult(com.amazonaws.services.elasticloadbalancingv2.model.DescribeLoadBalancersResult) ArrayList(java.util.ArrayList) TargetTypeEnum(com.amazonaws.services.elasticloadbalancingv2.model.TargetTypeEnum) Inject(javax.inject.Inject) CloudConnectorException(com.sequenceiq.cloudbreak.cloud.exception.CloudConnectorException) PersistenceRetriever(com.sequenceiq.cloudbreak.cloud.notification.PersistenceRetriever) AwsNetworkView(com.sequenceiq.cloudbreak.cloud.aws.common.view.AwsNetworkView) AwsLoadBalancerCommonService(com.sequenceiq.cloudbreak.cloud.aws.common.connector.resource.AwsLoadBalancerCommonService) Service(org.springframework.stereotype.Service) CreateLoadBalancerResult(com.amazonaws.services.elasticloadbalancingv2.model.CreateLoadBalancerResult) AwsLoadBalancerScheme(com.sequenceiq.cloudbreak.cloud.aws.common.loadbalancer.AwsLoadBalancerScheme) TargetDescription(com.amazonaws.services.elasticloadbalancingv2.model.TargetDescription) ResourceType(com.sequenceiq.common.api.type.ResourceType) Logger(org.slf4j.Logger) ActionTypeEnum(com.amazonaws.services.elasticloadbalancingv2.model.ActionTypeEnum) CloudResource(com.sequenceiq.cloudbreak.cloud.model.CloudResource) CreateTargetGroupRequest(com.amazonaws.services.elasticloadbalancingv2.model.CreateTargetGroupRequest) ProtocolEnum(com.amazonaws.services.elasticloadbalancingv2.model.ProtocolEnum) PersistenceNotifier(com.sequenceiq.cloudbreak.cloud.notification.PersistenceNotifier) Collectors.toList(java.util.stream.Collectors.toList) AwsCloudStackView(com.sequenceiq.cloudbreak.cloud.aws.view.AwsCloudStackView) AwsLoadBalancer(com.sequenceiq.cloudbreak.cloud.aws.common.loadbalancer.AwsLoadBalancer) AwsTaggingService(com.sequenceiq.cloudbreak.cloud.aws.common.AwsTaggingService) CloudConnectorException(com.sequenceiq.cloudbreak.cloud.exception.CloudConnectorException) RegisterTargetsRequest(com.amazonaws.services.elasticloadbalancingv2.model.RegisterTargetsRequest) TargetDescription(com.amazonaws.services.elasticloadbalancingv2.model.TargetDescription)

Example 3 with TargetDescription

use of com.amazonaws.services.elasticloadbalancingv2.model.TargetDescription in project cloudbreak by hortonworks.

the class LoadBalancerService method removeLoadBalancerTargets.

public void removeLoadBalancerTargets(AuthenticatedContext ac, List<String> targetGroupArns, List<CloudResource> resourcesToRemove) {
    if (targetGroupArns.isEmpty()) {
        LOGGER.info("Cannot find target group for the stack, skip the removing of the targets");
        return;
    }
    for (String targetGroupArn : targetGroupArns) {
        String region = ac.getCloudContext().getLocation().getRegion().value();
        AmazonElasticLoadBalancingClient amazonElbClient = awsClient.createElasticLoadBalancingClient(new AwsCredentialView(ac.getCloudCredential()), region);
        LOGGER.debug("Get a list of the instance ids to remove");
        Set<String> instancesToRemove = getInstanceIdsForGroups(resourcesToRemove);
        LOGGER.debug("Deregister any instances that no longer exist");
        if (!instancesToRemove.isEmpty()) {
            try {
                List<TargetDescription> targetsToRemove = instancesToRemove.stream().map(instanceId -> new TargetDescription().withId(instanceId)).collect(Collectors.toList());
                amazonElbClient.deregisterTargets(new DeregisterTargetsRequest().withTargetGroupArn(targetGroupArn).withTargets(targetsToRemove));
                LOGGER.debug("Targets deregistered: {}", targetsToRemove);
            } catch (InvalidTargetException ignored) {
                LOGGER.debug("no-op - we tried to remove a target that wasn't in the target group, which is fine");
            }
        }
    }
}
Also used : AwsCredentialView(com.sequenceiq.cloudbreak.cloud.aws.common.view.AwsCredentialView) Logger(org.slf4j.Logger) AmazonElasticLoadBalancingClient(com.sequenceiq.cloudbreak.cloud.aws.common.client.AmazonElasticLoadBalancingClient) CloudResource(com.sequenceiq.cloudbreak.cloud.model.CloudResource) DeregisterTargetsRequest(com.amazonaws.services.elasticloadbalancingv2.model.DeregisterTargetsRequest) Set(java.util.Set) Collectors(java.util.stream.Collectors) Inject(javax.inject.Inject) List(java.util.List) Component(org.springframework.stereotype.Component) AwsCredentialView(com.sequenceiq.cloudbreak.cloud.aws.common.view.AwsCredentialView) AuthenticatedContext(com.sequenceiq.cloudbreak.cloud.context.AuthenticatedContext) LoggerFactory.getLogger(org.slf4j.LoggerFactory.getLogger) InvalidTargetException(com.amazonaws.services.elasticloadbalancingv2.model.InvalidTargetException) CommonAwsClient(com.sequenceiq.cloudbreak.cloud.aws.common.CommonAwsClient) TargetDescription(com.amazonaws.services.elasticloadbalancingv2.model.TargetDescription) InvalidTargetException(com.amazonaws.services.elasticloadbalancingv2.model.InvalidTargetException) AmazonElasticLoadBalancingClient(com.sequenceiq.cloudbreak.cloud.aws.common.client.AmazonElasticLoadBalancingClient) TargetDescription(com.amazonaws.services.elasticloadbalancingv2.model.TargetDescription) DeregisterTargetsRequest(com.amazonaws.services.elasticloadbalancingv2.model.DeregisterTargetsRequest)

Example 4 with TargetDescription

use of com.amazonaws.services.elasticloadbalancingv2.model.TargetDescription in project titus-control-plane by Netflix.

the class AwsLoadBalancerConnector method registerAll.

@Override
public Completable registerAll(String loadBalancerId, Set<String> ipAddresses) {
    if (CollectionsExt.isNullOrEmpty(ipAddresses)) {
        return Completable.complete();
    }
    // TODO: retry logic
    // TODO: handle partial failures in the batch
    // TODO: timeouts
    final Set<TargetDescription> targetDescriptions = ipAddresses.stream().map(ipAddress -> new TargetDescription().withId(ipAddress)).collect(Collectors.toSet());
    final RegisterTargetsRequest request = new RegisterTargetsRequest().withTargetGroupArn(loadBalancerId).withTargets(targetDescriptions);
    long startTime = registry.clock().wallTime();
    // force observeOn(scheduler) since the callback will be called from the AWS SDK threadpool
    return AwsObservableExt.asyncActionCompletable(factory -> getClient(loadBalancerId).registerTargetsAsync(request, factory.handler((req, resp) -> {
        logger.debug("Registered targets {}", resp);
        connectorMetrics.success(AwsLoadBalancerConnectorMetrics.AwsLoadBalancerMethods.RegisterTargets, startTime);
    }, (t) -> {
        logger.error("Error registering targets on " + loadBalancerId, t);
        connectorMetrics.failure(AwsLoadBalancerConnectorMetrics.AwsLoadBalancerMethods.RegisterTargets, t, startTime);
    }))).observeOn(scheduler);
}
Also used : DescribeTargetHealthRequest(com.amazonaws.services.elasticloadbalancingv2.model.DescribeTargetHealthRequest) Completable(rx.Completable) LoadBalancerConnector(com.netflix.titus.api.connector.cloud.LoadBalancerConnector) DeregisterTargetsRequest(com.amazonaws.services.elasticloadbalancingv2.model.DeregisterTargetsRequest) RegisterTargetsRequest(com.amazonaws.services.elasticloadbalancingv2.model.RegisterTargetsRequest) CollectionsExt(com.netflix.titus.common.util.CollectionsExt) ProxyType(com.netflix.titus.common.util.guice.ProxyType) LoggerFactory(org.slf4j.LoggerFactory) Singleton(javax.inject.Singleton) Observable(rx.Observable) Inject(javax.inject.Inject) TargetGroupNotFoundException(com.amazonaws.services.elasticloadbalancingv2.model.TargetGroupNotFoundException) Single(rx.Single) DescribeTargetGroupsRequest(com.amazonaws.services.elasticloadbalancingv2.model.DescribeTargetGroupsRequest) CloudConnectorException(com.netflix.titus.api.connector.cloud.CloudConnectorException) Schedulers(rx.schedulers.Schedulers) AmazonElasticLoadBalancingAsync(com.amazonaws.services.elasticloadbalancingv2.AmazonElasticLoadBalancingAsync) TargetDescription(com.amazonaws.services.elasticloadbalancingv2.model.TargetDescription) DescribeTargetGroupsResult(com.amazonaws.services.elasticloadbalancingv2.model.DescribeTargetGroupsResult) Logger(org.slf4j.Logger) DescribeTargetHealthResult(com.amazonaws.services.elasticloadbalancingv2.model.DescribeTargetHealthResult) AmazonClientProvider(com.netflix.titus.ext.aws.AmazonClientProvider) Set(java.util.Set) LoadBalancer(com.netflix.titus.api.connector.cloud.LoadBalancer) AwsObservableExt(com.netflix.titus.ext.aws.AwsObservableExt) Scheduler(rx.Scheduler) Collectors(java.util.stream.Collectors) Registry(com.netflix.spectator.api.Registry) ProxyConfiguration(com.netflix.titus.common.util.guice.annotation.ProxyConfiguration) Arn(com.amazonaws.arn.Arn) Collections(java.util.Collections) RegisterTargetsRequest(com.amazonaws.services.elasticloadbalancingv2.model.RegisterTargetsRequest) TargetDescription(com.amazonaws.services.elasticloadbalancingv2.model.TargetDescription)

Example 5 with TargetDescription

use of com.amazonaws.services.elasticloadbalancingv2.model.TargetDescription in project titus-control-plane by Netflix.

the class AwsLoadBalancerConnector method deregisterAll.

@Override
public Completable deregisterAll(String loadBalancerId, Set<String> ipAddresses) {
    if (CollectionsExt.isNullOrEmpty(ipAddresses)) {
        return Completable.complete();
    }
    // TODO: retry logic
    // TODO: handle partial failures in the batch
    // TODO: timeouts
    final DeregisterTargetsRequest request = new DeregisterTargetsRequest().withTargetGroupArn(loadBalancerId).withTargets(ipAddresses.stream().map(ipAddress -> new TargetDescription().withId(ipAddress)).collect(Collectors.toSet()));
    long startTime = registry.clock().wallTime();
    // force observeOn(scheduler) since the callback will be called from the AWS SDK threadpool
    return AwsObservableExt.asyncActionCompletable(supplier -> getClient(loadBalancerId).deregisterTargetsAsync(request, supplier.handler((req, resp) -> {
        logger.debug("Deregistered targets {}", resp);
        connectorMetrics.success(AwsLoadBalancerConnectorMetrics.AwsLoadBalancerMethods.DeregisterTargets, startTime);
    }, (t) -> {
        logger.error("Error deregistering targets on " + loadBalancerId, t);
        connectorMetrics.failure(AwsLoadBalancerConnectorMetrics.AwsLoadBalancerMethods.DeregisterTargets, t, startTime);
    }))).observeOn(scheduler);
}
Also used : DescribeTargetHealthRequest(com.amazonaws.services.elasticloadbalancingv2.model.DescribeTargetHealthRequest) Completable(rx.Completable) LoadBalancerConnector(com.netflix.titus.api.connector.cloud.LoadBalancerConnector) DeregisterTargetsRequest(com.amazonaws.services.elasticloadbalancingv2.model.DeregisterTargetsRequest) RegisterTargetsRequest(com.amazonaws.services.elasticloadbalancingv2.model.RegisterTargetsRequest) CollectionsExt(com.netflix.titus.common.util.CollectionsExt) ProxyType(com.netflix.titus.common.util.guice.ProxyType) LoggerFactory(org.slf4j.LoggerFactory) Singleton(javax.inject.Singleton) Observable(rx.Observable) Inject(javax.inject.Inject) TargetGroupNotFoundException(com.amazonaws.services.elasticloadbalancingv2.model.TargetGroupNotFoundException) Single(rx.Single) DescribeTargetGroupsRequest(com.amazonaws.services.elasticloadbalancingv2.model.DescribeTargetGroupsRequest) CloudConnectorException(com.netflix.titus.api.connector.cloud.CloudConnectorException) Schedulers(rx.schedulers.Schedulers) AmazonElasticLoadBalancingAsync(com.amazonaws.services.elasticloadbalancingv2.AmazonElasticLoadBalancingAsync) TargetDescription(com.amazonaws.services.elasticloadbalancingv2.model.TargetDescription) DescribeTargetGroupsResult(com.amazonaws.services.elasticloadbalancingv2.model.DescribeTargetGroupsResult) Logger(org.slf4j.Logger) DescribeTargetHealthResult(com.amazonaws.services.elasticloadbalancingv2.model.DescribeTargetHealthResult) AmazonClientProvider(com.netflix.titus.ext.aws.AmazonClientProvider) Set(java.util.Set) LoadBalancer(com.netflix.titus.api.connector.cloud.LoadBalancer) AwsObservableExt(com.netflix.titus.ext.aws.AwsObservableExt) Scheduler(rx.Scheduler) Collectors(java.util.stream.Collectors) Registry(com.netflix.spectator.api.Registry) ProxyConfiguration(com.netflix.titus.common.util.guice.annotation.ProxyConfiguration) Arn(com.amazonaws.arn.Arn) Collections(java.util.Collections) DeregisterTargetsRequest(com.amazonaws.services.elasticloadbalancingv2.model.DeregisterTargetsRequest) TargetDescription(com.amazonaws.services.elasticloadbalancingv2.model.TargetDescription)

Aggregations

TargetDescription (com.amazonaws.services.elasticloadbalancingv2.model.TargetDescription)9 DescribeTargetHealthRequest (com.amazonaws.services.elasticloadbalancingv2.model.DescribeTargetHealthRequest)6 Set (java.util.Set)6 Collectors (java.util.stream.Collectors)6 Inject (javax.inject.Inject)6 Logger (org.slf4j.Logger)6 RegisterTargetsRequest (com.amazonaws.services.elasticloadbalancingv2.model.RegisterTargetsRequest)5 DescribeInstancesRequest (com.amazonaws.services.ec2.model.DescribeInstancesRequest)4 DeregisterTargetsRequest (com.amazonaws.services.elasticloadbalancingv2.model.DeregisterTargetsRequest)4 AmazonElasticLoadBalancingClient (com.sequenceiq.cloudbreak.cloud.aws.common.client.AmazonElasticLoadBalancingClient)4 AuthenticatedContext (com.sequenceiq.cloudbreak.cloud.context.AuthenticatedContext)4 CloudResource (com.sequenceiq.cloudbreak.cloud.model.CloudResource)4 List (java.util.List)4 DescribeTargetHealthResult (com.amazonaws.services.elasticloadbalancingv2.model.DescribeTargetHealthResult)3 TargetHealthDescription (com.amazonaws.services.elasticloadbalancingv2.model.TargetHealthDescription)3 Collections (java.util.Collections)3 AmazonServiceException (com.amazonaws.AmazonServiceException)2 Arn (com.amazonaws.arn.Arn)2 Instance (com.amazonaws.services.ec2.model.Instance)2 Reservation (com.amazonaws.services.ec2.model.Reservation)2