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

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

Instance Attribute Summary

Attributes inherited from Collection

#connection

Instance Method Summary collapse

Methods inherited from Collection

#clear, #create, #destroy, #inspect, #load, model, #model, #reload, #table, #to_json

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

#initialize(attributes = {}) ⇒ SecurityGroups

Returns a new instance of SecurityGroups.



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

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

Instance Method Details

#all(filters = filters) ⇒ Object



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

def all(filters = filters)
  self.filters = filters
  data = connection.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



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

def get(identity)
  data = connection.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



36
37
38
# File 'lib/fog/aws/models/rds/security_groups.rb', line 36

def new(attributes = {})
  super
end