Created
December 17, 2012 14:45
-
-
Save underscorephil/4318794 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
require 'rubygems' | |
require 'softlayer_api' | |
$SL_API_USERNAME = "" # enter your username here | |
$SL_API_KEY = "" | |
virtual_guest_service = SoftLayer::Service.new("SoftLayer_Virtual_Guest") | |
begin | |
templateObject = { | |
'complexType' => "SoftLayer_Virtual_Guest", | |
'hostname' => 'test1', | |
'domain' => 'example.com', | |
'startCpus' => 1, | |
'maxMemory' => 1024, | |
'hourlyBillingFlag' => true, | |
'operatingSystemReferenceCode' => 'UBUNTU_LATEST', | |
'localDiskFlag' => false | |
} | |
result virtual_guest_service.createObject(templateObject); | |
puts result.inspect | |
rescue => e | |
$stdout.print(e.inspect) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
result virtual_guest_service.createObject(templateObject);
should be
result = virtual_guest_service.createObject(templateObject);