Class: RightAws::ElbInterface::DescribeLoadBalancersParser

Inherits:
RightAWSParser show all
Defined in:
lib/elb/right_elb_interface.rb

Overview


PARSERS: Load Balancers

Constant Summary

Constants inherited from RightAWSParser

RightAWSParser::DEFAULT_XML_LIBRARY

Instance Attribute Summary

Attributes inherited from RightAWSParser

#full_tag_name, #result, #tag, #xml_lib, #xmlpath

Instance Method Summary collapse

Methods inherited from RightAWSParser

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

Constructor Details

This class inherits a constructor from RightAws::RightAWSParser

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RightAws::RightAWSParser

Instance Method Details

#resetObject



412
413
414
# File 'lib/elb/right_elb_interface.rb', line 412

def reset
  @result = []
end

#tagend(name) ⇒ Object



375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
# File 'lib/elb/right_elb_interface.rb', line 375

def tagend(name)
  case name
  when 'LoadBalancerName'   then @item[:load_balancer_name]   = @text
  when 'DNSName'            then @item[:dns_name]             = @text
  when 'CreatedTime'        then @item[:created_time]         = @text
  when 'Interval'           then @item[:health_check][:interval]            = @text.to_i
  when 'Target'             then @item[:health_check][:target]              = @text
  when 'HealthyThreshold'   then @item[:health_check][:healthy_threshold]   = @text.to_i
  when 'Timeout'            then @item[:health_check][:timeout]             = @text.to_i
  when 'UnhealthyThreshold' then @item[:health_check][:unhealthy_threshold] = @text.to_i       
  when 'Protocol'           then @listener[:protocol]           = @text
  when 'LoadBalancerPort'   then @listener[:load_balancer_port] = @text
  when 'InstancePort'       then @listener[:instance_port]      = @text
  end
  case full_tag_name
  when %r{AvailabilityZones/member$}    then @item[:availability_zones] << @text
  when %r{Instances/member/InstanceId$} then @item[:instances]          << @text
  when %r{ListenerDescriptions/member$} then @item[:listeners]          << @listener
  when %r{ListenerDescriptions/member/PolicyNames/member$} then @listener[:policy_names] << @text
  when %r{AppCookieStickinessPolicies/member}
    case name
    when 'PolicyName' then @app_cookie_stickiness_policy[:policy_name] = @text
    when 'CookieName' then @app_cookie_stickiness_policy[:cookie_name] = @text
    when 'member'     then @item[:app_cookie_stickiness_policies] << @app_cookie_stickiness_policy
    end
  when %r{LBCookieStickinessPolicies/member}
    case name
    when 'PolicyName'             then @lb_cookie_stickiness_policy[:policy_name] = @text
    when 'CookieExpirationPeriod' then @lb_cookie_stickiness_policy[:cookie_expiration_period] = @text.to_i
    when 'member'                 then @item[:lb_cookie_stickiness_policies] << @lb_cookie_stickiness_policy
    end
  when %r{LoadBalancerDescriptions/member$}
    @item[:availability_zones].sort!
    @item[:instances].sort!
    @result << @item
  end
end

#tagstart(name, attributes) ⇒ Object

:nodoc:



361
362
363
364
365
366
367
368
369
370
371
372
373
374
# File 'lib/elb/right_elb_interface.rb', line 361

def tagstart(name, attributes)
  case full_tag_name
  when %r{LoadBalancerDescriptions/member$}
    @item = { :availability_zones => [],
              :health_check       => {},
              :listeners          => [],
              :instances          => [],
              :app_cookie_stickiness_policies => [],
              :lb_cookie_stickiness_policies  => []}
  when %r{ListenerDescriptions/member$}        then @listener = {:policy_names => []}
  when %r{AppCookieStickinessPolicies/member$} then @app_cookie_stickiness_policy = {}
  when %r{LBCookieStickinessPolicies/member$}  then @lb_cookie_stickiness_policy = {}
  end
end