1
0
Fork 0
mirror of https://github.com/fog/fog-aws.git synced 2022-11-09 13:50:52 -05:00
fog--fog-aws/lib/fog/aws/models/rds/parameters.rb
2016-01-31 13:06:14 -05:00

50 lines
1.5 KiB
Ruby

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
def defaults(family)
page1 = service.describe_engine_default_parameters(family).body['DescribeEngineDefaultParametersResult']
marker = page1['Marker']
parameters = page1['Parameters']
until marker.nil?
body = service.describe_engine_default_parameters(family, 'Marker' => marker).body['DescribeEngineDefaultParametersResult']
marker = body['Marker']
parameters += body['Parameters']
end
load(parameters)
end
end
end
end
end