softlayer / softlayer-ruby

http://softlayer.github.io/softlayer-ruby/
MIT License
54 stars 35 forks source link

TITLE: The "SoftLayer_Billing_Order_Quote::placeOrder" method fails when try to order a VSI using ruby client #75

Closed MiguelHigorre closed 7 years ago

MiguelHigorre commented 9 years ago

When trying to order a virtual server instance using the ruby client the "SoftLayer_Billing_Order_Quote::verifyOrder" method fails and raises the following exception:

"A hostname is missing from the order."

The exception is raised despite valid parameters are set and it is possible order using the same quote from UI and also using the php client.

To reproduce the problem use below code

require 'rubygems'

require 'softlayer_api'

require 'pp'

SL_API_USERNAME = "set-me"

SL_API_KEY = "set-me"

client = SoftLayer::Client.new( :username => "#{SL_API_USERNAME}", :api_key => "#{SL_API_KEY}")

quoteId = 1242802

order_templates = client['SoftLayer_Billing_Order_Quote'].object_with_id(quoteId).getRecalculatedOrderContainer()

order = order_templates['orderContainers'][0]

order['complexType'] = 'SoftLayer_Container_Product_Order_Virtual_Server' order['quantity'] = 1 order['location'] = '154820' order['hardware'] = [{'hostname'=> 'server01', 'domain'=> 'example.com'}]

begin receipt = client['SoftLayer_Billing_Order_Quote'].object_with_id(quoteId).placeOrder(order) pprint.pprint(receipt) rescue => error_reason puts "The order could not be verified #{error_reason}" end

renier commented 7 years ago

Closing as a dup of #74