November 23, 2017
List the tags for a VSI

The scripts list all the tags set in an arbitrary  VSI,
it uses the SoftLayer_Virtual_Guest::getTagReferences method
to get the tags. For more information please see below

Important manual pages:

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

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

# The virtual guestId you wish to get the tags
virtualGuestId = 7844984

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

# Send the request to get the tags
    result = virtualGuestService.getTagReferences(id=virtualGuestId)
except SoftLayer.SoftLayerAPIError as e:
    print("Unable to list the tags 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