Note: Please go to to access the current RightScale documentation set. Also, feel free to Chat with us!
Home > Guides > RightScale API 1.5 > Examples > Accounts > Show Account

Show Account

Show information about a specified account.

icon_curl_v1.png    icon_rs_api_client_v1.png     icon_powershell_v1.png   

Table of Contents


Prerequisite:  Example assumes you have previously authenticated, and your valid session cookie is in 'mycookie'.

Note:  This is about the simplest API call to make.  Since you have to provide the account ID to get the account ID it of course has very little utility in the context of this stand alone example. 

Example Call

#!/bin/sh -e
curl -i -H X_API_VERSION:1.5 -b mycookie -X GET$ACCOUNT.xml

Sample Output

HTTP/1.1 200 OK
Server: nginx/1.0.15
Date: Fri, 02 Nov 2012 20:25:35 GMT
Content-Type: application/vnd.rightscale.account+xml;charset=utf-8
Connection: keep-alive
Status: 200 OK
X-Runtime: 42
Content-Length: 358
X-Request-Uuid: fc3d3b6d2d864815ad976f1f2324c617
Cache-Control: private, max-age=0, must-revalidate

<?xml version="1.0" encoding="UTF-8"?>
  <created_at>2007/01/09 06:20:08 +0000</created_at>
    <link rel="self" href="/api/accounts/1234"/>
    <link rel="owner" href="/api/users/2"/>
    <link rel="cluster" href="/api/clusters/1"/>
  <updated_at>2012/09/20 02:10:25 +0000</updated_at>
  <name>TEST API Account</name>


Example Call

require 'rubygems'
require 'pp'                          # Require pretty print Ruby gem
require 'right_api_client'            # RightScale API client gem

user = ''         # Set user email address for usingthe Dashboard
acct = '1234'                         # Set the account ID
pass = 'SomeSecurePassword'           # Set the password for the user.  Create client object so you can use the API.
@client = => user, :password => pass, :account_id => acct)
# Setup and authenticate above. Set and use additional variables below, display output, etc.
pp @client.accounts(:id => acct).show       # Show account '1234' information

Sample Output

#<RightApi::ResourceDetail resource_type="account", name="GregDoe">



Prerequisite:  Example assumes you have previously authenticated and your session cookie for subsequent requests is in 'cookieContainer'.

Example Call

#get cookie container from authentication $cookieContainer
$showAccountRequest = [System.Net.WebRequest]::Create("$account.xml")
$showAccountRequest.Method = "GET"
$showAccountRequest.CookieContainer = $cookieContainer
$showAccountRequest.Headers.Add("X_API_VERSION", "1.5");
[System.Net.WebResponse] $showAccountResponse = $showAccountRequest.GetResponse()
$showAccountResponseStream = $showAccountResponse.GetResponseStream()
$showAccountResponseStreamReader = New-Object System.IO.StreamReader -argumentList $showAccountResponseStream
[string]$showAccountResponseString = $showAccountResponseStreamReader.ReadToEnd()
write-host $showAccountResponseString

Sample Output

<?xml version="1.0" encoding="UTF-8"?>
    <link href="/api/accounts/711" rel="self"/>
    <link href="/api/users/2" rel="owner"/>
    <link href="/api/clusters/1" rel="cluster"/>
  <created_at>2007/01/09 06:20:08 +0000</created_at>
  <updated_at>2012/09/20 02:10:25 +0000</updated_at>
  <name>Greg Doe</name>




See the List and Show Assets examples (RightScale API 1.6 Guide:  Appendix A - APEye Tools > Google Chrome Postman Plugin)

You must to post a comment.
Last modified
12:42, 17 Dec 2013



This page has no classifications.



© 2006-2014 RightScale, Inc. All rights reserved.
RightScale is a registered trademark of RightScale, Inc. All other products and services may be trademarks or servicemarks of their respective owners.