Class: RightAws::ElbInterface::DescribeLoadBalancersParser

Inherits:
RightAWSParser
  • Object
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



487
488
489
# File 'lib/elb/right_elb_interface.rb', line 487

def reset
  @result = []
end

#tagend(name) ⇒ Object



449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
# File 'lib/elb/right_elb_interface.rb', line 449

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
  when 'SSLCertificateId'   then @listener[:ssl_certificate_id] = @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:



435
436
437
438
439
440
441
442
443
444
445
446
447
448
# File 'lib/elb/right_elb_interface.rb', line 435

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