Sha256: e7917be809feb51e64991c8585c229d40b697360bb5f612c664610d7ee2b0b14

Contents?: true

Size: 1.36 KB

Versions: 7

Compression:

Stored size: 1.36 KB

Contents

module Fog
  module Parsers
    module Redshift
      module AWS
        class ClusterSubnetGroupParser < Fog::Parsers::Base
          # :cluster_subnet_group_name - (String)
          # :description - (String)
          # :vpc_id - (String)
          # :subnet_group_status - (String)
          # :subnets - (Array)
          #   :subnet_identifier - (String)
          #   :subnet_availability_zone - (Hash)
          #     :name - (String)
          #   :subnet_status - (String)

          def reset
            @response = { 'Subnets' => [] }
          end

          def fresh_subnet
            {'SubnetAvailabilityZone'=>{}}
          end

          def start_element(name, attrs = [])
            super
            case name
            when 'Subnets'
              @subnet = fresh_subnet
            end
          end

          def end_element(name)
            super
            case name
            when 'ClusterSubnetGroupName', 'Description', 'VpcId', 'SubnetGroupStatus'
              @response[name] = value
            when 'SubnetIdentifier', 'SubnetStatus'
              @subnet[name] = value
            when 'Name'
              @subnet['SubnetAvailabilityZone'][name] = value
            when 'Subnet'
              @response['Subnets'] << {name => @subnet}
              @subnet = fresh_subnet
            end
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fog-aws-3.29.0 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb
fog-aws-3.28.0 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb
fog-aws-3.27.0 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb
fog-aws-3.26.0 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb
fog-aws-3.25.0 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb
fog-aws-3.24.0 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb
fog-aws-3.23.0 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb