Sha256: bf781cc0ec8c66a01fcd1bdb9bee82160b5dc33c8d143c11ec9167208166d2a9

Contents?: true

Size: 1.66 KB

Versions: 13

Compression:

Stored size: 1.66 KB

Contents

module Fog
  module Parsers
    module AWS
      module ELB
        class DescribeLoadBalancerAttributes < Fog::Parsers::Base
          def reset
            @response = { 'DescribeLoadBalancerAttributesResult' => { 'LoadBalancerAttributes' => {} }, 'ResponseMetadata' => {} }
            @stack = []
          end

          def start_element(name, attrs = [])
            super
            case name
            when 'ConnectionDraining'
              @connection_draining = {}
            when 'CrossZoneLoadBalancing'
              @cross_zone_load_balancing = {}
            end
          end

          def end_element(name)
            case name
            when 'Enabled'
              if @cross_zone_load_balancing
                @cross_zone_load_balancing['Enabled'] = value == 'true' ? true : false
              elsif @connection_draining
                @connection_draining['Enabled'] = value == 'true' ? true : false
              end
            when 'Timeout'
              if @connection_draining
                @connection_draining['Timeout'] = value.to_i
              end
            when 'ConnectionDraining'
              @response['DescribeLoadBalancerAttributesResult']['LoadBalancerAttributes']['ConnectionDraining'] = @connection_draining
              @connection_draining = nil
            when 'CrossZoneLoadBalancing'
              @response['DescribeLoadBalancerAttributesResult']['LoadBalancerAttributes']['CrossZoneLoadBalancing'] = @cross_zone_load_balancing
              @cross_zone_load_balancing = nil
            when 'RequestId'
              @response['ResponseMetadata'][name] = value
            end
          end
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/aws/parsers/elb/describe_load_balancer_attributes.rb
fog-1.24.0 lib/fog/aws/parsers/elb/describe_load_balancer_attributes.rb
ns-fog-1.22.11 lib/fog/aws/parsers/elb/describe_load_balancer_attributes.rb
ns-fog-1.22.10 lib/fog/aws/parsers/elb/describe_load_balancer_attributes.rb
ns-fog-1.22.9 lib/fog/aws/parsers/elb/describe_load_balancer_attributes.rb
ns-fog-1.22.8 lib/fog/aws/parsers/elb/describe_load_balancer_attributes.rb
ns-fog-1.22.7 lib/fog/aws/parsers/elb/describe_load_balancer_attributes.rb
ns-fog-1.22.6 lib/fog/aws/parsers/elb/describe_load_balancer_attributes.rb
fog-1.23.0 lib/fog/aws/parsers/elb/describe_load_balancer_attributes.rb
ns-fog-1.22.4 lib/fog/aws/parsers/elb/describe_load_balancer_attributes.rb
ns-fog-1.22.3 lib/fog/aws/parsers/elb/describe_load_balancer_attributes.rb
ns-fog-1.22.2 lib/fog/aws/parsers/elb/describe_load_balancer_attributes.rb
fog-1.22.1 lib/fog/aws/parsers/elb/describe_load_balancer_attributes.rb