简体   繁体   English

如何使用AWS Java Elastic Load Balancer SDK检查负载均衡器的状态

[英]How to check the status of loadbalancer with AWS Java Elastic Load Balancer SDK

I have a cli command which I am trying to convert Java SDK: 我有一个cli命令,我正在尝试转换Java SDK:

aws elb wait any-instance-in-service --load-balancer-name $lb_name --profile $AWS_PROFILE

which should report that the load balancer created by EKS is running and ready. 它应该报告由EKS创建的负载均衡器正在运行并准备就绪。

I am using: 我在用:

ElasticLoadBalancingV2Client

with gradle: 与gradle:

dependencyManagement {
    imports {
        mavenBom 'software.amazon.awssdk:bom:2.4.4'
    }
}
    compile 'software.amazon.awssdk:elasticloadbalancingv2'

So far the SDK appears to provide just about anything but give the status of a load balancer. 到目前为止,SDK似乎除了提供负载均衡器的状态外,几乎不提供任何其他功能。

I am investigating 我正在调查

describeLoadBalancerAttributes

right now, but if anyone found the needle before myself would very much appreciate the help. 现在,但是如果有人在我之前发现了针,将非常感谢您的帮助。

I need equivalent of this: https://docs.aws.amazon.com/cli/latest/reference/elbv2/wait/load-balancer-available.html 我需要这样的东西: https : //docs.aws.amazon.com/cli/latest/reference/elbv2/wait/load-balancer-available.html

or this (older version I guess) https://docs.aws.amazon.com/cli/latest/reference/elb/wait/instance-in-service.html 或这个(我猜是旧版本) https://docs.aws.amazon.com/cli/latest/reference/elb/wait/instance-in-service.html

I found it on the very link I posted :facepalm: https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html 我在发布的链接上找到了它:facepalm: https ://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html

Will add details later when will have the code(or you can beat me to that) and I will accept your answer instead. 稍后会在有代码时添加详细信息(或者您可以击败我),我将接受您的回答。 Thanks. 谢谢。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM