November 23, 2017
Retrieve the billing items  for the VSI in the account.

This script makes a single call to the getVirtualGuests() method in the
SoftLayer_Account API service and uses a object mask to get the
billing items and items for each VSI server in the account.

Important manual pages

Author: SoftLayer Technologies, Inc. <>
import SoftLayer

Client configuration
Your SoftLayer API username and key.
USERNAME = 'set me'
API_KEY = 'set me'

# Declare the API client
client = SoftLayer.Client(username=USERNAME, api_key=API_KEY)
accountService = client['SoftLayer_Account']

# Declaring the object mask to get information about the items.
objectMask = "mask[id, hostname, domain, datacenter[longName], billingItem[item]]"

    # Retrieve the VSIs billing items for the account.
    result = accountService.getVirtualGuests(mask=objectMask)
except SoftLayer.SoftLayerAPIError as e:
    print("Unable to retrieve the VSIs. " % (e.faultCode, e.faultString))