April 25, 2018


SuscribeUserUnplainedIncident.rb

SuscribeUserUnplainedIncident.rb
require 'softlayer_api'
require 'pp'


username = ''
key = 'apikey_goes_here'

#The customer ID you whish add the suscription
customerID = 205830

client = SoftLayer::Client.new( :username => username,:api_key => key)

userClient = client.service_named('SoftLayer_User_Customer')

result = userClient.object_with_id(customerID).addNotificationSubscriber("UNPLANNED_INCIDENT")
# if the notification suscriber has been added we procede to create the suscriberDeliveryMethods
if result
  deliveryMethodKeyNames = [
                           "EMAIL"
                           ]
  result = userClient.object_with_id(customerID).createSubscriberDeliveryMethods("UNPLANNED_INCIDENT", deliveryMethodKeyNames)
  pp (result)
end

Feedback?

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