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, ]
Instance Attribute Summary collapse
-
#id ⇒ String
readonly
The id of this reserved instance offering.
Attributes included from Core::Model
Instance Method Summary collapse
-
#initialize(id, options = {}) ⇒ ReservedInstancesOffering
constructor
A new instance of ReservedInstancesOffering.
- #purchase(options = {}) ⇒ Object
Methods included from TaggedItem
#add_tag, #cached_tags, #clear_tags, #tagging_resource_type, #tags
Methods inherited from Core::Resource
attribute_providers, attribute_providers_for, attributes, #attributes_from_response, define_attribute_type, #eql?, #inspect, new_from
Methods included from Core::Cacheable
Methods included from Core::Model
#client, #config_prefix, #inspect
Constructor Details
#initialize(id, options = {}) ⇒ ReservedInstancesOffering
Returns a new instance of ReservedInstancesOffering.
31 32 33 34 |
# File 'lib/aws/ec2/reserved_instances_offering.rb', line 31 def initialize id, = {} @id = id super end |
Instance Attribute Details
#id ⇒ String (readonly)
Returns The id of this reserved instance offering.
37 38 39 |
# File 'lib/aws/ec2/reserved_instances_offering.rb', line 37 def id @id end |
Instance Method Details
#purchase(options = {}) ⇒ Object
49 50 51 52 53 54 |
# File 'lib/aws/ec2/reserved_instances_offering.rb', line 49 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 |