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

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

Instance Method Summary collapse

Instance Method Details

#authorize_ec2_group(group_name, group_owner_id = owner_id) ⇒ Object



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

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

#destroyObject



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

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

#ready?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/fog/aws/models/elasticache/security_group.rb', line 12

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

#revoke_ec2_group(group_name, group_owner_id = owner_id) ⇒ Object



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

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

#saveObject



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

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