November 23, 2017
Get Hardware

This script retrieves the SoftLayer_Hardware object whose ID number corresponds
to the ID number of the init parameter passed to the SoftLayer_Hardware service.
You can only retrieve the account that your portal user is assigned to.

Important manual pages:

Author: SoftLayer Technologies, Inc. <>

import SoftLayer
import json

# Your SoftLayer API username and key.
API_USERNAME = 'set-me'

# Generate one at
API_KEY = 'set-me'

client = SoftLayer.create_client_from_env(username=API_USERNAME, api_key=API_KEY)
packageService = client['SoftLayer_Hardware']

packageId = 308926

    presets = packageService.getObject(id=packageId)
    print(json.dumps(presets, sort_keys=True, indent=2, separators=(',', ': ')))
except SoftLayer.SoftLayerAPIError as e:
    print("Unable to list the presets for the package: \nfaultCode= %s, \nfaultString= %s"
          % (e.faultCode, e.faultString))