Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Example of ordering an hourly pre-set configuration bare metal server
import os
import pprint
import SoftLayer
client = SoftLayer.Client(username=os.environ['SLUSERNAME'], api_key=os.environ['SLAPIKEY'], endpoint_url=SoftLayer.API_PUBLIC_ENDPOINT)
hw = {
'datacenter': {'name': 'tor01'},
'hostname': 'simplebmi',
'domain': '',
'hourlyBillingFlag': True,
'fixedConfigurationPreset': {'keyName': 'S1270_8GB_2X1TBSATA_NORAID'},
'networkComponents': [{
'maxSpeed': 1000,
# 'redundancyEnabledFlag': True,
'operatingSystemReferenceCode': 'UBUNTU_14_64',
# this just verifies the order
productOrder = client['Hardware'].generateOrderTemplate(hw)
order = client['Product_Order'].verifyOrder(productOrder)
# to really order:
# order = client['Hardware'].createObject(productOrder)
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.