Last active
December 22, 2015 00:49
-
-
Save jimfdavies/6391771 to your computer and use it in GitHub Desktop.
Authenticates and lists your Rightscale deployments. Pretty much copied from Rightscale examples at http://support.rightscale.com/12-Guides/RightScale_API_1.5/Examples/
This file contains 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
# Pretty much copied from Rightscale examples at | |
# http://support.rightscale.com/12-Guides/RightScale_API_1.5/Examples/ | |
# Update and revision test | |
require 'rubygems' | |
require 'pp' # Require pretty print Ruby gem | |
require 'right_api_client' # RightScale API client gem | |
user = '[email protected]' # Set user email address for using the Dashboard | |
acct = '1234' # Set the account ID | |
pass = 'myPass' # Set the password for the user. | |
#Create client object so you can use the API. | |
@client = RightApi::Client.new(:email => user, :password => pass, :account_id => acct) | |
pp @client.accounts(:id => acct).show # Show account information | |
pp @client.deployments.index # Show all Deployments in this account | |
pp @client.server_templates.index # Show all ServerTemplates in this account | |
#pp @client.servers.index # Show all Servers in this account |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment