Class: Aws::RDS::ReservedDBInstancesOffering

Inherits:
Object
  • Object
show all
Extended by:
Deprecations
Defined in:
lib/aws-sdk-rds/reserved_db_instances_offering.rb

Defined Under Namespace

Classes: Collection

Read-Only Attributes collapse

Actions collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, options = {}) ⇒ ReservedDBInstancesOffering #initialize(options = {}) ⇒ ReservedDBInstancesOffering

Returns a new instance of ReservedDBInstancesOffering.

Overloads:



19
20
21
22
23
24
# File 'lib/aws-sdk-rds/reserved_db_instances_offering.rb', line 19

def initialize(*args)
  options = Hash === args.last ? args.pop.dup : {}
  @id = extract_id(args, options)
  @data = options.delete(:data)
  @client = options.delete(:client) || Client.new(options)
end

Instance Method Details

#clientClient

Returns:



91
92
93
# File 'lib/aws-sdk-rds/reserved_db_instances_offering.rb', line 91

def client
  @client
end

#currency_codeString

The currency code for the reserved DB instance offering.

Returns:

  • (String)


60
61
62
# File 'lib/aws-sdk-rds/reserved_db_instances_offering.rb', line 60

def currency_code
  data.currency_code
end

#dataTypes::ReservedDBInstancesOffering



111
112
113
114
# File 'lib/aws-sdk-rds/reserved_db_instances_offering.rb', line 111

def data
  load unless @data
  @data
end

#data_loaded?Boolean

Returns ‘true` if this resource is loaded. Accessing attributes or #data on an unloaded resource will trigger a call to #load.

Returns:

  • (Boolean)

    Returns ‘true` if this resource is loaded. Accessing attributes or #data on an unloaded resource will trigger a call to #load.



119
120
121
# File 'lib/aws-sdk-rds/reserved_db_instances_offering.rb', line 119

def data_loaded?
  !!@data
end

#db_instance_classString

The DB instance class for the reserved DB instance.

Returns:

  • (String)


36
37
38
# File 'lib/aws-sdk-rds/reserved_db_instances_offering.rb', line 36

def db_instance_class
  data.db_instance_class
end

#durationInteger

The duration of the offering in seconds.

Returns:

  • (Integer)


42
43
44
# File 'lib/aws-sdk-rds/reserved_db_instances_offering.rb', line 42

def duration
  data.duration
end

#fixed_priceFloat

The fixed price charged for this offering.

Returns:

  • (Float)


48
49
50
# File 'lib/aws-sdk-rds/reserved_db_instances_offering.rb', line 48

def fixed_price
  data.fixed_price
end

#idString Also known as: reserved_db_instances_offering_id

Returns:

  • (String)


29
30
31
# File 'lib/aws-sdk-rds/reserved_db_instances_offering.rb', line 29

def id
  @id
end

#identifiersObject

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.

Deprecated.


161
162
163
# File 'lib/aws-sdk-rds/reserved_db_instances_offering.rb', line 161

def identifiers
  { id: @id }
end

#loadself Also known as: reload

Loads, or reloads #data for the current Aws::RDS::ReservedDBInstancesOffering. Returns ‘self` making it possible to chain methods.

reserved_db_instances_offering.reload.data

Returns:

  • (self)


101
102
103
104
105
# File 'lib/aws-sdk-rds/reserved_db_instances_offering.rb', line 101

def load
  resp = @client.describe_reserved_db_instances_offerings(reserved_db_instances_offering_id: @id)
  @data = resp.reserved_db_instances_offerings[0]
  self
end

#multi_azBoolean

Indicates if the offering applies to Multi-AZ deployments.

Returns:

  • (Boolean)


78
79
80
# File 'lib/aws-sdk-rds/reserved_db_instances_offering.rb', line 78

def multi_az
  data.multi_az
end

#offering_typeString

The offering type.

Returns:

  • (String)


72
73
74
# File 'lib/aws-sdk-rds/reserved_db_instances_offering.rb', line 72

def offering_type
  data.offering_type
end

#product_descriptionString

The database engine used by the offering.

Returns:

  • (String)


66
67
68
# File 'lib/aws-sdk-rds/reserved_db_instances_offering.rb', line 66

def product_description
  data.product_description
end

#purchase(options = {}) ⇒ ReservedDBInstance

Examples:

Request syntax with placeholder values


reserveddbinstance = reserved_db_instances_offering.purchase({
  reserved_db_instance_id: "String",
  db_instance_count: 1,
  tags: [
    {
      key: "String",
      value: "String",
    },
  ],
})

Parameters:

  • options (Hash) (defaults to: {})

    ({})

Options Hash (options):

  • :reserved_db_instance_id (String)

    Customer-specified identifier to track this reservation.

    Example: myreservationID

  • :db_instance_count (Integer)

    The number of instances to reserve.

    Default: ‘1`

  • :tags (Array<Types::Tag>)

    A list of tags.

Returns:



149
150
151
152
153
154
155
156
157
# File 'lib/aws-sdk-rds/reserved_db_instances_offering.rb', line 149

def purchase(options = {})
  options = options.merge(reserved_db_instances_offering_id: @id)
  resp = @client.purchase_reserved_db_instances_offering(options)
  ReservedDBInstance.new(
    id: resp.data.reserved_db_instance.reserved_db_instance_id,
    data: resp.data.reserved_db_instance,
    client: @client
  )
end

#recurring_chargesArray<Types::RecurringCharge>

The recurring price charged to run this reserved DB instance.

Returns:



84
85
86
# File 'lib/aws-sdk-rds/reserved_db_instances_offering.rb', line 84

def recurring_charges
  data.recurring_charges
end

#usage_priceFloat

The hourly price charged for this offering.

Returns:

  • (Float)


54
55
56
# File 'lib/aws-sdk-rds/reserved_db_instances_offering.rb', line 54

def usage_price
  data.usage_price
end