November 23, 2017


# Example to stop sharing an image template
# Important manual pages:
# License <>
# author SoftLayer Technologies, Inc. <>
require 'softlayer_api'
require 'pp'

USERNAME = 'set me'
API_KEY = 'set me'

# Declaring the API client
client = USERNAME, api_key: API_KEY)
block_device_template_group_service = client.service_named('SoftLayer_Virtual_Guest_Block_Device_Template_Group')

# The image template which you wish to stop sharing
# To get the list of images templates in your account call the Softlayer_Account::SoftLayer_Virtual_Guest_Block_Device_Template_Group method
image_template_id = 315_894

# The account you wish to stop sharing the image template
account_to_share = 207_819

  result = block_device_template_group_service.object_with_id(image_template_id).denySharingAccess(account_to_share)
  print result
rescue => error_reason
  puts "Unable to stop sharing the image template #{error_reason}"


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