Class: Aws::RDS::ReservedDBInstance
- Inherits:
-
Object
- Object
- Aws::RDS::ReservedDBInstance
- Extended by:
- Deprecations
- Defined in:
- sig/reserved_db_instance.rbs,
lib/aws-sdk-rds/reserved_db_instance.rb
Overview
Defined Under Namespace
Classes: Collection
Read-Only Attributes collapse
-
#currency_code ⇒ String
The currency code for the reserved DB instance.
-
#db_instance_class ⇒ String
The DB instance class for the reserved DB instance.
-
#db_instance_count ⇒ Integer
The number of reserved DB instances.
-
#duration ⇒ Integer
The duration of the reservation in seconds.
-
#fixed_price ⇒ Float
The fixed price charged for this reserved DB instance.
- #id ⇒ String (also: #reserved_db_instance_id)
-
#lease_id ⇒ String
The unique identifier for the lease associated with the reserved DB instance.
-
#multi_az ⇒ Boolean
Indicates whether the reservation applies to Multi-AZ deployments.
-
#offering_type ⇒ String
The offering type of this reserved DB instance.
-
#product_description ⇒ String
The description of the reserved DB instance.
-
#recurring_charges ⇒ Array<Types::RecurringCharge>
The recurring price charged to run this reserved DB instance.
-
#reserved_db_instance_arn ⇒ String
The Amazon Resource Name (ARN) for the reserved DB instance.
-
#reserved_db_instances_offering_id ⇒ String
The offering identifier.
-
#start_time ⇒ Time
The time the reservation started.
-
#state ⇒ String
The state of the reserved DB instance.
-
#usage_price ⇒ Float
The hourly price charged for this reserved DB instance.
Associations collapse
- #identifiers ⇒ Object deprecated private Deprecated.
- #offering ⇒ ReservedDBInstancesOffering?
Instance Method Summary collapse
- #client ⇒ Client
-
#data ⇒ Types::ReservedDBInstance
Returns the data for this ReservedDBInstance.
-
#data_loaded? ⇒ Boolean
Returns
trueif this resource is loaded. -
#initialize(*args) ⇒ ReservedDBInstance
constructor
A new instance of ReservedDBInstance.
-
#load ⇒ self
(also: #reload)
Loads, or reloads #data for the current ReservedDBInstance.
-
#wait_until(options = {}) {|resource| ... } ⇒ Resource
deprecated
Deprecated.
Use [Aws::RDS::Client] #wait_until instead
Constructor Details
#initialize(id, options = {}) ⇒ ReservedDBInstance #initialize(options = {}) ⇒ ReservedDBInstance
Returns a new instance of ReservedDBInstance.
13 14 15 |
# File 'sig/reserved_db_instance.rbs', line 13
def initialize: (String id, Hash[Symbol, untyped] options) -> void
| (id: String, ?client: Client) -> void
| (Hash[Symbol, untyped] args) -> void
|
Instance Method Details
#client ⇒ Client
137 |
# File 'lib/aws-sdk-rds/reserved_db_instance.rb', line 137
def client: () -> Client
|
#currency_code ⇒ String
The currency code for the reserved DB instance.
40 |
# File 'sig/reserved_db_instance.rbs', line 40
def currency_code: () -> ::String
|
#data ⇒ Types::ReservedDBInstance
Returns the data for this Aws::RDS::ReservedDBInstance. Calls
Client#describe_reserved_db_instances if #data_loaded? is false.
73 |
# File 'sig/reserved_db_instance.rbs', line 73
def data: () -> Types::ReservedDBInstance
|
#data_loaded? ⇒ Boolean
76 |
# File 'sig/reserved_db_instance.rbs', line 76
def data_loaded?: () -> bool
|
#db_instance_class ⇒ String
The DB instance class for the reserved DB instance.
25 |
# File 'sig/reserved_db_instance.rbs', line 25
def db_instance_class: () -> ::String
|
#db_instance_count ⇒ Integer
The number of reserved DB instances.
43 |
# File 'sig/reserved_db_instance.rbs', line 43
def db_instance_count: () -> ::Integer
|
#duration ⇒ Integer
The duration of the reservation in seconds.
31 |
# File 'sig/reserved_db_instance.rbs', line 31
def duration: () -> ::Integer
|
#fixed_price ⇒ Float
The fixed price charged for this reserved DB instance.
34 |
# File 'sig/reserved_db_instance.rbs', line 34
def fixed_price: () -> ::Float
|
#id ⇒ String Also known as: reserved_db_instance_id
18 |
# File 'sig/reserved_db_instance.rbs', line 18
def id: () -> String
|
#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.
286 287 288 |
# File 'lib/aws-sdk-rds/reserved_db_instance.rb', line 286 def identifiers { id: @id } end |
#lease_id ⇒ String
The unique identifier for the lease associated with the reserved DB instance.
64 |
# File 'sig/reserved_db_instance.rbs', line 64
def lease_id: () -> ::String
|
#load ⇒ self Also known as: reload
Loads, or reloads #data for the current Aws::RDS::ReservedDBInstance.
Returns self making it possible to chain methods.
reserved_db_instance.reload.data
69 |
# File 'sig/reserved_db_instance.rbs', line 69
def load: () -> self
|
#multi_az ⇒ Boolean
Indicates whether the reservation applies to Multi-AZ deployments.
52 |
# File 'sig/reserved_db_instance.rbs', line 52
def multi_az: () -> bool
|
#offering ⇒ ReservedDBInstancesOffering?
80 |
# File 'sig/reserved_db_instance.rbs', line 80
def offering: () -> ReservedDBInstancesOffering?
|
#offering_type ⇒ String
The offering type of this reserved DB instance.
49 |
# File 'sig/reserved_db_instance.rbs', line 49
def offering_type: () -> ::String
|
#product_description ⇒ String
The description of the reserved DB instance.
46 |
# File 'sig/reserved_db_instance.rbs', line 46
def product_description: () -> ::String
|
#recurring_charges ⇒ Array<Types::RecurringCharge>
The recurring price charged to run this reserved DB instance.
58 |
# File 'sig/reserved_db_instance.rbs', line 58
def recurring_charges: () -> ::Array[Types::RecurringCharge]
|
#reserved_db_instance_arn ⇒ String
The Amazon Resource Name (ARN) for the reserved DB instance.
61 |
# File 'sig/reserved_db_instance.rbs', line 61
def reserved_db_instance_arn: () -> ::String
|
#reserved_db_instances_offering_id ⇒ String
The offering identifier.
22 |
# File 'sig/reserved_db_instance.rbs', line 22
def reserved_db_instances_offering_id: () -> ::String
|
#start_time ⇒ Time
The time the reservation started.
28 |
# File 'sig/reserved_db_instance.rbs', line 28
def start_time: () -> ::Time
|
#state ⇒ String
The state of the reserved DB instance.
55 |
# File 'sig/reserved_db_instance.rbs', line 55
def state: () -> ::String
|
#usage_price ⇒ Float
The hourly price charged for this reserved DB instance.
37 |
# File 'sig/reserved_db_instance.rbs', line 37
def usage_price: () -> ::Float
|
#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
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
# File 'lib/aws-sdk-rds/reserved_db_instance.rb', line 251 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 |