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 > Servers > Terminate Server

Terminate Server

Terminate the running instance of a server.

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 POST$SERVER/terminate

Sample Output

Note:  There is no XML/JSON content from a Terminate Server (or instance).

HTTP/1.1 204 No Content
Server: nginx/1.0.15
Date: Fri, 12 Oct 2012 16:18:49 GMT
Connection: keep-alive
Status: 204 No Content
X-Runtime: 463
X-Request-Uuid: cbb45a90192a4e75b8580e8f0ff5674f
Set-Cookie: _session_id=92ede080c999a3e5734035f582d11b0e; path=/; Secure; HttpOnly
Cache-Control: no-cache


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.
server_id = '626129001'
@client.servers(:id => server_id).show.terminate

Sample Output

The specified server is terminated, but no output.  (Note: Even if the example script above used "puts" or "pp" to display output, none is returned.)

You must to post a comment.
Last modified
14:20, 30 May 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.