Created
October 10, 2013 20:31
-
-
Save underscorephil/6925159 to your computer and use it in GitHub Desktop.
Delete a notification object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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