November 23, 2017

List Virtual Guests.

Retrieve an account's associated virtual guest objects'

Important manual pages:
Author: SoftLayer Technologies, Inc. <>
# So we can talk to the SoftLayer API:
import SoftLayer

# For nice debug output:
from pprint import pprint as pp

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

# Generate one at
API_KEY = 'set me'

# Creates an object filter to get virtual guests with host different of zero.
filterInstance = {
    'virtualGuests': {
        'host': {
            'operation': 'not null'

# Creates a new connection to the API service.
client = SoftLayer.create_client_from_env(

    # Listing the Virtual Guests for current Account.
    listInstances = client['Account'].getVirtualGuests(
        limit=100, offset=0,
        filter=filterInstance)  # Page 1

except SoftLayer.SoftLayerAPIError as e:
        pp('Unable to get the Virtual Guests list faultCode=%s, faultString=%s'
            % (e.faultCode, e.faultString))


We would love to hear it
Open an issue