Here is the sample code that I am using
!/usr/bin/env ruby
require 'softlayer_api'
require 'pp'
softlayer_client = SoftLayer::Client.new()
server = SoftLayer::VirtualServer.server_with_id('5508708', client: softlayer_client)
puts server.inspect
server.capture_image('master_image', true, 'master_image_note')
Here is the output that I see
home/rohits/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/xmlrpc/create.rb:202:in conv2value': Wrong type NilClass. Not allowed! (RuntimeError) from /home/rohits/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/xmlrpc/create.rb:118:inblock in methodCall'
from /home/rohits/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/xmlrpc/create.rb:117:in collect' from /home/rohits/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/xmlrpc/create.rb:117:inmethodCall'
from /home/rohits/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/xmlrpc/client.rb:285:in call2' from /home/rohits/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/xmlrpc/client.rb:267:incall'
from /home/rohits/.rvm/gems/ruby-2.1.1/gems/softlayer_api-2.1.1/lib/softlayer/Service.rb:278:in call_softlayer_api_with_params' from /home/rohits/.rvm/gems/ruby-2.1.1/gems/softlayer_api-2.1.1/lib/softlayer/APIParameterFilter.rb:201:inmethod_missing'
from /home/rohits/.rvm/gems/ruby-2.1.1/gems/softlayer_api-2.1.1/lib/softlayer/VirtualServer.rb:153:in capture_image' from ./create_image2.rb:12:in
'
It does work if I do this
require 'softlayer_api'
require 'pp'
softlayer_client = SoftLayer::Client.new()
virtual_guest_service = SoftLayer::Service.new("SoftLayer_Virtual_Guest")
CAUTION - hardcoding server id here
server = virtual_guest_service.object_with_id("5508708")
block_devices = server.getBlockDevices
puts server.inspect
img1 = server.createArchiveTransaction("master-image",
[{"id" => block_devices[0]['id']}], "master-image")
puts img1.inspect
Here is the sample code that I am using
!/usr/bin/env ruby
require 'softlayer_api'
require 'pp'
softlayer_client = SoftLayer::Client.new()
server = SoftLayer::VirtualServer.server_with_id('5508708', client: softlayer_client)
puts server.inspect
server.capture_image('master_image', true, 'master_image_note')
Here is the output that I see
'home/rohits/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/xmlrpc/create.rb:202:in
conv2value': Wrong type NilClass. Not allowed! (RuntimeError) from /home/rohits/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/xmlrpc/create.rb:118:inblock in methodCall'from /home/rohits/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/xmlrpc/create.rb:117:in
collect' from /home/rohits/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/xmlrpc/create.rb:117:inmethodCall'from /home/rohits/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/xmlrpc/client.rb:285:in
call2' from /home/rohits/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/xmlrpc/client.rb:267:incall'from /home/rohits/.rvm/gems/ruby-2.1.1/gems/softlayer_api-2.1.1/lib/softlayer/Service.rb:278:in
call_softlayer_api_with_params' from /home/rohits/.rvm/gems/ruby-2.1.1/gems/softlayer_api-2.1.1/lib/softlayer/APIParameterFilter.rb:201:inmethod_missing'from /home/rohits/.rvm/gems/ruby-2.1.1/gems/softlayer_api-2.1.1/lib/softlayer/VirtualServer.rb:153:in
capture_image' from ./create_image2.rb:12:inIt does work if I do this
require 'softlayer_api'
require 'pp'
softlayer_client = SoftLayer::Client.new()
virtual_guest_service = SoftLayer::Service.new("SoftLayer_Virtual_Guest")
CAUTION - hardcoding server id here
server = virtual_guest_service.object_with_id("5508708")
block_devices = server.getBlockDevices
puts server.inspect
img1 = server.createArchiveTransaction("master-image",
[{"id" => block_devices[0]['id']}], "master-image")
puts img1.inspect