Class: Aws::RDS::DBSnapshot
- Inherits:
-
Object
- Object
- Aws::RDS::DBSnapshot
- Defined in:
- gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb
Defined Under Namespace
Classes: Collection
Read-Only Attributes collapse
-
#additional_storage_volumes ⇒ Array<Types::AdditionalStorageVolume>
The additional storage volumes associated with the DB snapshot.
-
#allocated_storage ⇒ Integer
Specifies the allocated storage size in gibibytes (GiB).
-
#availability_zone ⇒ String
Specifies the name of the Availability Zone the DB instance was located in at the time of the DB snapshot.
-
#backup_retention_period ⇒ Integer
The number of days for which automatic DB snapshots are retained.
-
#db_snapshot_arn ⇒ String
The Amazon Resource Name (ARN) for the DB snapshot.
-
#db_system_id ⇒ String
The Oracle system identifier (SID), which is the name of the Oracle database instance that manages your database files.
-
#dbi_resource_id ⇒ String
The identifier for the source DB instance, which can't be changed and which is unique to an Amazon Web Services Region.
-
#dedicated_log_volume ⇒ Boolean
Indicates whether the DB instance has a dedicated log volume (DLV) enabled.
-
#encrypted ⇒ Boolean
Indicates whether the DB snapshot is encrypted.
-
#engine ⇒ String
Specifies the name of the database engine.
-
#engine_version ⇒ String
Specifies the version of the database engine.
-
#iam_database_authentication_enabled ⇒ Boolean
Indicates whether mapping of Amazon Web Services Identity and Access Management (IAM) accounts to database accounts is enabled.
-
#instance_create_time ⇒ Time
Specifies the time in Coordinated Universal Time (UTC) when the DB instance, from which the snapshot was taken, was created.
-
#instance_id ⇒ String
(also: #db_instance_identifier)
-
#iops ⇒ Integer
Specifies the Provisioned IOPS (I/O operations per second) value of the DB instance at the time of the snapshot.
-
#kms_key_id ⇒ String
If
Encryptedis true, the Amazon Web Services KMS key identifier for the encrypted DB snapshot. -
#license_model ⇒ String
License model information for the restored DB instance.
-
#master_username ⇒ String
Provides the master username for the DB snapshot.
-
#multi_tenant ⇒ Boolean
Indicates whether the snapshot is of a DB instance using the multi-tenant configuration (TRUE) or the single-tenant configuration (FALSE).
-
#option_group_name ⇒ String
Provides the option group name for the DB snapshot.
-
#original_snapshot_create_time ⇒ Time
Specifies the time of the CreateDBSnapshot operation in Coordinated Universal Time (UTC).
-
#percent_progress ⇒ Integer
The percentage of the estimated data that has been transferred.
-
#port ⇒ Integer
Specifies the port that the database engine was listening on at the time of the snapshot.
-
#preferred_backup_window ⇒ String
The daily time range during which automated backups are created if automated backups are enabled, as determined by the
BackupRetentionPeriod. -
#processor_features ⇒ Array<Types::ProcessorFeature>
The number of CPU cores and the number of threads per core for the DB instance class of the DB instance when the DB snapshot was created.
-
#snapshot_availability_zone ⇒ String
Specifies the name of the Availability Zone where RDS stores the DB snapshot.
-
#snapshot_create_time ⇒ Time
Specifies when the snapshot was taken in Coordinated Universal Time (UTC).
-
#snapshot_database_time ⇒ Time
The timestamp of the most recent transaction applied to the database that you're backing up.
-
#snapshot_id ⇒ String
(also: #db_snapshot_identifier)
-
#snapshot_target ⇒ String
Specifies where manual snapshots are stored: Dedicated Local Zones, Amazon Web Services Outposts or the Amazon Web Services Region.
-
#snapshot_type ⇒ String
Provides the type of the DB snapshot.
-
#source_db_snapshot_identifier ⇒ String
The DB snapshot Amazon Resource Name (ARN) that the DB snapshot was copied from.
-
#source_region ⇒ String
The Amazon Web Services Region that the DB snapshot was created in or copied from.
-
#status ⇒ String
Specifies the status of this DB snapshot.
-
#storage_encryption_type ⇒ String
The type of encryption used to protect data at rest in the DB snapshot.
-
#storage_throughput ⇒ Integer
Specifies the storage throughput for the DB snapshot.
-
#storage_type ⇒ String
Specifies the storage type associated with DB snapshot.
-
#tag_list ⇒ Array<Types::Tag>
A list of tags.
-
#tde_credential_arn ⇒ String
The ARN from the key store with which to associate the instance for TDE encryption.
-
#timezone ⇒ String
The time zone of the DB snapshot.
-
#vpc_id ⇒ String
Provides the VPC ID associated with the DB snapshot.
Actions collapse
-
#copy(options = {}) ⇒ DBSnapshot
-
#create(options = {}) ⇒ DBSnapshot
-
#delete(options = {}) ⇒ DBSnapshot
-
#restore(options = {}) ⇒ DBInstance
-
#subscribe_to(options = {}) ⇒ EventSubscription
-
#unsubscribe_from(options = {}) ⇒ EventSubscription
Associations collapse
-
#attributes(options = {}) ⇒ DBSnapshotAttribute::Collection
-
#events(options = {}) ⇒ Event::Collection
-
#instance ⇒ DBInstance
-
#option_group ⇒ OptionGroup?
Instance Method Summary collapse
-
#client ⇒ Client
-
#data ⇒ Types::DBSnapshot
Returns the data for this DBSnapshot.
-
#data_loaded? ⇒ Boolean
Returns
trueif this resource is loaded. -
#initialize(*args) ⇒ DBSnapshot
constructor
A new instance of DBSnapshot.
-
#load ⇒ self
(also: #reload)
Loads, or reloads #data for the current DBSnapshot.
-
#wait_until(options = {}) {|resource| ... } ⇒ Resource
deprecated
Deprecated.
Use [Aws::RDS::Client] #wait_until instead
Constructor Details
#initialize(instance_id, snapshot_id, options = {}) ⇒ DBSnapshot #initialize(options = {}) ⇒ DBSnapshot
Returns a new instance of DBSnapshot.
24 25 26 27 28 29 30 31 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 24 def initialize(*args) = Hash === args.last ? args.pop.dup : {} @instance_id = extract_instance_id(args, ) @snapshot_id = extract_snapshot_id(args, ) @data = .delete(:data) @client = .delete(:client) || Client.new() @waiter_block_warned = false end |
Instance Method Details
#additional_storage_volumes ⇒ Array<Types::AdditionalStorageVolume>
The additional storage volumes associated with the DB snapshot. RDS supports additional storage volumes for RDS for Oracle and RDS for SQL Server.
328 329 330 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 328 def additional_storage_volumes data[:additional_storage_volumes] end |
#allocated_storage ⇒ Integer
Specifies the allocated storage size in gibibytes (GiB).
62 63 64 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 62 def allocated_storage data[:allocated_storage] end |
#attributes(options = {}) ⇒ DBSnapshotAttribute::Collection
1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 1510 def attributes( = {}) batches = Enumerator.new do |y| batch = [] = .merge(db_snapshot_identifier: @snapshot_id) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.describe_db_snapshot_attributes() end resp.data.db_snapshot_attributes_result.db_snapshot_attributes.each do |d| batch << DBSnapshotAttribute.new( snapshot_id: @snapshot_id, name: d.attribute_name, data: d, client: @client ) end y.yield(batch) end DBSnapshotAttribute::Collection.new(batches) end |
#availability_zone ⇒ String
Specifies the name of the Availability Zone the DB instance was located in at the time of the DB snapshot.
82 83 84 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 82 def availability_zone data[:availability_zone] end |
#backup_retention_period ⇒ Integer
The number of days for which automatic DB snapshots are retained.
199 200 201 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 199 def backup_retention_period data[:backup_retention_period] end |
#client ⇒ Client
343 344 345 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 343 def client @client end |
#copy(options = {}) ⇒ DBSnapshot
699 700 701 702 703 704 705 706 707 708 709 710 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 699 def copy( = {}) = .merge(source_db_snapshot_identifier: @snapshot_id) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.copy_db_snapshot() end DBSnapshot.new( instance_id: resp.data.db_snapshot.db_instance_identifier, snapshot_id: resp.data.db_snapshot.db_snapshot_identifier, data: resp.data.db_snapshot, client: @client ) end |
#create(options = {}) ⇒ DBSnapshot
501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 501 def create( = {}) = .merge( db_instance_identifier: @instance_id, db_snapshot_identifier: @snapshot_id ) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.create_db_snapshot() end DBSnapshot.new( instance_id: resp.data.db_snapshot.db_instance_identifier, snapshot_id: resp.data.db_snapshot.db_snapshot_identifier, data: resp.data.db_snapshot, client: @client ) end |
#data ⇒ Types::DBSnapshot
Returns the data for this Aws::RDS::DBSnapshot. Calls
Client#describe_db_snapshots if #data_loaded? is false.
365 366 367 368 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 365 def data load unless @data @data end |
#data_loaded? ⇒ Boolean
373 374 375 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 373 def data_loaded? !!@data end |
#db_snapshot_arn ⇒ String
The Amazon Resource Name (ARN) for the DB snapshot.
223 224 225 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 223 def db_snapshot_arn data[:db_snapshot_arn] end |
#db_system_id ⇒ String
The Oracle system identifier (SID), which is the name of the Oracle database instance that manages your database files. The Oracle SID is also the name of your CDB.
305 306 307 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 305 def db_system_id data[:db_system_id] end |
#dbi_resource_id ⇒ String
The identifier for the source DB instance, which can't be changed and which is unique to an Amazon Web Services Region.
253 254 255 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 253 def dbi_resource_id data[:dbi_resource_id] end |
#dedicated_log_volume ⇒ Boolean
Indicates whether the DB instance has a dedicated log volume (DLV) enabled.
320 321 322 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 320 def dedicated_log_volume data[:dedicated_log_volume] end |
#delete(options = {}) ⇒ DBSnapshot
717 718 719 720 721 722 723 724 725 726 727 728 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 717 def delete( = {}) = .merge(db_snapshot_identifier: @snapshot_id) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.delete_db_snapshot() end DBSnapshot.new( instance_id: resp.data.db_snapshot.db_instance_identifier, snapshot_id: resp.data.db_snapshot.db_snapshot_identifier, data: resp.data.db_snapshot, client: @client ) end |
#encrypted ⇒ Boolean
Indicates whether the DB snapshot is encrypted.
178 179 180 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 178 def encrypted data[:encrypted] end |
#engine ⇒ String
Specifies the name of the database engine.
56 57 58 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 56 def engine data[:engine] end |
#engine_version ⇒ String
Specifies the version of the database engine.
107 108 109 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 107 def engine_version data[:engine_version] end |
#events(options = {}) ⇒ Event::Collection
1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 1575 def events( = {}) batches = Enumerator.new do |y| = .merge( source_type: "db-snapshot", source_identifier: @snapshot_id ) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.describe_events() end resp.each_page do |page| batch = [] page.data.events.each do |e| batch << Event.new( source_id: e.source_identifier, date: e.date, data: e, client: @client ) end y.yield(batch) end end Event::Collection.new(batches) end |
#iam_database_authentication_enabled ⇒ Boolean
Indicates whether mapping of Amazon Web Services Identity and Access Management (IAM) accounts to database accounts is enabled.
239 240 241 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 239 def iam_database_authentication_enabled data[:iam_database_authentication_enabled] end |
#instance ⇒ DBInstance
1601 1602 1603 1604 1605 1606 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 1601 def instance DBInstance.new( id: @instance_id, client: @client ) end |
#instance_create_time ⇒ Time
Specifies the time in Coordinated Universal Time (UTC) when the DB instance, from which the snapshot was taken, was created.
95 96 97 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 95 def instance_create_time data[:instance_create_time] end |
#instance_id ⇒ String Also known as: db_instance_identifier
36 37 38 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 36 def instance_id @instance_id end |
#iops ⇒ Integer
Specifies the Provisioned IOPS (I/O operations per second) value of the DB instance at the time of the snapshot.
126 127 128 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 126 def iops data[:iops] end |
#kms_key_id ⇒ String
If Encrypted is true, the Amazon Web Services KMS key identifier for
the encrypted DB snapshot.
The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the KMS key.
217 218 219 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 217 def kms_key_id data[:kms_key_id] end |
#license_model ⇒ String
License model information for the restored DB instance.
113 114 115 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 113 def license_model data[:license_model] end |
#load ⇒ self Also known as: reload
Loads, or reloads #data for the current Aws::RDS::DBSnapshot.
Returns self making it possible to chain methods.
db_snapshot.reload.data
353 354 355 356 357 358 359 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 353 def load resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.describe_db_snapshots(db_snapshot_identifier: @snapshot_id) end @data = resp.db_snapshots[0] self end |
#master_username ⇒ String
Provides the master username for the DB snapshot.
101 102 103 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 101 def master_username data[:master_username] end |
#multi_tenant ⇒ Boolean
Indicates whether the snapshot is of a DB instance using the multi-tenant configuration (TRUE) or the single-tenant configuration (FALSE).
313 314 315 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 313 def multi_tenant data[:multi_tenant] end |
#option_group ⇒ OptionGroup?
1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 1609 def option_group if data[:db_snapshot][:option_group_name] OptionGroup.new( name: data[:db_snapshot][:option_group_name], client: @client ) else nil end end |
#option_group_name ⇒ String
Provides the option group name for the DB snapshot.
138 139 140 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 138 def option_group_name data[:option_group_name] end |
#original_snapshot_create_time ⇒ Time
Specifies the time of the CreateDBSnapshot operation in Coordinated Universal Time (UTC). Doesn't change when the snapshot is copied.
282 283 284 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 282 def original_snapshot_create_time data[:original_snapshot_create_time] end |
#percent_progress ⇒ Integer
The percentage of the estimated data that has been transferred.
144 145 146 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 144 def percent_progress data[:percent_progress] end |
#port ⇒ Integer
Specifies the port that the database engine was listening on at the time of the snapshot.
75 76 77 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 75 def port data[:port] end |
#preferred_backup_window ⇒ String
The daily time range during which automated backups are created if
automated backups are enabled, as determined by the
BackupRetentionPeriod.
207 208 209 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 207 def preferred_backup_window data[:preferred_backup_window] end |
#processor_features ⇒ Array<Types::ProcessorFeature>
The number of CPU cores and the number of threads per core for the DB instance class of the DB instance when the DB snapshot was created.
246 247 248 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 246 def processor_features data[:processor_features] end |
#restore(options = {}) ⇒ DBInstance
1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 1447 def restore( = {}) = .merge(db_snapshot_identifier: @snapshot_id) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.restore_db_instance_from_db_snapshot() end DBInstance.new( id: resp.data.db_instance.db_instance_identifier, data: resp.data.db_instance, client: @client ) end |
#snapshot_availability_zone ⇒ String
Specifies the name of the Availability Zone where RDS stores the DB snapshot. This value is valid only for snapshots that RDS stores on a Dedicated Local Zone.
336 337 338 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 336 def snapshot_availability_zone data[:snapshot_availability_zone] end |
#snapshot_create_time ⇒ Time
Specifies when the snapshot was taken in Coordinated Universal Time (UTC). Changes for the copy when the snapshot is copied.
50 51 52 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 50 def snapshot_create_time data[:snapshot_create_time] end |
#snapshot_database_time ⇒ Time
The timestamp of the most recent transaction applied to the database that you're backing up. Thus, if you restore a snapshot, SnapshotDatabaseTime is the most recent transaction in the restored DB instance. In contrast, originalSnapshotCreateTime specifies the system time that the snapshot completed.
If you back up a read replica, you can determine the replica lag by comparing SnapshotDatabaseTime with originalSnapshotCreateTime. For example, if originalSnapshotCreateTime is two hours later than SnapshotDatabaseTime, then the replica lag is two hours.
297 298 299 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 297 def snapshot_database_time data[:snapshot_database_time] end |
#snapshot_id ⇒ String Also known as: db_snapshot_identifier
42 43 44 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 42 def snapshot_id @snapshot_id end |
#snapshot_target ⇒ String
Specifies where manual snapshots are stored: Dedicated Local Zones, Amazon Web Services Outposts or the Amazon Web Services Region.
275 276 277 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 275 def snapshot_target data[:snapshot_target] end |
#snapshot_type ⇒ String
Provides the type of the DB snapshot.
119 120 121 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 119 def snapshot_type data[:snapshot_type] end |
#source_db_snapshot_identifier ⇒ String
The DB snapshot Amazon Resource Name (ARN) that the DB snapshot was copied from. It only has a value in the case of a cross-account or cross-Region copy.
159 160 161 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 159 def source_db_snapshot_identifier data[:source_db_snapshot_identifier] end |
#source_region ⇒ String
The Amazon Web Services Region that the DB snapshot was created in or copied from.
151 152 153 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 151 def source_region data[:source_region] end |
#status ⇒ String
Specifies the status of this DB snapshot.
68 69 70 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 68 def status data[:status] end |
#storage_encryption_type ⇒ String
The type of encryption used to protect data at rest in the DB snapshot. Possible values:
none- The DB snapshot is not encrypted.sse-rds- The DB snapshot is encrypted using an Amazon Web Services owned KMS key.sse-kms- The DB snapshot is encrypted using a customer managed KMS key or Amazon Web Services managed KMS key.
193 194 195 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 193 def storage_encryption_type data[:storage_encryption_type] end |
#storage_throughput ⇒ Integer
Specifies the storage throughput for the DB snapshot.
132 133 134 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 132 def storage_throughput data[:storage_throughput] end |
#storage_type ⇒ String
Specifies the storage type associated with DB snapshot.
165 166 167 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 165 def storage_type data[:storage_type] end |
#subscribe_to(options = {}) ⇒ EventSubscription
1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 1469 def subscribe_to( = {}) = .merge(source_identifier: @snapshot_id) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.add_source_identifier_to_subscription() end EventSubscription.new( name: resp.data.event_subscription.cust_subscription_id, data: resp.data.event_subscription, client: @client ) end |
#tag_list ⇒ Array<Types::Tag>
A list of tags.
For more information, see Tagging Amazon RDS resources in the Amazon RDS User Guide or Tagging Amazon Aurora and Amazon RDS resources in the Amazon Aurora User Guide.
268 269 270 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 268 def tag_list data[:tag_list] end |
#tde_credential_arn ⇒ String
The ARN from the key store with which to associate the instance for TDE encryption.
172 173 174 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 172 def tde_credential_arn data[:tde_credential_arn] end |
#timezone ⇒ String
The time zone of the DB snapshot. In most cases, the Timezone
element is empty. Timezone content appears only for snapshots taken
from Microsoft SQL Server DB instances that were created with a time
zone specified.
232 233 234 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 232 def timezone data[:timezone] end |
#unsubscribe_from(options = {}) ⇒ EventSubscription
1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 1491 def unsubscribe_from( = {}) = .merge(source_identifier: @snapshot_id) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.remove_source_identifier_from_subscription() end EventSubscription.new( name: resp.data.event_subscription.cust_subscription_id, data: resp.data.event_subscription, client: @client ) end |
#vpc_id ⇒ String
Provides the VPC ID associated with the DB snapshot.
88 89 90 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 88 def vpc_id data[:vpc_id] end |
#wait_until(options = {}) {|resource| ... } ⇒ Resource
Use [Aws::RDS::Client] #wait_until instead
The waiting operation is performed on a copy. The original resource remains unchanged.
Waiter polls an API operation until a resource enters a desired state.
Basic Usage
Waiter will polls until it is successful, it fails by entering a terminal state, or until a maximum number of attempts are made.
# polls in a loop until condition is true
resource.wait_until() {|resource| condition}
Example
instance.wait_until(max_attempts:10, delay:5) do |instance|
instance.state.name == 'running'
end
Configuration
You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. The waiting condition is set by passing a block to #wait_until:
# poll for ~25 seconds
resource.wait_until(max_attempts:5,delay:5) {|resource|...}
Callbacks
You can be notified before each polling attempt and before each
delay. If you throw :success or :failure from these callbacks,
it will terminate the waiter.
started_at = Time.now
# poll for 1 hour, instead of a number of attempts
proc = Proc.new do |attempts, response|
throw :failure if Time.now - started_at > 3600
end
# disable max attempts
instance.wait_until(before_wait:proc, max_attempts:nil) {...}
Handling Errors
When a waiter is successful, it returns the Resource. When a waiter fails, it raises an error.
begin
resource.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
# resource did not enter the desired state in time
end
attempts attempt in seconds invoked before each attempt invoked before each wait
457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb', line 457 def wait_until( = {}, &block) self_copy = self.dup attempts = 0 [:max_attempts] = 10 unless .key?(:max_attempts) [:delay] ||= 10 [:poller] = Proc.new do attempts += 1 if block.call(self_copy) [:success, self_copy] else self_copy.reload unless attempts == [:max_attempts] :retry end end Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do Aws::Waiters::Waiter.new().wait({}) end end |