Class: AWS::EC2::ReservedInstancesOffering
- Inherits:
-
Resource
- Object
- Core::Resource
- Resource
- AWS::EC2::ReservedInstancesOffering
- Includes:
- TaggedItem
- Defined in:
- lib/aws/ec2/reserved_instances_offering.rb
Constant Summary collapse
- ATTRIBUTES =
[ :instance_type, :availability_zone, :duration, :fixed_price, :usage_price, :product_description, :instance_tenancy, :currency_code, :recurring_charges, :offering_type, ]
Instance Attribute Summary collapse
-
#id ⇒ String
readonly
The id of this reserved instance offering.
Instance Method Summary collapse
-
#initialize(id, options = {}) ⇒ ReservedInstancesOffering
constructor
A new instance of ReservedInstancesOffering.
- #purchase(options = {}) ⇒ Object
Methods included from TaggedItem
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, = {} @id = id super end |
Instance Attribute Details
#id ⇒ String (readonly)
Returns 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 = {} [:instance_count] = 1 unless [:instance_count] [:reserved_instances_offering_id] = id response = client.purchase_reserved_instances_offering() ReservedInstances.new(response.reserved_instances_id, :config => config) end |