April 2, 2017


Reload with SSH keys

Reloads a server with an image template and some ssh keys
require 'softlayer_api'
require 'pp'

client = SoftLayer::Client.new(:timeout => 120)

imageId = 1234567
sshKey1 = 876543
sshKey2 = 456789
serverId = 1154265
        config = {
            'imageTemplateId'=> imageId, 
            'sshKeyIds' => [sshKey1, sshKey2]
        }

setclient = client['Hardware_Server']
reload = setclient.object_with_id(serverId).reloadOperatingSystem('FORCE', config)
pp reload	        

Feedback?

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