mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[elb] Adding ELB-specific indexed_param
This commit is contained in:
parent
63415a4748
commit
fc29d82c4d
2 changed files with 11 additions and 2 deletions
|
@ -19,6 +19,15 @@ module Fog
|
||||||
Fog::AWS::ELB::Real.new(options)
|
Fog::AWS::ELB::Real.new(options)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.indexed_param(key, values, idx_offset = 0)
|
||||||
|
params = {}
|
||||||
|
key.concat(".%") unless key.include?("%")
|
||||||
|
[*values].each_with_index do |value, index|
|
||||||
|
params["#{key.gsub("%", (index + idx_offset).to_s)}"] = value
|
||||||
|
end
|
||||||
|
return params
|
||||||
|
end
|
||||||
|
|
||||||
class Real
|
class Real
|
||||||
|
|
||||||
# Initialize connection to ELB
|
# Initialize connection to ELB
|
||||||
|
|
|
@ -36,7 +36,7 @@ module Fog
|
||||||
# * 'AvailabilityZones'<~Array> - list of availability zones covered by this load balancer
|
# * 'AvailabilityZones'<~Array> - list of availability zones covered by this load balancer
|
||||||
# * 'Instances'<~Array> - list of instances that the load balancer balances between
|
# * 'Instances'<~Array> - list of instances that the load balancer balances between
|
||||||
def describe_load_balancers(lb_name = [])
|
def describe_load_balancers(lb_name = [])
|
||||||
params = AWS.indexed_param('LoadBalancerNames.member', [*lb_name])
|
params = ELB.indexed_param('LoadBalancerNames.member', [*lb_name], 1)
|
||||||
request({
|
request({
|
||||||
'Action' => 'DescribeLoadBalancers',
|
'Action' => 'DescribeLoadBalancers',
|
||||||
:parser => Fog::Parsers::AWS::ELB::DescribeLoadBalancers.new
|
:parser => Fog::Parsers::AWS::ELB::DescribeLoadBalancers.new
|
||||||
|
|
Loading…
Reference in a new issue