Skip to content

Instantly share code, notes, and snippets.

@chechuironman
Last active August 29, 2015 14:01
Show Gist options
  • Save chechuironman/bfd2303a941627eee37c to your computer and use it in GitHub Desktop.
Save chechuironman/bfd2303a941627eee37c to your computer and use it in GitHub Desktop.
push user data to a server
#!/usr/bin/ruby
##################################################################################
# Push user data to a VM
# ©Copyright IBM Corporation 2014.
# LICENSE: MIT (http://opensource.org/licenses/MIT)
# gems used:
# rubygems, softlayer-api
##################################################################################
require 'rubygems'
require 'softlayer_api'
$SL_API_USERNAME = "xxxx" # enter your username here
$SL_API_KEY = "xxxx" # enter your apiKey here
vm = SoftLayer::Service.new("SoftLayer_Virtual_Guest")
testdata=[ "data_here_1 "]
vm.object_with_id(server_id).setUserMetadata(testdata)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment