gpt4 book ai didi

ruby - ElasticLoadBalancingV2 describe_load_balancers 未在 ruby​​ aws sdk 中返回结果

转载 作者:太空宇宙 更新时间:2023-11-03 17:43:27 24 4
gpt4 key购买 nike

我正在尝试使用 ElasticLoadBalancing API 的 V2 版本,因为 V1 版本不返回 ARN。我在下面的代码片段中归结了我的问题:

client = Aws::ElasticLoadBalancing::Client.new(region: "us-east-1")
resp = client.describe_load_balancers
puts("V1: Number of load balancers returned: #{resp.load_balancer_descriptions.length}")

输出:9

client = Aws::ElasticLoadBalancingV2::Client.new(region: "us-east-1")
resp = client.describe_load_balancers
puts("V2: Number of load balancers returned: #{resp.load_balancers.length}")

输出:0

事实上,这个账户确实有 9 个负载均衡器。

我正在使用 aws-sdk-core-2.10.90。

更新

感谢约翰的回答。我没有在 ruby sdk documentation 中找到这个, 但在他们的 main web service documentation page 中被提及.

最佳答案

V1 API 适用于 Classic Load Balancer。 V2 适用于应用程序和网络负载均衡器。

关于ruby - ElasticLoadBalancingV2 describe_load_balancers 未在 ruby​​ aws sdk 中返回结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48229701/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com