Class: Fog::AWS::RDS::SecurityGroups

Inherits:
Collection
  • Object
show all
Defined in:
lib/fog/aws/models/rds/security_groups.rb

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SecurityGroups

Returns a new instance of SecurityGroups.



11
12
13
14
15
16
17
# File 'lib/fog/aws/models/rds/security_groups.rb', line 11

def initialize(attributes={})
  self.filters ||= {}
  if attributes[:server]
    filters[:identifier] = attributes[:server].id
  end
  super
end

Instance Method Details

#all(filters_arg = filters) ⇒ Object



19
20
21
22
23
# File 'lib/fog/aws/models/rds/security_groups.rb', line 19

def all(filters_arg = filters)
  filters = filters_arg
  data = service.describe_db_security_groups(filters).body['DescribeDBSecurityGroupsResult']['DBSecurityGroups']
  load(data) # data is an array of attribute hashes
end

#get(identity) ⇒ Object

Example: get(‘my_db_security_group’) # => model for my_db_security_group



27
28
29
30
31
32
# File 'lib/fog/aws/models/rds/security_groups.rb', line 27

def get(identity)
  data = service.describe_db_security_groups(identity).body['DescribeDBSecurityGroupsResult']['DBSecurityGroups'].first
  new(data) # data is an attribute hash
rescue Fog::AWS::RDS::NotFound
  nil
end

#new(attributes = {}) ⇒ Object



34
35
36
# File 'lib/fog/aws/models/rds/security_groups.rb', line 34

def new(attributes = {})
  super
end