Sha256: 8f72fd55432f01e9c27c39c1e5d60c13082dde7eaadcc477c3c731b2bcf45f0c

Contents?: true

Size: 994 Bytes

Versions: 6

Compression:

Stored size: 994 Bytes

Contents

require 'fog/core/collection'
require 'fog/aws/models/rds/parameter'

module Fog
  module AWS
    class RDS
      class Parameters < Fog::Collection
        attribute :group
        attribute :filters
        model Fog::AWS::RDS::Parameter

        def initialize(attributes)
          self.filters ||= {}
          if attributes[:source]
            filters[:source] = attributes[:source]
          end
          super
        end

        def all(filters_arg = filters)
          filters = filters_arg
          result = []
          marker = nil
          finished = false
          while !finished
            data = service.describe_db_parameters(group.id, filters.merge(:marker => marker)).body
            result.concat(data['DescribeDBParametersResult']['Parameters'])
            marker = data['DescribeDBParametersResult']['Marker']
            finished = marker.nil?
          end
          load(result) # data is an array of attribute hashes
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
fog-aws-0.1.1 lib/fog/aws/models/rds/parameters.rb
fog-aws-0.1.0 lib/fog/aws/models/rds/parameters.rb
fog-aws-0.0.8 lib/fog/aws/models/rds/parameters.rb
fog-aws-0.0.7 lib/fog/aws/models/rds/parameters.rb
fog-aws-0.0.6 lib/fog/aws/models/rds/parameters.rb
fog-aws-0.0.5 lib/fog/aws/models/rds/parameters.rb