You are viewing documentation for version 1 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Class: AWS::EC2::ReservedInstancesOffering

Inherits:
Resource
  • Object
show all
Includes:
TaggedItem
Defined in:
lib/aws/ec2/reserved_instances_offering.rb

Constant Summary

ATTRIBUTES =
[
  :instance_type,
  :availability_zone,
  :duration,
  :fixed_price,
  :usage_price,
  :product_description,
  :instance_tenancy,
  :currency_code,
  :recurring_charges,
  :offering_type,
]

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from TaggedItem

#add_tag, #clear_tags, #tags

Constructor Details

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

Returns a new instance of ReservedInstancesOffering



33
34
35
36
# File 'lib/aws/ec2/reserved_instances_offering.rb', line 33

def initialize id, options = {}
  @id = id
  super
end

Instance Attribute Details

#idString (readonly)

Returns The id of this reserved instance offering.

Returns:

  • (String)

    The id of this reserved instance offering.



39
40
41
# File 'lib/aws/ec2/reserved_instances_offering.rb', line 39

def id
  @id
end

Instance Method Details

#purchase(options = {}) ⇒ Object



51
52
53
54
55
56
# File 'lib/aws/ec2/reserved_instances_offering.rb', line 51

def purchase options = {}
  options[:instance_count] = 1 unless options[:instance_count]
  options[:reserved_instances_offering_id] = id
  response = client.purchase_reserved_instances_offering(options)
  ReservedInstances.new(response.reserved_instances_id, :config => config)
end