Last active
December 12, 2015 06:49
-
-
Save underscorephil/4732131 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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