Last active
August 29, 2015 14:27
-
-
Save bmpotter/0249e838dce1370a7aa0 to your computer and use it in GitHub Desktop.
Get the status of a bare metal server that is in the process of being provisioned
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) | |
# 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 = 'test.com' | |
filterStr = {"hardware":{"hostname":{"operation":hostname},"domain":{"operation":domain}}} | |
svrs = client['Account'].getHardware(mask=mask, filter=filterStr) | |
pprint.pprint(svrs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment