Class: Aws::RDS::DBSnapshot
- Inherits:
-
Object
- Object
- Aws::RDS::DBSnapshot
- Extended by:
- Deprecations
- Defined in:
- lib/aws-sdk-rds/db_snapshot.rb
Defined Under Namespace
Classes: Collection
Read-Only Attributes collapse
-
#allocated_storage ⇒ Integer
Specifies the allocated storage size in gigabytes (GB).
-
#availability_zone ⇒ String
Specifies the name of the Availability Zone the DB instance was located in at the time of the DB snapshot.
-
#db_snapshot_arn ⇒ String
The Amazon Resource Name (ARN) for the DB snapshot.
-
#encrypted ⇒ Boolean
Specifies 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
True if mapping of AWS Identity and Access Management (IAM) accounts to database accounts is enabled; otherwise false.
-
#instance_create_time ⇒ Time
Specifies the time when the snapshot was taken, in Universal Coordinated Time (UTC).
- #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 ‘Encrypted` is true, the 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.
-
#option_group_name ⇒ String
Provides the option group name for the DB snapshot.
-
#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.
-
#snapshot_create_time ⇒ Time
Provides the time when the snapshot was taken, in Universal Coordinated Time (UTC).
- #snapshot_id ⇒ String (also: #db_snapshot_identifier)
-
#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 AWS Region that the DB snapshot was created in or copied from.
-
#status ⇒ String
Specifies the status of this DB snapshot.
-
#storage_type ⇒ String
Specifies the storage type associated with DB snapshot.
-
#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
- #identifiers ⇒ Object deprecated private Deprecated.
- #instance ⇒ DBInstance
- #option_group ⇒ OptionGroup?
Instance Method Summary collapse
- #client ⇒ Client
-
#data ⇒ Types::DBSnapshot
Returns the data for this DBSnapshot.
-
#data_loaded? ⇒ Boolean
Returns ‘true` if 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.
Constructor Details
#initialize(instance_id, snapshot_id, options = {}) ⇒ DBSnapshot #initialize(options = {}) ⇒ DBSnapshot
Returns a new instance of DBSnapshot.
21 22 23 24 25 26 27 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 21 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() end |
Instance Method Details
#allocated_storage ⇒ Integer
Specifies the allocated storage size in gigabytes (GB).
58 59 60 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 58 def allocated_storage data.allocated_storage end |
#attributes(options = {}) ⇒ DBSnapshotAttribute::Collection
665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 665 def attributes( = {}) batches = Enumerator.new do |y| batch = [] = .merge(db_snapshot_identifier: @snapshot_id) resp = @client.describe_db_snapshot_attributes() 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.
78 79 80 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 78 def availability_zone data.availability_zone end |
#client ⇒ Client
203 204 205 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 203 def client @client end |
#copy(options = {}) ⇒ DBSnapshot
388 389 390 391 392 393 394 395 396 397 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 388 def copy( = {}) = .merge(source_db_snapshot_identifier: @snapshot_id) resp = @client.copy_db_snapshot() 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
251 252 253 254 255 256 257 258 259 260 261 262 263 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 251 def create( = {}) = .merge( db_instance_identifier: @instance_id, db_snapshot_identifier: @snapshot_id ) resp = @client.create_db_snapshot() 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`.
223 224 225 226 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 223 def data load unless @data @data end |
#data_loaded? ⇒ Boolean
231 232 233 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 231 def data_loaded? !!@data end |
#db_snapshot_arn ⇒ String
The Amazon Resource Name (ARN) for the DB snapshot.
180 181 182 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 180 def db_snapshot_arn data.db_snapshot_arn end |
#delete(options = {}) ⇒ DBSnapshot
404 405 406 407 408 409 410 411 412 413 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 404 def delete( = {}) = .merge(db_snapshot_identifier: @snapshot_id) resp = @client.delete_db_snapshot() 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
Specifies whether the DB snapshot is encrypted.
167 168 169 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 167 def encrypted data.encrypted end |
#engine ⇒ String
Specifies the name of the database engine.
52 53 54 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 52 def engine data.engine end |
#engine_version ⇒ String
Specifies the version of the database engine.
103 104 105 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 103 def engine_version data.engine_version end |
#events(options = {}) ⇒ Event::Collection
728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 728 def events( = {}) batches = Enumerator.new do |y| = .merge( source_type: "db-snapshot", source_identifier: @snapshot_id ) resp = @client.describe_events() 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
True if mapping of AWS Identity and Access Management (IAM) accounts to database accounts is enabled; otherwise false.
196 197 198 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 196 def iam_database_authentication_enabled data.iam_database_authentication_enabled end |
#identifiers ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
773 774 775 776 777 778 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 773 def identifiers { instance_id: @instance_id, snapshot_id: @snapshot_id } end |
#instance ⇒ DBInstance
752 753 754 755 756 757 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 752 def instance DBInstance.new( id: @instance_id, client: @client ) end |
#instance_create_time ⇒ Time
Specifies the time when the snapshot was taken, in Universal Coordinated Time (UTC).
91 92 93 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 91 def instance_create_time data.instance_create_time end |
#instance_id ⇒ String Also known as: db_instance_identifier
32 33 34 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 32 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.
122 123 124 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 122 def iops data.iops end |
#kms_key_id ⇒ String
If ‘Encrypted` is true, the KMS key identifier for the encrypted DB snapshot.
174 175 176 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 174 def kms_key_id data.kms_key_id end |
#license_model ⇒ String
License model information for the restored DB instance.
109 110 111 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 109 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
213 214 215 216 217 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 213 def load resp = @client.describe_db_snapshots(db_snapshot_identifier: @snapshot_id) @data = resp.db_snapshots[0] self end |
#master_username ⇒ String
Provides the master username for the DB snapshot.
97 98 99 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 97 def master_username data.master_username end |
#option_group ⇒ OptionGroup?
760 761 762 763 764 765 766 767 768 769 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 760 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.
128 129 130 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 128 def option_group_name data.option_group_name end |
#percent_progress ⇒ Integer
The percentage of the estimated data that has been transferred.
134 135 136 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 134 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.
71 72 73 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 71 def port data.port end |
#restore(options = {}) ⇒ DBInstance
608 609 610 611 612 613 614 615 616 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 608 def restore( = {}) = .merge(db_snapshot_identifier: @snapshot_id) resp = @client.restore_db_instance_from_db_snapshot() DBInstance.new( id: resp.data.db_instance.db_instance_identifier, data: resp.data.db_instance, client: @client ) end |
#snapshot_create_time ⇒ Time
Provides the time when the snapshot was taken, in Universal Coordinated Time (UTC).
46 47 48 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 46 def snapshot_create_time data.snapshot_create_time end |
#snapshot_id ⇒ String Also known as: db_snapshot_identifier
38 39 40 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 38 def snapshot_id @snapshot_id end |
#snapshot_type ⇒ String
Provides the type of the DB snapshot.
115 116 117 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 115 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 value in case of cross-customer or cross-region copy.
148 149 150 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 148 def source_db_snapshot_identifier data.source_db_snapshot_identifier end |
#source_region ⇒ String
The AWS Region that the DB snapshot was created in or copied from.
140 141 142 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 140 def source_region data.source_region end |
#status ⇒ String
Specifies the status of this DB snapshot.
64 65 66 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 64 def status data.status end |
#storage_type ⇒ String
Specifies the storage type associated with DB snapshot.
154 155 156 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 154 def storage_type data.storage_type end |
#subscribe_to(options = {}) ⇒ EventSubscription
628 629 630 631 632 633 634 635 636 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 628 def subscribe_to( = {}) = .merge(source_identifier: @snapshot_id) resp = @client.add_source_identifier_to_subscription() EventSubscription.new( name: resp.data.event_subscription.cust_subscription_id, data: resp.data.event_subscription, client: @client ) end |
#tde_credential_arn ⇒ String
The ARN from the key store with which to associate the instance for TDE encryption.
161 162 163 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 161 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.
189 190 191 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 189 def timezone data.timezone end |
#unsubscribe_from(options = {}) ⇒ EventSubscription
648 649 650 651 652 653 654 655 656 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 648 def unsubscribe_from( = {}) = .merge(source_identifier: @snapshot_id) resp = @client.remove_source_identifier_from_subscription() 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.
84 85 86 |
# File 'lib/aws-sdk-rds/db_snapshot.rb', line 84 def vpc_id data.vpc_id end |