Forked from underscorephil/order_dedicated_flex_image.py
Last active
December 21, 2015 05:29
-
-
Save sudorandom/6257534 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 = '' | |
templateId = 1234 | |
client = SoftLayer.Client(username=apiUsername, api_key=apiKey) | |
order = { | |
'complexType': 'SoftLayer_Container_Product_Order_Hardware_Server', | |
'quantity': 2, | |
'hardware': [ | |
{'hostname': 'host1', 'domain': 'example.com'}, | |
{'hostname': 'host2', 'domain': 'example.com'}, | |
], | |
'location': 168642, # San Jose 1 | |
'packageId': 23, # Intel Xeon 3200 Series | |
'prices': [ | |
{'id': 1613}, # Server - Single Processor Quad Core Xeon 3230 - 2.60GHz (Kentsfield) - 2 x 4MB cache | |
{'id': 21001}, # Ram - 4 GB DDR2 667 | |
{'id': 876}, # Disk Controller - Non-RAID | |
{'id': 1272}, # First Hard Drive - 73GB SA-SCSI 10K RPM | |
{'id': 131}, # Public Bandwidth - 10000 GB Bandwidth | |
{'id': 272}, # Uplink Port Speeds - 10 Mbps Public & Private Networks | |
{'id': 906}, # Remote Management - Reboot / KVM over IP | |
{'id': 21}, # Primary IP Addresses - 1 IP Address | |
{'id': 51}, # Lockbox - 1 GB Lockbox | |
{'id': 55}, # Monitoring - Host Ping | |
{'id': 57}, # Notification - Email and Ticket | |
{'id': 60}, # Response - 24x7x365 NOC Monitoring, Notification, and Response | |
{'id': 420}, # VPN Management - Private Network - Unlimited SSL VPN Users & 1 PPTP VPN User per account | |
{'id': 418}, # Vulnerability Assessments & Management - Nessus Vulnerability Assessment & Reporting | |
], | |
'imageTemplateId': templateId | |
} | |
result = client['Product_Order'].verifyOrder(order) | |
pp(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment