Class: AWS::RDS::DBSnapshotCollection
- Inherits:
-
Object
- Object
- AWS::RDS::DBSnapshotCollection
- Includes:
- Core::Collection::WithLimitAndNextToken
- Defined in:
- lib/aws/rds/db_snapshot_collection.rb
Instance Method Summary collapse
-
#[](db_snapshot_id) ⇒ DBSnapshot
Returns a DBSnapshot with the given ID.
-
#db_instance(db_instance) ⇒ DBSnapshotCollection
Filters the DB snapshots to those beloning to a single db instance.
- #filter(name, value) ⇒ DBSnapshotCollection
-
#with_type(snapshot_type) ⇒ DBSnapshotCollection
(also: #type)
Filters the DB snapshots to those of a given snapshot type.
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.
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.
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
56 57 58 59 60 61 |
# File 'lib/aws/rds/db_snapshot_collection.rb', line 56 def filter name, value = {} [:filters] = @filters.merge(name.to_s.to_sym => value) [:config] = config DBSnapshotCollection.new() end |
#with_type(snapshot_type) ⇒ DBSnapshotCollection Also known as: type
Filters the DB snapshots to those of a given snapshot type.
48 49 50 |
# File 'lib/aws/rds/db_snapshot_collection.rb', line 48 def with_type snapshot_type filter(:snapshot_type, snapshot_type) end |