Class: Fog::AWS::Elasticache::SecurityGroup

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

Instance Attribute Summary

Attributes inherited from Model

#collection, #connection

Instance Method Summary collapse

Methods inherited from Model

#initialize, #inspect, #reload, #symbolize_keys, #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

#authorize_ec2_group(group_name, group_owner_id = owner_id) ⇒ Object



30
31
32
33
34
35
36
37
# File 'lib/fog/aws/models/elasticache/security_group.rb', line 30

def authorize_ec2_group(group_name, group_owner_id=owner_id)
  requires :id
  requires :owner_id if group_owner_id.nil?
  data = connection.authorize_cache_security_group_ingress(
    id, group_name, group_owner_id
  )
  merge_attributes(data.body['CacheSecurityGroup'])
end

#destroyObject



18
19
20
21
22
# File 'lib/fog/aws/models/elasticache/security_group.rb', line 18

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

#ready?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/fog/aws/models/elasticache/security_group.rb', line 14

def ready?
  ec2_groups.all?{|ingress| ingress['Status'] == 'authorized'}
end

#revoke_ec2_group(group_name, group_owner_id = owner_id) ⇒ Object



39
40
41
42
43
44
45
46
# File 'lib/fog/aws/models/elasticache/security_group.rb', line 39

def revoke_ec2_group(group_name, group_owner_id=owner_id)
  requires :id
  requires :owner_id if group_owner_id.nil?
  data = connection.revoke_cache_security_group_ingress(
    id, group_name, group_owner_id
  )
  merge_attributes(data.body['CacheSecurityGroup'])
end

#saveObject



24
25
26
27
28
# File 'lib/fog/aws/models/elasticache/security_group.rb', line 24

def save
  requires :id
  requires :description
  connection.create_cache_security_group(id, description)
end