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