November 23, 2017
Get active presets prices

This script retrieves the available preset configurations for this package, also
it provides information about the prices and items from them.

Important manual pages:

@Author: SoftLayer Technologies, Inc. <>

# So we can talk to the SoftLayer API:
import SoftLayer

# Your SoftLayer API username and key.
API_USERNAME = 'set me'
API_KEY = 'set me'
# Declare the package id
packageId = 200
# Create a client instance
client = SoftLayer.Client(username=API_USERNAME, api_key=API_KEY)
# Declare an object mask to get prices and items information
objectMask = 'mask[prices[item]]'
    activePresets = client['SoftLayer_Product_Package'].getActivePresets(id=packageId, mask=objectMask)
    for activePreset in activePresets:
        print('Id: %s, Description: %s, isActive: %s' % (activePreset['id'], activePreset['description'], activePreset['isActive']))
        print('        KeyName: %s, Name: %s' % (activePreset['keyName'], activePreset['name']))
        for prices in activePreset['prices']:
            print('                 Price Id: %s, Item Id: %s Item Description: %s' % (prices['id'], prices['item']['id'], prices['item']['description']))
except SoftLayer.SoftLayerAPIError as e:
    print("Unable to get active presets faultCode=%s, faultString=%s" % (e.faultCode, e.faultString))


If this article contains any error, or leaves any of your questions unanswered, please help us out by opening up a github issue.
Open an issue