Sha256: 9c73d0343be761e6224c4e7e367a726cdcbd060c1876117d50f15d977e4bca9b

Contents?: true

Size: 848 Bytes

Versions: 5

Compression:

Stored size: 848 Bytes

Contents

require 'fog/core/model'

module Fog
  module AWS
    class Elasticache

      class SubnetGroup < Fog::Model

        identity   :id, :aliases => ['CacheSubnetGroupName', :name]
        attribute  :description, :aliases => 'CacheSubnetGroupDescription'
        attribute  :vpc_id, :aliases => 'VpcId'
        attribute  :subnet_ids, :aliases => 'Subnets'

        def ready?
          # Just returning true, as Elasticache subnet groups
          # seem to not have a status, unlike RDS subnet groups.
          true
        end

        def save
          requires :description, :id, :subnet_ids
          service.create_cache_subnet_group(id, subnet_ids, description)
          reload
        end

        def destroy
          requires :id
          service.delete_cache_subnet_group(id)
          true
        end

      end
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
fog-1.22.0 lib/fog/aws/models/elasticache/subnet_group.rb
fog-1.21.0 lib/fog/aws/models/elasticache/subnet_group.rb
fog-maestrodev-1.20.0.20140305101839 lib/fog/aws/models/elasticache/subnet_group.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/aws/models/elasticache/subnet_group.rb
fog-1.20.0 lib/fog/aws/models/elasticache/subnet_group.rb