Skip to content

Instantly share code, notes, and snippets.

@underscorephil
Created May 20, 2014 16:13
Show Gist options
  • Save underscorephil/17a8e84f79b7f3683e38 to your computer and use it in GitHub Desktop.
Save underscorephil/17a8e84f79b7f3683e38 to your computer and use it in GitHub Desktop.
client = SoftLayer.Client(
username=api_username,
api_key=api_key
)
guest = {
"complexType": "SoftLayer_Virtual_Guest",
"hostname": "userdatatest",
"domain": "example.com",
"startCpus": 1,
"dedicatedAccountHostOnlyFlag": True,
"maxMemory": 1024,
"operatingSystemReferenceCode": "UBUNTU_12_64",
"hourlyBillingFlag": True,
"localDiskFlag": False,
"networkComponents": [{"maxSpeed": "100"}],
"blockDevices": [{"device": "0", "diskImage": {"capacity": "25"}}],
"datacenter": {"name": "wdc01"},
"userData": [
{
"value": "{'testing': [{'user': 'data'}]}"
}
]
}
result = client['Virtual_Guest'].createObject(guest)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment