Created
August 12, 2015 12:58
-
-
Save bmpotter/fe2de7f8028d73ada4e5 to your computer and use it in GitHub Desktop.
Example of ordering an hourly pre-set configuration bare metal server
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
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': 'test.com', | |
'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) | |
pprint.pprint(order) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment