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 > Server Array > List Server Arrays

List Server Arrays

List all Server Arrays owned by the current account.

icon_curl_v1.png    icon_rs_api_client_v1.png

Table of Contents


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

Example Call

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

Sample Output


  • Truncated XML output without headers included (to save space). 
  • Only one server array is listed in this example (also to save space).
<?xml version="1.0" encoding="UTF-8"?>
      <link rel="self" href="/api/server_arrays/12030"/>
      <link rel="deployment" href="/api/deployments/80051"/>
      <link rel="current_instances" href="/api/server_arrays/12030/current_instances"/>
      <link rel="next_instance" href="/api/clouds/232/instances/6CNISESVS3MUL"/>
      <link rel="alert_specs" href="/api/server_arrays/12030/alert_specs"/>
      <action rel="launch"/>
      <action rel="clone"/>
    <name>Windows IIS-RAX array</name>
        <voters_tag_predicate>windows firefox template array</voters_tag_predicate>


Show only Server Arrays in a Specific Deployment

The following supplemental example includes a "filter" so only servers arrays from the specified deployment are listed.

Important!  When using a filter (or view) the computation is done on the server side. This results in a lighter response (less content) returned to the client. The server essentially fetches all content and returns it to the client. 

#!/bin/sh -e
curl -i -H X_API_VERSION:1.5 -b mycookie -d filter[]="deployment_href==/api/deployments/$DEPLOYMENT" -X GET
Filter by the Server Array Name

The following example locates a specific Server Array by name.

#!/bin/sh -e
curl -i -H X_API_VERSION:1.5 -b mycookie -d filter[]="name==Base ServerTemplate for Linux" -X GET


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 using the Dashboard
acct = '1234'                         # Set the account ID
pass = 'SomePassword'                 # 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.server_arrays.index        # Output all Server Arrays owned by account '1234'



Sample Output

[#<RightApi::ResourceDetail resource_type="server_array", name="DomsRackspaceArrayTest">,
 #<RightApi::ResourceDetail resource_type="server_array", name="Rackspace_Array">,
 #<RightApi::ResourceDetail resource_type="server_array", name="Moon Unit Rho">,
 #<RightApi::ResourceDetail resource_type="server_array", name="TS RackArray">,
 #<RightApi::ResourceDetail resource_type="server_array", name=" Server Array">,
. . . truncated output . . .
 #<RightApi::ResourceDetail resource_type="server_array", name="dano cs 306 array">,
 #<RightApi::ResourceDetail resource_type="server_array", name="rax oc Chicago">,
 #<RightApi::ResourceDetail resource_type="server_array", name="Base ServerTemplate for Linux (RSB) (v12.11.3-LTS)">]



You must to post a comment.
Last modified
08:36, 14 Oct 2013


This page has no custom tags.


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.