November 23, 2017


# Detach portal storage
# Important manual pages
require 'softlayer_api'
require 'pp'

# Your SoftLayer API username and key.
USERNAME = 'set me'
API_KEY = 'set me'

# The portal storage ID which you wish to attach
image_id = 482_714_4
# The virtual guest Id where you wish to attach the portal storage
virtual_guest_id = 566_006_6

# Declaring the API client to use the SoftLayer_Virtual_Guest API service
client = USERNAME, api_key: API_KEY)
virtual_guest_service = client.service_named('SoftLayer_Virtual_Guest')

  result = virtual_guest_service.object_with_id(virtual_guest_id).detachDiskImage(image_id)
  pp result
rescue StandardError => exception
  puts "Unable to detach the portable storages.  #{exception}"


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