Created
July 29, 2014 20:16
-
-
Save huskercane/873ad18cbfcfa4668274 to your computer and use it in GitHub Desktop.
Use SoftLayer API to get password for a server created
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 'softlayer_api' | |
| require 'pp' | |
| softlayer_client = SoftLayer::Client.new() | |
| account = SoftLayer::Account.account_for_client(softlayer_client) | |
| servers = SoftLayer::VirtualServer.find_servers(:client => softlayer_client, :object_mask => "mask[id,primaryBackendIpAddress,primaryIpAddress, hostname, domain, operatingSystem[passwords]]") | |
| details = servers.map do |server| | |
| puts server['id'], server['primaryBackendIpAddress'], server['primaryIpAddress'] | |
| pp server['operatingSystem']['passwords'] | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment