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.
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
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