November 23, 2017

List images templates

The script retrieves a list the images templates in the account,
it uses the ImageManager class.
For more information please see below.

Important manual pages

Author: SoftLayer Technologies, Inc. <>
import SoftLayer
from pprint import pprint as pp

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

# Generate one at
API_KEY = 'set me'

# Declare a new API service object
client = SoftLayer.create_client_from_env(username=API_USERNAME, api_key=API_KEY)
imageManager = SoftLayer.ImageManager(client)

# Declare variables
object_mask = "mask[children[blockDevices[diskImage[softwareReferences[softwareDescription]]]]]"

    result = imageManager.list_private_images(mask=object_mask)
except SoftLayer.SoftLayerAPIError as e:
    # If there was an error returned from the SoftLayer API then bomb out with the
    # error message.
    print("Unable to retrieve the image templates. \nfaultCode= %s, \nfaultString= %s"
          % (e.faultCode, e.faultString))


We would love to hear it
Open an issue