November 23, 2017
Delete a notification subscription

The script deletes a notification for a determinate user in a determinate Virtual Guest
for more reference see these reference pages

Important manual pages:

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

# 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)
userCustomerNotification = client['SoftLayer_User_Customer_Notification_Virtual_Guest']

Build a SoftLayer_User_Customer_Notification_Virtual_Guest skeleton object
which contains the id we wish to delete
To get the notifications for an determinate Virtual Guest
call the getObject method + the mask "mask[monitoringUserNotification]"
guestId = 7698972
guest = client['Virtual_Guest'].getObject(id=guestId, mask="mask[monitoringUserNotification]")
notifications = guest['monitoringUserNotification']
print (notifications)
notification = [
        'id': 2154178

    result = userCustomerNotification.deleteObjects(notification)
except SoftLayer.SoftLayerAPIError as e:
    print("Unable to delete the notification "
          % (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