Skip to content

Instantly share code, notes, and snippets.

@underscorephil
Last active October 13, 2015 23:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save underscorephil/4271418 to your computer and use it in GitHub Desktop.
Save underscorephil/4271418 to your computer and use it in GitHub Desktop.
# 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 = ''
client = SoftLayer.Client(username=apiUsername, api_key=apiKey)
newCCI = {
'hostname': 'test1',
'domain': 'example.com',
'startCpus': 1,
'maxMemory': 1024,
'hourlyBillingFlag': 'true',
'operatingSystemReferenceCode': 'UBUNTU_LATEST',
'localDiskFlag': 'false'
}
result = client['Virtual_Guest'].createObject(newCCI)
pp(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment