1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/aws/models/rds/parameters.rb

38 lines
992 B
Ruby
Raw Normal View History

2011-02-27 16:09:12 -05:00
require 'fog/core/collection'
require 'fog/aws/models/rds/parameter'
2011-02-27 16:09:12 -05:00
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 = filters)
self.filters = filters
result = []
marker = nil
finished = false
while !finished
2012-12-22 18:30:24 -05:00
data = service.describe_db_parameters(group.id, filters.merge(:marker => marker)).body
2011-02-27 16:09:12 -05:00
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
2012-12-22 18:30:24 -05:00
end