Class: Fog::AWS::RDS::Parameters

Inherits:
Collection
  • Object
show all
Defined in:
lib/fog/aws/models/rds/parameters.rb

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Parameters

Returns a new instance of Parameters.



11
12
13
14
15
16
17
# File 'lib/fog/aws/models/rds/parameters.rb', line 11

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

Instance Method Details

#all(filters_arg = filters) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/fog/aws/models/rds/parameters.rb', line 19

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

#defaults(family) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/fog/aws/models/rds/parameters.rb', line 33

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