Skip to content

Instantly share code, notes, and snippets.

@sudorandom
Forked from underscorephil/orderQuote.py
Last active December 21, 2015 05:29
Show Gist options
  • Save sudorandom/6257482 to your computer and use it in GitHub Desktop.
Save sudorandom/6257482 to your computer and use it in GitHub Desktop.
# So we can talk to the SoftLayer API:
import SoftLayer
# For nice debug output:
from pprint import pprint as pp
# Your SoftLayer API username and key.
#
# Generate an API key at the SoftLayer Customer Portal:
# https://manage.softlayer.com/Administrative/apiKeychain
apiUsername = ''
apiKey = ''
quoteId = 12345
client = SoftLayer.Client(username=apiUsername, api_key=apiKey)
def getOrderContainer(quoteId):
container = client['Product_Order'].getRecalculatedOrderContainer(
id=quoteId)
return container['orderContainers'][0]
container = getOrderContainer(quoteId)
container['complexType'] = 'SoftLayer_Container_Product_Order_Virtual_Guest'
container['hardware'] = [{'hostname': 'server01', 'domain': 'example.com'}]
result = client['Product_Order'].verifyOrder(container)
pp.pprint(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment