Class: Fog::AWS::Elasticache::Cluster

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/aws/models/elasticache/cluster.rb

Instance Attribute Summary

Attributes inherited from Model

#collection, #connection

Instance Method Summary collapse

Methods inherited from Model

#initialize, #inspect, #reload, #to_json, #wait_for

Methods included from Fog::Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Fog::Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #requires, #requires_one

Constructor Details

This class inherits a constructor from Fog::Model

Instance Method Details

#destroyObject



36
37
38
39
40
# File 'lib/fog/aws/models/elasticache/cluster.rb', line 36

def destroy
  requires :id
  connection.delete_cache_cluster(id)
  true
end

#ready?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/fog/aws/models/elasticache/cluster.rb', line 32

def ready?
  status == 'available'
end

#saveObject



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/fog/aws/models/elasticache/cluster.rb', line 42

def save
  requires :id

  parameter_group     ||= Hash.new
  notification_config ||= Hash.new

  connection.create_cache_cluster(
    id, {
      :node_type                    => node_type,
      :security_group_names         => security_groups,
      :num_nodes                    => num_nodes,
      :auto_minor_version_upgrade   => auto_upgrade,
      :engine                       => engine,
      :engine_version               => engine_version,
      :notification_topic_arn       => (notification_config['TopicArn']).strip,
      :port                         => port,
      :preferred_availablility_zone => zone,
      :preferred_maintenance_window => maintenance_window,
      :parameter_group_name => parameter_group['CacheParameterGroupName'],
    }
  )
end