Search in sources :

Example 1 with DeleteLoadBalancerRequest

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

the class AwsNativeLoadBalancerResourceBuilder method delete.

@Override
public CloudResource delete(AwsContext context, AuthenticatedContext auth, CloudResource resource) throws Exception {
    LOGGER.info("Deleting load balancer ('{}') from provider side", resource.getReference());
    AmazonElasticLoadBalancingClient loadBalancingClient = context.getLoadBalancingClient();
    DeleteLoadBalancerRequest deleteLoadBalancerRequest = new DeleteLoadBalancerRequest().withLoadBalancerArn(resource.getReference());
    DeleteLoadBalancerResult deleteResult = awsMethodExecutor.execute(() -> loadBalancingClient.deleteLoadBalancer(deleteLoadBalancerRequest), null);
    return deleteResult != null ? resource : null;
}
Also used : AmazonElasticLoadBalancingClient(com.sequenceiq.cloudbreak.cloud.aws.common.client.AmazonElasticLoadBalancingClient) DeleteLoadBalancerRequest(com.amazonaws.services.elasticloadbalancingv2.model.DeleteLoadBalancerRequest) DeleteLoadBalancerResult(com.amazonaws.services.elasticloadbalancingv2.model.DeleteLoadBalancerResult)

Aggregations

DeleteLoadBalancerRequest (com.amazonaws.services.elasticloadbalancingv2.model.DeleteLoadBalancerRequest)1 DeleteLoadBalancerResult (com.amazonaws.services.elasticloadbalancingv2.model.DeleteLoadBalancerResult)1 AmazonElasticLoadBalancingClient (com.sequenceiq.cloudbreak.cloud.aws.common.client.AmazonElasticLoadBalancingClient)1