Skip to content

Instantly share code, notes, and snippets.

@jimfdavies
Last active December 22, 2015 00:49
Show Gist options
  • Save jimfdavies/6391771 to your computer and use it in GitHub Desktop.
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/
# 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 = 'x@x.com' # 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