Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Get the status of a bare metal server that is in the process of being provisioned
import os
import pprint
import SoftLayer
client = SoftLayer.Client(username=os.environ['SLUSERNAME'], api_key=os.environ['SLAPIKEY'], endpoint_url=SoftLayer.API_PUBLIC_ENDPOINT)
# Call this repeatedly while the bare metal server is being provisioned, until provisionDate is filled in.
mask = 'mask[id,fullyQualifiedDomainName,provisionDate,hardwareStatus,lastTransaction[elapsedSeconds,transactionStatus[friendlyName]],operatingSystem[id,passwords[password,username]]]'
hostname = 'simplebmi'
domain = ''
filterStr = {"hardware":{"hostname":{"operation":hostname},"domain":{"operation":domain}}}
svrs = client['Account'].getHardware(mask=mask, filter=filterStr)
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.