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 > Inputs > Modify Next Instance Input

Modify Next Instance Input

Change a server level input (for the "next" instance) value.  In our example, the SYS_FIREWALL category input named "sys_firewall/rule/port" gets changed to 8080.

Note:  HTTP PUT method is used.  If a specified input does not exist, it gets created.  If it does exist, its value is set to the one provided.

icon_curl_v1.png     icon_powershell_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
CLOUD="2112"                               # Set the Cloud ID
INSTANCE="B469CS55K5VRQ"                   # Set the NEXT Instance ID
PORT="8080"                                # New port number/value for the text input
curl -i -H X-API-Version:1.5 -b mycookie \
-d inputs[][name]="sys_firewall/rule/port" \      # Input name to modify
-d inputs[][value]="text:$PORT" \                 # text value to set the input to (8080)
-X PUT$CLOUD/instances/$INSTANCE/inputs/multi_update

Sample Output

HTTP/1.1 204 No Content
Server: nginx/1.0.15
Date: Wed, 07 Nov 2012 01:34:17 GMT
Connection: keep-alive
Status: 204 No Content
X-Runtime: 822
X-Request-Uuid: d09e5755c5cd4ad1ae7e2ce3f1da7cfb
Set-Cookie: rs_gbl=eNo1kE1vgjAAQP9LzzShFWgh2UGHGRoYgqBzl6W0gDI-EiwNaPzvg8Pu773DewIGHNBMQAPiDpwnGO55DxxCKXlpQHLgoJWJsYl1k2jgJmY4wzYqOLMgplYGEcoxpFTkkNi2wRgmvGBizsn837Xx4s51oFbhNnokm9KvizaX9bUJ3c_zvt03GGW6GpU4NlFi0RjXSfBRu2uXw-rE1l566qdDpFOz3Zx95HVVsirDUg7r6wFug0tpwazUebElVP0ImapR_N6_-8Ro9o-q9N2vPso9y5WFruiVHGJiw53RMjSFXR_FtpvuvLC6VeNjuij-PhjxJnhbjozLEcZ5N7RynoJerz9L-1y7;; path=/; HttpOnly
Cache-Control: no-cache


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

Example Call

$cloudID = "2112"                      # Set the ID of the deployment to be modified
$instanceID = "B469CS55K5VRQ"          # Set the ID of the next instance whose next inputs are being
$port = "8080"                         # Set the new port value to 8080
$stringToPut = "inputs[][name]=sys_firewall/rule/port&"
$stringToPut += "inputs[][value]=text:$port"
$inputWebRequest = [System.Net.WebRequest]::Create("$cloudID/instances/$instanceID/inputs/multi_update")
$inputWebRequest.Method = "PUT"
$inputWebRequest.CookieContainer = $cookieContainer
$inputWebRequest.ServicePoint.Expect100Continue = $false
$inputRequestStream = $inputWebRequest.GetRequestStream()
[System.Net.WebResponse]$inputResponse = $inputWebRequest.GetResponse()
$inputResponseStream = $inputResponse.GetResponseStream()
$inputResponseStreamReader = New-Object System.IO.StreamReader -ArgumentList $inputResponseStream
#this is the cookie container for subsequent requests: $cookieContainer


Sample Output

See http/curl output.

See also

You must to post a comment.
Last modified
23:18, 16 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.