【问题标题】:ElasticLoadBalancingV2 describe_load_balancers not returning results in ruby aws sdkElasticLoadBalancingV2 describe_load_balancers 未在 ruby​​ aws sdk 中返回结果
【发布时间】:2018-01-13 05:02:46
【问题描述】:

我正在尝试使用 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 中提到了。

【问题讨论】:

    标签: ruby amazon-web-services amazon-ec2


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-03-29
      • 2015-09-03
      • 1970-01-01
      • 2017-01-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多