You are viewing documentation for version 1 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Class: AWS::RDS::DBSnapshotCollection

Inherits:
Object
  • Object
show all
Includes:
Core::Collection::WithLimitAndNextToken
Defined in:
lib/aws/rds/db_snapshot_collection.rb

Instance Method Summary collapse

Methods included from Core::Collection

#each, #each_batch, #enum, #first, #in_groups_of, #page

Instance Method Details

#[](db_snapshot_id) ⇒ DBSnapshot

Returns a AWS::RDS::DBSnapshot with the given ID.

Parameters:

  • db_snapshot_id (String)

Returns:



28
29
30
# File 'lib/aws/rds/db_snapshot_collection.rb', line 28

def [] db_snapshot_id
  DBSnapshot.new(db_snapshot_id, :config => config)
end

#db_instance(db_instance) ⇒ DBSnapshotCollection

Filters the DB snapshots to those beloning to a single db instance. You may pass the ID of a db instance or a AWS::RDS::DBInstance object.

Parameters:

Returns:



40
41
42
43
# File 'lib/aws/rds/db_snapshot_collection.rb', line 40

def db_instance db_instance
  id = db_instance.is_a?(Core::Model) ? db_instance.id : db_instance
  filter(:db_instance_identifier, id.to_s.downcase)
end

#filter(name, value) ⇒ DBSnapshotCollection

Parameters:

  • name (String, Symbol)
  • value (Mixed)

Returns:



56
57
58
59
60
61
# File 'lib/aws/rds/db_snapshot_collection.rb', line 56

def filter name, value
  options = {}
  options[:filters] = @filters.merge(name.to_s.to_sym => value)
  options[:config] = config
  DBSnapshotCollection.new(options)
end

#with_type(snapshot_type) ⇒ DBSnapshotCollection Also known as: type

Filters the DB snapshots to those of a given snapshot type.

Parameters:

  • snapshot_type (String)

Returns:



48
49
50
# File 'lib/aws/rds/db_snapshot_collection.rb', line 48

def with_type snapshot_type
  filter(:snapshot_type, snapshot_type)
end