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



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

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



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

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

#ready?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/fog/aws/models/elasticache/security_group.rb', line 10

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

#revoke_ec2_group(group_name, group_owner_id = owner_id) ⇒ Object



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

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



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

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