Class: AWS::RDS::DBInstance
- Inherits:
-
Core::Resource
- Object
- Core::Resource
- AWS::RDS::DBInstance
- Defined in:
- lib/aws/rds/db_instance.rb
Instance Attribute Summary collapse
-
#allocated_storage ⇒ Integer
readonly
The current value of allocated_storage.
-
#auto_minor_version_upgrade ⇒ Boolean
readonly
The current value of auto_minor_version_upgrade.
-
#availability_zone_name ⇒ String
readonly
The current value of availability_zone_name.
-
#backup_retention_period ⇒ Integer
readonly
The current value of backup_retention_period.
-
#character_set_name ⇒ String
readonly
The current value of character_set_name.
-
#creation_date_time ⇒ Time
readonly
The current value of creation_date_time.
-
#db_instance_class ⇒ String
readonly
The current value of db_instance_class.
- #db_instance_identifier ⇒ String (also: #id, #db_instance_id) readonly
-
#db_instance_status ⇒ String
readonly
The current value of db_instance_status.
-
#db_name ⇒ String
readonly
The current value of db_name.
-
#endpoint_address ⇒ String
readonly
The current value of endpoint_address.
-
#endpoint_port ⇒ Integer
readonly
The current value of endpoint_port.
-
#engine ⇒ String
readonly
The current value of engine.
-
#engine_version ⇒ String
readonly
The current value of engine_version.
-
#iops ⇒ Integer
readonly
The current value of iops.
-
#latest_restorable_time ⇒ Time
readonly
The current value of latest_restorable_time.
-
#license_model ⇒ String
readonly
The current value of license_model.
-
#master_username ⇒ String
readonly
The current value of master_username.
-
#multi_az ⇒ Boolean
readonly
The current value of multi_az.
-
#preferred_backup_window ⇒ String
readonly
The current value of preferred_backup_window.
-
#preferred_maintenance_window ⇒ String
readonly
The current value of preferred_maintenance_window.
-
#read_replica_db_instance_identifiers ⇒ Array<String>
readonly
The current value of read_replica_db_instance_identifiers.
-
#read_replica_source_db_instance_identifier ⇒ String
readonly
The current value of read_replica_source_db_instance_identifier.
-
#vpc_id ⇒ String?
readonly
The current value of vpc_id.
Instance Method Summary collapse
- #create_snapshot(db_snapshot_id) ⇒ DBSnapshot
-
#delete(options = {}) ⇒ nil
Terminates (deletes) this database instance.
-
#exists? ⇒ Boolean
Returns
true
if the db instance exists. -
#initialize(db_instance_id, options = {}) ⇒ DBInstance
constructor
A new instance of DBInstance.
-
#modify(options = {}) ⇒ Object
Modifies the database instance.
-
#reboot(options = {}) ⇒ nil
Reboots this databse instance.
- #snapshots ⇒ DBSnapshotCollection
- #vpc ⇒ EC2::VPC?
Constructor Details
#initialize(db_instance_id, options = {}) ⇒ DBInstance
Returns a new instance of DBInstance.
68 69 70 71 |
# File 'lib/aws/rds/db_instance.rb', line 68 def initialize db_instance_id, = {} @db_instance_identifier = db_instance_id super end |
Instance Attribute Details
#allocated_storage ⇒ Integer (readonly)
Returns the current value of allocated_storage.
64 65 66 |
# File 'lib/aws/rds/db_instance.rb', line 64 def allocated_storage @allocated_storage end |
#auto_minor_version_upgrade ⇒ Boolean (readonly)
Returns the current value of auto_minor_version_upgrade.
64 65 66 |
# File 'lib/aws/rds/db_instance.rb', line 64 def auto_minor_version_upgrade @auto_minor_version_upgrade end |
#availability_zone_name ⇒ String (readonly)
Returns the current value of availability_zone_name.
64 65 66 |
# File 'lib/aws/rds/db_instance.rb', line 64 def availability_zone_name @availability_zone_name end |
#backup_retention_period ⇒ Integer (readonly)
Returns the current value of backup_retention_period.
64 65 66 |
# File 'lib/aws/rds/db_instance.rb', line 64 def backup_retention_period @backup_retention_period end |
#character_set_name ⇒ String (readonly)
Returns the current value of character_set_name.
64 65 66 |
# File 'lib/aws/rds/db_instance.rb', line 64 def character_set_name @character_set_name end |
#creation_date_time ⇒ Time (readonly)
Returns the current value of creation_date_time.
64 65 66 |
# File 'lib/aws/rds/db_instance.rb', line 64 def creation_date_time @creation_date_time end |
#db_instance_class ⇒ String (readonly)
Returns the current value of db_instance_class.
64 65 66 |
# File 'lib/aws/rds/db_instance.rb', line 64 def db_instance_class @db_instance_class end |
#db_instance_identifier ⇒ String (readonly) Also known as: id, db_instance_id
74 75 76 |
# File 'lib/aws/rds/db_instance.rb', line 74 def db_instance_identifier @db_instance_identifier end |
#db_instance_status ⇒ String (readonly)
Returns the current value of db_instance_status.
64 65 66 |
# File 'lib/aws/rds/db_instance.rb', line 64 def db_instance_status @db_instance_status end |
#db_name ⇒ String (readonly)
Returns the current value of db_name.
64 65 66 |
# File 'lib/aws/rds/db_instance.rb', line 64 def db_name @db_name end |
#endpoint_address ⇒ String (readonly)
Returns the current value of endpoint_address.
64 65 66 |
# File 'lib/aws/rds/db_instance.rb', line 64 def endpoint_address @endpoint_address end |
#endpoint_port ⇒ Integer (readonly)
Returns the current value of endpoint_port.
64 65 66 |
# File 'lib/aws/rds/db_instance.rb', line 64 def endpoint_port @endpoint_port end |
#engine ⇒ String (readonly)
Returns the current value of engine.
64 65 66 |
# File 'lib/aws/rds/db_instance.rb', line 64 def engine @engine end |
#engine_version ⇒ String (readonly)
Returns the current value of engine_version.
64 65 66 |
# File 'lib/aws/rds/db_instance.rb', line 64 def engine_version @engine_version end |
#iops ⇒ Integer (readonly)
Returns the current value of iops.
64 65 66 |
# File 'lib/aws/rds/db_instance.rb', line 64 def iops @iops end |
#latest_restorable_time ⇒ Time (readonly)
Returns the current value of latest_restorable_time.
64 65 66 |
# File 'lib/aws/rds/db_instance.rb', line 64 def latest_restorable_time @latest_restorable_time end |
#license_model ⇒ String (readonly)
Returns the current value of license_model.
64 65 66 |
# File 'lib/aws/rds/db_instance.rb', line 64 def license_model @license_model end |
#master_username ⇒ String (readonly)
Returns the current value of master_username.
64 65 66 |
# File 'lib/aws/rds/db_instance.rb', line 64 def master_username @master_username end |
#multi_az ⇒ Boolean (readonly)
Returns the current value of multi_az.
64 65 66 |
# File 'lib/aws/rds/db_instance.rb', line 64 def multi_az @multi_az end |
#preferred_backup_window ⇒ String (readonly)
Returns the current value of preferred_backup_window.
64 65 66 |
# File 'lib/aws/rds/db_instance.rb', line 64 def preferred_backup_window @preferred_backup_window end |
#preferred_maintenance_window ⇒ String (readonly)
Returns the current value of preferred_maintenance_window.
64 65 66 |
# File 'lib/aws/rds/db_instance.rb', line 64 def preferred_maintenance_window @preferred_maintenance_window end |
#read_replica_db_instance_identifiers ⇒ Array<String> (readonly)
Returns the current value of read_replica_db_instance_identifiers.
64 65 66 |
# File 'lib/aws/rds/db_instance.rb', line 64 def read_replica_db_instance_identifiers @read_replica_db_instance_identifiers end |
#read_replica_source_db_instance_identifier ⇒ String (readonly)
Returns the current value of read_replica_source_db_instance_identifier.
64 65 66 |
# File 'lib/aws/rds/db_instance.rb', line 64 def read_replica_source_db_instance_identifier @read_replica_source_db_instance_identifier end |
#vpc_id ⇒ String? (readonly)
Returns the current value of vpc_id.
64 65 66 |
# File 'lib/aws/rds/db_instance.rb', line 64 def vpc_id @vpc_id end |
Instance Method Details
#create_snapshot(db_snapshot_id) ⇒ DBSnapshot
164 165 166 167 168 169 170 171 172 173 174 |
# File 'lib/aws/rds/db_instance.rb', line 164 def create_snapshot db_snapshot_id = {} [:db_snapshot_identifier] = db_snapshot_id [:db_instance_identifier] = db_instance_identifier resp = client.create_db_snapshot() DBSnapshot.new_from(:create_db_snapshot, resp, resp[:db_snapshot_identifier], :config => config) end |
#delete(options = {}) ⇒ nil
Terminates (deletes) this database instance.
189 190 191 192 |
# File 'lib/aws/rds/db_instance.rb', line 189 def delete = {} client.delete_db_instance(.merge(:db_instance_identifier => id)) nil end |
#exists? ⇒ Boolean
Returns true
if the db instance exists.
195 196 197 198 199 200 201 202 |
# File 'lib/aws/rds/db_instance.rb', line 195 def exists? begin get_resource true rescue AWS::RDS::Errors::DBInstanceNotFound false end end |
#modify(options = {}) ⇒ Object
You do not need to set :db_instance_identifier
.
Modifies the database instance.
154 155 156 |
# File 'lib/aws/rds/db_instance.rb', line 154 def modify = {} client.modify_db_instance(.merge(:db_instance_identifier => id)) end |
#reboot(options = {}) ⇒ nil
Reboots this databse instance.
182 183 184 185 |
# File 'lib/aws/rds/db_instance.rb', line 182 def reboot = {} client.reboot_db_instance(.merge(:db_instance_identifier => id)) nil end |
#snapshots ⇒ DBSnapshotCollection
159 160 161 |
# File 'lib/aws/rds/db_instance.rb', line 159 def snapshots DBSnapshotCollection.new(:config => config).db_instance(self) end |