Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Order dedicated server from a Flex Image
# 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
You can’t perform that action at this time.