Class: BuildCloud::DbParameterGroup
- Inherits:
-
Object
- Object
- BuildCloud::DbParameterGroup
- Includes:
- Component
- Defined in:
- lib/build-cloud/dbparameters.rb,
lib/build-cloud/dbparametergroup.rb
Constant Summary collapse
- @@objects =
[]
Instance Method Summary collapse
- #create ⇒ Object
- #delete ⇒ Object
-
#initialize(fog_interfaces, log, options = {}) ⇒ DbParameterGroup
constructor
A new instance of DbParameterGroup.
- #read ⇒ Object (also: #fog_object)
Methods included from Component
Constructor Details
#initialize(fog_interfaces, log, options = {}) ⇒ DbParameterGroup
Returns a new instance of DbParameterGroup.
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/build-cloud/dbparameters.rb', line 8 def initialize ( fog_interfaces, log, = {} ) @rds = fog_interfaces[:rds] @log = log @options = @log.debug( .inspect ) (:family, :description, :id) end |
Instance Method Details
#create ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/build-cloud/dbparameters.rb', line 20 def create return if exists? @log.info( "Creating DB Parameter Group #{@options[:id]}" ) = @options.dup param_group = @rds.create_db_parameter_group([:id], [:family], [:description]) @log.debug( param_group.inspect ) end |
#delete ⇒ Object
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/build-cloud/dbparameters.rb', line 40 def delete return unless exists? @log.info( "Deleting DB Parameter Group #{@options[:name]}" ) puts fog_object.inspect fog_object.destroy end |
#read ⇒ Object Also known as: fog_object
34 35 36 |
# File 'lib/build-cloud/dbparameters.rb', line 34 def read @rds.parameter_groups.select { |g| g.id == "#{@options[:name]}" }.first end |