My favorites | Sign in
Logo
                
Search
for
Updated Aug 07, 2009 by dicsydel
RoleOptions  
Using role parameters

This is deprecated feature! Please use "Query-env" interface instead.

What is this all about?

When you create your custom role on Scalr, you can specify what "options" instances of this role will need to function properly. For example, Tomcat-based application server may need admin password, memcached instance may need a list of IP adresses that will be allowed to connect from outside.

Scalr provides a straightforward yet efficient way for this:

  1. You specify what parameters you will need on instances of your role. Go to Roles -> View all, click on Options -> Edit and then cick on Options tab.
  2. When you build a farm, you enter values for these options on Options tab.
  3. You retreive these values on any istance of a role using simple HTTP call to Scalr.

How to retreive an option value from my application or a script?

By calling https://scalr.net/config_opts.php If you are running your own Scalr, the URL will be different.

Options are named in the following manner: 'options.%option_name%'. Non-alphanumeric symbols replaced by an underscore, all letters are lowercased.

Say, you created option 'Admin Password', then you can retreive it at

https://scalr.net/config_opts.php?option=options.admin_password&FarmID=115&Hash=0123456789abcde&InstanceID=i-123456

In bash script you can retreive parameter using the below code:

. /usr/local/aws/lib/lib.sh
ec2_get_option_val options.admin_password

Sign in to add a comment
Hosted by Google Code