Skip to content

Instantly share code, notes, and snippets.

@underscorephil
Created October 10, 2013 20:31
Show Gist options
  • Save underscorephil/6925159 to your computer and use it in GitHub Desktop.
Save underscorephil/6925159 to your computer and use it in GitHub Desktop.
Delete a notification object
import SoftLayer.API
from pprint import pprint as pp
apiUsername = ''
apiKey = ''
client = SoftLayer.Client(
username=apiUsername,
api_key=apiKey,
)
# Virtual Guest Id
guest_id = 123456
guest = client['Virtual_Guest'].getObject(id=guest_id, mask="mask.monitoringUserNotification")
notification_id = guest['monitoringUserNotification'][0]['id']
# Create a list of SoftLayer_User_Customer_Notification_Virtual_Guest objects
# Only the id property is required
objects = [
{'id': notification_id}
]
# deleteObjects will return a bool
result = client['User_Customer_Notification_Virtual_Guest'].deleteObjects(objects)
pp(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment