Class: Aws::Elb::QElbDescribeLoadBalancersParser

Inherits:
AwsParser show all
Defined in:
lib/elb/elb_interface.rb

Constant Summary

Constants inherited from AwsParser

AwsParser::DEFAULT_XML_LIBRARY

Instance Attribute Summary

Attributes inherited from AwsParser

#result, #xml_lib, #xmlpath

Instance Method Summary collapse

Methods inherited from AwsParser

#initialize, #method_missing, #parse, #tag_end, #tag_start, #tagtext, #text, xml_lib, xml_lib=

Constructor Details

This class inherits a constructor from Aws::AwsParser

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Aws::AwsParser

Instance Method Details

#resetObject



221
222
223
# File 'lib/elb/elb_interface.rb', line 221

def reset
    @result = []
end

#tagend(name) ⇒ Object



243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
# File 'lib/elb/elb_interface.rb', line 243

def tagend(name)
    case name
        when 'LoadBalancerName' then
            @member[:load_balancer_name] = @text
            @member[:name] = @text
        when 'CreatedTime' then
            @member[:created_time] = Time.parse(@text)
            @member[:created] = @member[:created_time]
        when 'DNSName' then
            @member[:dns_name] = @text
        # Instances
        when 'InstanceId' then
            @instance[:instance_id] = @text
        # Listeners
        when 'Protocol' then
            @listener[:protocol] = @text
        when 'LoadBalancerPort' then
            @listener[:load_balancer_port] = @text.to_i
        when 'InstancePort' then
            @listener[:instance_port] = @text.to_i
        # HEALTH CHECK STUFF
        when 'Interval' then
            @member[:health_check][:interval] = @text.to_i
        when 'Target' then
            @member[:health_check][:target] = @text
        when 'HealthyThreshold' then
            @member[:health_check][:healthy_threshold] = @text.to_i
        when 'Timeout' then
            @member[:health_check][:timeout] = @text.to_i
        when 'UnhealthyThreshold' then
            @member[:health_check][:unhealthy_threshold] = @text.to_i
        # AvailabilityZones
        when 'member' then
            if @xmlpath == 'DescribeLoadBalancersResponse/DescribeLoadBalancersResult/LoadBalancerDescriptions/member/Listeners'
                @member[:listeners] << @listener
            elsif @xmlpath == 'DescribeLoadBalancersResponse/DescribeLoadBalancersResult/LoadBalancerDescriptions/member/AvailabilityZones'
                @availability_zone = @text
                @member[:availability_zones] << @availability_zone
            elsif @xmlpath == 'DescribeLoadBalancersResponse/DescribeLoadBalancersResult/LoadBalancerDescriptions/member/Instances'
                @member[:instances] << @instance
            elsif @xmlpath == 'DescribeLoadBalancersResponse/DescribeLoadBalancersResult/LoadBalancerDescriptions'
                @result << @member
            end

    end
end

#tagstart(name, attributes) ⇒ Object



225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/elb/elb_interface.rb', line 225

def tagstart(name, attributes)
#                puts 'tagstart ' + name + ' -- ' + @xmlpath
    if (name == 'member' && @xmlpath == 'DescribeLoadBalancersResponse/DescribeLoadBalancersResult/LoadBalancerDescriptions/member/Listeners')
        @listener = { }
    end
    if (name == 'member' && @xmlpath == 'DescribeLoadBalancersResponse/DescribeLoadBalancersResult/LoadBalancerDescriptions/member/AvailabilityZones')
        @availability_zone = { }
    end
    if (name == 'member' && @xmlpath == 'DescribeLoadBalancersResponse/DescribeLoadBalancersResult/LoadBalancerDescriptions/member/Instances')
        @instance = {}
    end
    if (name == 'member' && @xmlpath == 'DescribeLoadBalancersResponse/DescribeLoadBalancersResult/LoadBalancerDescriptions')
        @member = { :listeners=>[], :availability_zones=>[], :health_check=>{}, :instances=>[] }
    end

end