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,12 +19,21 @@ module Fog
|
|||
Fog::AWS::ELB::Real.new(options)
|
||||
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
|
||||
|
||||
# Initialize connection to ELB
|
||||
#
|
||||
# ==== Notes
|
||||
# options parameter must include values for :aws_access_key_id and
|
||||
# options parameter must include values for :aws_access_key_id and
|
||||
# :aws_secret_access_key in order to create a connection
|
||||
#
|
||||
# ==== Examples
|
||||
|
|
|
@ -36,7 +36,7 @@ module Fog
|
|||
# * 'AvailabilityZones'<~Array> - list of availability zones covered by this load balancer
|
||||
# * 'Instances'<~Array> - list of instances that the load balancer balances between
|
||||
def describe_load_balancers(lb_name = [])
|
||||
params = AWS.indexed_param('LoadBalancerNames.member', [*lb_name])
|
||||
params = ELB.indexed_param('LoadBalancerNames.member', [*lb_name], 1)
|
||||
request({
|
||||
'Action' => 'DescribeLoadBalancers',
|
||||
:parser => Fog::Parsers::AWS::ELB::DescribeLoadBalancers.new
|
||||
|
|
Loading…
Reference in a new issue