Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

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:

[View source]

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:

[View source]

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:

[View source]

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:

[View source]

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

def with_type snapshot_type
  filter(:snapshot_type, snapshot_type)
end