2011-02-27 16:09:12 -05:00
|
|
|
require 'fog/core/model'
|
|
|
|
|
|
|
|
module Fog
|
|
|
|
module AWS
|
|
|
|
class RDS
|
2012-12-22 18:30:24 -05:00
|
|
|
|
2011-02-27 16:09:12 -05:00
|
|
|
class ParameterGroup < Fog::Model
|
|
|
|
|
|
|
|
identity :id, :aliases => ['DBParameterGroupName', :name]
|
|
|
|
attribute :family, :aliases => 'DBParameterGroupFamily'
|
|
|
|
attribute :description, :aliases => 'Description'
|
2012-12-22 18:30:24 -05:00
|
|
|
|
2011-02-27 16:09:12 -05:00
|
|
|
def save
|
|
|
|
requires :family
|
|
|
|
requires :description
|
|
|
|
requires :id
|
2012-12-22 18:30:24 -05:00
|
|
|
service.create_db_parameter_group(id, family, description)
|
2011-02-27 16:09:12 -05:00
|
|
|
end
|
2012-12-22 18:30:24 -05:00
|
|
|
|
2011-02-27 16:09:12 -05:00
|
|
|
def modify(changes)
|
2012-12-22 18:30:24 -05:00
|
|
|
service.modify_db_parameter_group id, changes.collect {|c| {'ParameterName' => c[:name], 'ParameterValue' => c[:value], 'ApplyMethod' => c[:apply_method]}}
|
2011-02-27 16:09:12 -05:00
|
|
|
end
|
2012-12-22 18:30:24 -05:00
|
|
|
|
2011-02-27 16:09:12 -05:00
|
|
|
def destroy
|
|
|
|
requires :id
|
2012-12-22 18:30:24 -05:00
|
|
|
service.delete_db_parameter_group(id)
|
2011-02-27 16:09:12 -05:00
|
|
|
true
|
|
|
|
end
|
2012-12-22 18:30:24 -05:00
|
|
|
|
2011-02-27 16:09:12 -05:00
|
|
|
def parameters(filters={})
|
2012-12-22 18:30:24 -05:00
|
|
|
service.parameters({:group => self}.merge(filters))
|
2011-02-27 16:09:12 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2012-12-22 18:30:24 -05:00
|
|
|
end
|