legacy-jclouds
legacy-jclouds copied to clipboard
Add support for private images in SoftLayer
Current implementation of listImages() returns a list of public images (Ubuntu, Centos, etc).
There are also private images (snapshots) that can be obtained using http://sldn.softlayer.com/reference/services/SoftLayer_Account/getBlockDeviceTemplateGroups/
To create a node from such a private image we can use Virtual_Guest/createObject method, see also issue #1282.
In this new method the image should be specified using http://sldn.softlayer.com/reference/datatypes/SoftLayer_Virtual_Guest_Block_Device_Template_Group parameter in http://sldn.softlayer.com/reference/services/SoftLayer_Virtual_Guest/createObject method call.
A sample Ruby code to do that is:
require 'rubygems'
require 'softlayer_api'
service = SoftLayer::Service.new("SoftLayer_Virtual_Guest")
service.createObject(
{"hostname" => "myhost",
"domain" => "mydomain.com",
"startCpus" => 1,
"maxMemory" => 1024,
"localDiskFlag" => true,
"hourlyBillingFlag" => true,
"datacenter" => {"name" => "ams01"},
"blockDeviceTemplateGroup" => {"globalIdentifier" => "65b5551d-1770-4694-XXXXXXXXXXXXXXX"},
})