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
ns-fog-1.22.10 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb
ns-fog-1.22.9 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb
ns-fog-1.22.8 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb
ns-fog-1.22.7 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb
ns-fog-1.22.6 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb
fog-1.23.0 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb
ns-fog-1.22.4 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb
ns-fog-1.22.3 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb
ns-fog-1.22.2 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb
fog-1.22.1 lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb