You can design your action scripts to be generic and reusable by defining and consuming name and value pairs called software properties and passing them as parameters to your action scripts. You can create software properties that expect string, array, content, boolean, or integer values. You can supply the value yourself, require someone else to supply the value, or retrieve the value from another blueprint component by creating a binding.

Property Options

You can compute the value of any string property by selecting the computed check box, and you can make any property encrypted, overridable, or required by selecting the appropriate check boxes when you configure Software properties. Combine these options with your values to achieve different purposes. For example, you want to require blueprint architects to supply a value for a password and encrypt that value when they use your software component in a blueprint. Create the password property, but leave the value text box blank. Select Overridable, Required, and Encrypted. If the password you are expecting belongs to your end user, the blueprint architect can select Show in Request to require your users to enter the password when they fill out the request form.

Option

Description

Encrypted

Mark properties as encrypted to mask the value and display as asterisks in vRealize Automation. If you change a property from encrypted to unencrypted, vRealize Automation resets the property value. For security, you must set a new value for the property.

Overridable

Allow architects to edit the value of this property when they are assembling an application blueprint. If you enter a value, it displays as a default.

Required

Require architects to provide a value for this property, or to accept the default value you supply.

Computed

Values for computed properties are assigned by the INSTALL, CONFIGURE, START, or UPDATE life cycle scripts. The assigned value is propagated to the subsequent available life cycle stages and to components that bind to these properties in a blueprint. If you select Computed for a property that is not a string property, the property type is changed to string.

If you select the computed property option, leave the value for your custom property blank. Design your scripts for the computed values.

Table 1. Scripting Examples for the Computed Property Option

Sample String Property

Script Sytax

Sample Usage

my_unique_id = ""

Bash - $my_unique_id

export my_unique_id="0123456789"

Windows CMD - %my_unique_id%

set my_unique_id=0123456789

Windows PowerShell - $my_unique_id

$my_unique_id = "0123456789"

String Property

String properties expect string values. You can supply the string yourself, require someone else to supply the value, or retrieve the value from another blueprint component by creating a binding to another string property. String values can contain any ASCII characters. To create a property binding, use the Properties tab on the design canvas to select the appropriate property for binding. The property value is then passed to the action scripts as raw string data. When you bind to a blueprint string property, make sure the blueprint component you bind to is not clusterable. If the component is clustered, the string value becomes an array and you do not retrieve the value you expect.

Sample String Property

Script Syntax

Sample Usage

admin_email = "admin@email987.com"

Bash - $admin_email

echo $admin_email

Windows CMD - %admin_email%

echo %admin_email%

Windows PowerShell - $admin_email

write-output  $admin_email

Array Property

Array properties expect an array of string, integer, decimal, or boolean values defined as [“value1”, “value2”, “value3”…]. You can supply the values yourself, require someone else to supply the values, or retrieve the values from another blueprint component by creating a property binding.

When you create a software property of type Array, where the data type is integer or decimal, you must use a semicolon as an array element separator, regardless of the locale. Do not use a comma (,) or a dot (.). For some locales, you can use a comma (,) as the decimal separator. For example:

  • A valid array for French resembles: [1,11;2,22;3,33]

  • A valid array for English resembles: [1.11,2.22,3.33]

When you pass large numbers into an array, do not use the grouping format. For example: do not use 4444 444.000 (French), 4.444.444,000 (Italian), or 4,444,444.000 (English), because data files that contain locale-specific formats might be misinterpreted when they are transferred to a machine that has a different locale. The grouping format is not allowed, because a number such as 4,444,444.000 would be considered as three separate numbers. Instead, just enter 4444444.000.

When you define values for an array property you must enclose the array in square brackets. For an array of strings, the value in the array elements can contain any ASCIl characters. To properly encode a backslash character in an Array property value, add an extra backslash, for example, ["c:\\test1\\test2"]. For a bound property, use the Properties tab in the design canvas to select the appropriate property for binding. If you bind to an array, you must design your software components so they don't expect a value array in any specific order.

For example, consider a load balancer virtual machine that is balancing the load for a cluster of application server virtual machines. In such a case, an array property is defined for the load balancer service and set to the array of IP addresses of the application server virtual machines.

These load balancer service configure scripts use the array property to configure the appropriate load balancing scheme on the Red Hat, Windows, and Ubuntu operating systems.

Sample Array Property

Script Syntax

Sample Usage

operating_systems = ["Red Hat","Windows","Ubuntu"]

Bash - ${operating_systems[@]}

for the entire array of strings

${operating_systems[N]}

for the individual array element

for (( i = 0 ; i < ${#operating_systems[@]}; i++ )); do
   echo ${operating_systems[$i]}
done

Windows CMD - %operating_systems_N%

where N represents the position of the element in the array

for /F "delims== tokens=2" %%A in ('set operating_systems_') do (
    echo %%A
)

Windows PowerShell - $operating_systems

for the entire array of strings

$operating_systems[N]

for the individual array element

foreach ($os in $operating_systems){
   write-output  $os
}

Content Property

The content property value is a URL to a file to download content. Software agent downloads the content from the URL to the virtual machine and passes the location of the local file in the virtual machine to the script.

Content properties must be defined as a valid URL with the HTTP or HTTPS protocol. For example, the JBOSS Application Server Software component in the Dukes Bank sample application specifies a content property cheetah_tgz_url. The artifacts are hosted in the Software appliance and the URL points to that location in the appliance. The Software agent downloads the artifacts from the specified location into the deployed virtual machine.

For information about software.http.proxy settings that you can use with content properties, see Custom Properties S Table.

Sample String Property

Script Syntax

Sample Usage

cheetah_tgz_url = "http://app_content_server_ip:port/artifacts/software/jboss/cheetah-2.4.4.tar.gz"

Bash - $cheetah_tgz_url

tar -zxvf $cheetah_tgz_url

Windows CMD - %cheetah_tgz_url%

start /wait c:\unzip.exe
%cheetah_tgz_url%

Windows PowerShell - $cheetah_tgz_url

 & c:\unzip.exe
$cheetah_tgz_url

Boolean Property

Use the boolean property type to provide True and False choices in the Value drop-down menu.

Integer Property

Use the integer property type for zeros, and positive or negative integers.

Decimal Property

Use the decimal property type for values representing non-repeating decimal fractions.