Sha256: a49f5a48d9445eb6c7b271a328b8d8b6828d64b7f1c3945ab3f0b10787d4fb6d

Contents?: true

Size: 1.36 KB

Versions: 90

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', 'Desciption', '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

90 entries across 88 versions & 6 rubygems

Version Path
fog-aws-3.22.0 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb
fog-aws-3.21.1 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb
fog-aws-3.21.0 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb
fog-aws-3.20.0 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb
fog-aws-3.19.0 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb
fog-aws-3.18.0 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb
fog-aws-3.17.0 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb
fog-aws-3.16.0 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb
fog-aws-3.15.0 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb
fog-aws-3.14.0 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb
fog-aws-3.13.0 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb
fog-aws-3.12.0 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb
fog-aws-3.11.0 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb
fog-aws-3.10.0 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb
fog-aws-3.9.0 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb
fog-aws-3.8.0 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb
fog-aws-3.7.0 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb
fog-aws-3.6.7 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb
fog-aws-3.6.6 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb
fog-aws-3.6.5 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb