We've been using our SoftLayer API script to order baremetal servers for the past year without any issues. When I tried to place a new order today using quote, 2032985, I got the following error:
File "./order-softlayer-servers.py", line 69, in place_SoftLayerOrder order['orderContainers'][0]['hardware'] = [] KeyError: 'orderContainers'
The last successful order that I placed was on Jan 18, 2017. Was there a recent change to the API data model; such as orderContainers? Below is the main portion of my script.
Thank you.
import SoftLayer.API
def place_SoftLayerOrder(orderList,quote_id):
order = getOrderContainer(quote_id)
order['orderContainers'][0]['hardware'] = []
for server in orderList:
print server
order['orderContainers'][0]['hardware'].insert(0,{'hostname': server, 'domain': 'sl-netbase.com'})
order['orderContainers'][0]['quantity'] = len(orderList)
order['presetId'] = None
result = client['Billing_Order_Quote'].placeOrder(order, id=quote_id)
pp(result)
return result
{}to format your code. - codeforester