class Aws::Elb::QElbDescribeLoadBalancersParser

Public Instance Methods

reset() click to toggle source
# File lib/elb/elb_interface.rb, line 228
def reset
  @result = []
end
tagend(name) click to toggle source
# File lib/elb/elb_interface.rb, line 250
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) click to toggle source
# File lib/elb/elb_interface.rb, line 232
      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