Sha256: 68f5e9e8ab2863c137d9c5c557816559f503b32f1aaad7d8f294bb81ae02b405

Contents?: true

Size: 1.29 KB

Versions: 3

Compression:

Stored size: 1.29 KB

Contents

#--
# Amazon Web Services EC2 Query API Ruby library
#
# Ruby Gem Name::  amazon-ec2
# Author::    Glenn Rempe  (mailto:grempe@rubyforge.org)
# Copyright:: Copyright (c) 2007 Glenn Rempe
# License::   Distributes under the same terms as Ruby
# Home::      http://amazon-ec2.rubyforge.org
#++

module EC2

  class Base

    #Amazon Developer Guide Docs:
    #
    # The ConfirmProductInstance operation returns true if the given product code is attached to the instance
    # with the given instance id. False is returned if the product code is not attached to the instance.
    #
    #Required Arguments:
    #
    # :product_code => String (default : "")
    # :instance_id => String (default : "")
    #
    #Optional Arguments:
    #
    # none
    #
    def confirm_product_instance( options ={} )

      options = {:product_code => "", :instance_id => ""}.merge(options)

      raise ArgumentError, "No product code provided" if options[:product_code].nil? || options[:product_code].empty?
      raise ArgumentError, "No instance ID provided" if options[:instance_id].nil? || options[:instance_id].empty?

      params = { "ProductCode" => options[:product_code], "InstanceId" => options[:instance_id] }

      return response_generator(:action => "ConfirmProductInstance", :params => params)

    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
amazon-ec2-0.2.6 lib/EC2/products.rb
amazon-ec2-0.2.7 lib/EC2/products.rb
amazon-ec2-0.2.8 lib/EC2/products.rb