Sha256: b8a8f0d260777023dde7814fc4d32ad3d38501ca5f34595b33b1c80fe46281ce

Contents?: true

Size: 1.16 KB

Versions: 16

Compression:

Stored size: 1.16 KB

Contents

class BuildCloud::CacheParameterGroup

    include ::BuildCloud::Component

    @@objects = []

    def initialize ( fog_interfaces, log, options = {} )

        @elasticache  = fog_interfaces[:elasticache]
        @log          = log
        @options      = options

        @log.debug( options.inspect )

        required_options(:family, :description, :id, :params)

    end

    def create
        
        return if exists?

        @log.info( "Creating Cache Parameter Group #{@options[:id]}" )

        options = @options.dup

        param_group = @elasticache.create_cache_parameter_group(options[:id], options[:description], options[:family])

        @log.debug( param_group.inspect )

        params = @elasticache.modify_cache_parameter_group options[:id], options[:params]

        @log.debug( params.inspect )

    end

    def read
        @elasticache.parameter_groups.select { |g| g.id == "#{@options[:id]}".downcase }.first
    end

    alias_method :fog_object, :read

    def delete

        return unless exists?

        @log.info( "Deleting Cache Parameter Group #{@options[:id]}" )

        puts fog_object.inspect
        fog_object.destroy

    end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
build-cloud-1.1.7 lib/build-cloud/cacheparametergroup.rb
build-cloud-1.1.6 lib/build-cloud/cacheparametergroup.rb
build-cloud-1.1.5 lib/build-cloud/cacheparametergroup.rb
build-cloud-1.1.4 lib/build-cloud/cacheparametergroup.rb
build-cloud-1.1.3 lib/build-cloud/cacheparametergroup.rb
build-cloud-1.1.2 lib/build-cloud/cacheparametergroup.rb
build-cloud-1.0.1 lib/build-cloud/cacheparametergroup.rb
build-cloud-1.1.1 lib/build-cloud/cacheparametergroup.rb
build-cloud-1.0.0 lib/build-cloud/cacheparametergroup.rb
build-cloud-0.0.24 lib/build-cloud/cacheparametergroup.rb
build-cloud-0.0.23 lib/build-cloud/cacheparametergroup.rb
build-cloud-0.0.22 lib/build-cloud/cacheparametergroup.rb
build-cloud-0.0.21 lib/build-cloud/cacheparametergroup.rb
build-cloud-0.0.20 lib/build-cloud/cacheparametergroup.rb
build-cloud-0.0.19 lib/build-cloud/cacheparametergroup.rb
build-cloud-0.0.18 lib/build-cloud/cacheparametergroup.rb