aws 2.1.2 → 2.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/elb/right_elb_interface.rb +37 -16
  2. metadata +1 -1
@@ -129,10 +129,11 @@ module Aws
129
129
  end
130
130
 
131
131
 
132
- def describe_load_balancers
132
+ def describe_load_balancers(lparams={})
133
133
  @logger.info("Describing Load Balancers")
134
134
 
135
135
  params = {}
136
+ params.update( hash_params('LoadBalancerNames.member', lparams[:names]) ) if lparams[:names]
136
137
 
137
138
  link = generate_request("DescribeLoadBalancers", params)
138
139
 
@@ -151,7 +152,7 @@ module Aws
151
152
  class QElbCreateParser < AwsParser
152
153
 
153
154
  def reset
154
- @result = {}
155
+ @result = []
155
156
  end
156
157
 
157
158
 
@@ -166,41 +167,61 @@ module Aws
166
167
  class QElbDescribeLoadBalancersParser < AwsParser
167
168
 
168
169
  def reset
169
- @result = {}
170
+ @result = []
171
+ end
172
+
173
+ def tagstart(name, attributes)
174
+ if (name == 'member' && @xmlpath == 'DescribeLoadBalancersResult/LoadBalancersDescriptions')
175
+ @member = { :listeners=>[], :availability_zones=>[], :health_check=>{} }
176
+ end
177
+ if (name == 'member' && @xmlpath == 'DescribeLoadBalancersResult/LoadBalancersDescriptions/member/Listeners')
178
+ @listener = { }
179
+ end
180
+ if (name == 'member' && @xmlpath == 'DescribeLoadBalancersResult/LoadBalancersDescriptions/member/AvailabilityZones')
181
+ @availability_zone = { }
182
+ end
183
+
170
184
  end
171
185
 
172
186
 
173
187
  def tagend(name)
174
188
  case name
175
189
  when 'LoadBalancerName' then
176
- @result[:load_balancer_name] = @text
190
+ @member[:load_balancer_name] = @text
177
191
  # when 'AvailabilityZones' then
178
192
  # @result[:availability_zones] = @text
179
193
  when 'CreatedTime' then
180
- @result[:created_time] = Time.parse(@text)
194
+ @member[:created_time] = Time.parse(@text)
181
195
  when 'DNSName' then
182
- @result[:dns_name] = @text
196
+ @member[:dns_name] = @text
197
+ # Listeners
183
198
  when 'Protocol' then
184
- @result[:protocol] = @text
199
+ @listener[:protocol] = @text
185
200
  when 'LoadBalancerPort' then
186
- @result[:load_balancer_port] = @text.to_i
201
+ @listener[:load_balancer_port] = @text.to_i
187
202
  when 'InstancePort' then
188
- @result[:instance_port] = @text.to_i
203
+ @listener[:instance_port] = @text.to_i
189
204
  # HEALTH CHECK STUFF
190
205
  when 'Interval' then
191
- @result[:interval] = @text.to_i
206
+ @member[:health_check][:interval] = @text.to_i
192
207
  when 'Target' then
193
- @result[:target] = @text
208
+ @member[:health_check][:target] = @text
194
209
  when 'HealthyThreshold' then
195
- @result[:healthy_threshold] = @text.to_i
210
+ @member[:health_check][:healthy_threshold] = @text.to_i
196
211
  when 'Timeout' then
197
- @result[:timeout] = @text.to_i
212
+ @member[:health_check][:timeout] = @text.to_i
198
213
  when 'UnhealthyThreshold' then
199
- @result[:unhealthy_threshold] = @text.to_i
214
+ @member[:health_check][:unhealthy_threshold] = @text.to_i
200
215
  # AvailabilityZones
201
216
  when 'member' then
202
- @result[:availability_zones] = [] unless @result[:availability_zones]
203
- @result[:availability_zones] << @text
217
+ if @xmlpath == 'DescribeLoadBalancersResult/LoadBalancersDescriptions/member/Listeners'
218
+ @member[:listeners] << @listener
219
+ elsif @xmlpath == 'DescribeLoadBalancersResult/LoadBalancersDescriptions/member/AvailabilityZones'
220
+ @availability_zone = @text
221
+ @member[:availability_zones] << @availability_zone
222
+ elsif @xmlpath == 'DescribeLoadBalancersResult/LoadBalancersDescriptions'
223
+ @result << @member
224
+ end
204
225
 
205
226
  end
206
227
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Travis Reeder