Referencing values in Scripts

All Variables have the same basic attributes regardless of their type. The Values that are mapped onto the Variables in the Plan are different - they have a number of different attributes depending on the type of value.

Using Variables in Procedures

Variables are used in Procedures to refer to values. These values are held in Values which are mapped onto the relevant Variables in a Plan prior to the Procedure being executed.

Procedures are composed of steps, and each step has a unique name and a number of other attributes, including a script section, where the actual commands for executing the step are written. In these commands, curly braces { } are used to delimit values which are referenced by variables.

In order to be used in a script the Variable names are stripped of any separating spaces between words and converted to camelcase - with only the first letter of the second, and any subsequent words, capitalised.

So a Variable called - THIS IS my name would be converted to thisIsMyName

Values are referenced in scripts as {placeHolderName.placeValueAttribute}

So for a Variable with name THIS IS my name of type Server We could refer to the IP address in a script as :code:`{thisIsMyName.ip}

The expressions contained in the curly braces are evaluated prior to job, and the curly brace expressions are replaced by actual values before the script is run. In the example above {thisIsMyName.ip} would be substituted with the value of the IP attribute of the PlaceValue that was assigned to the Variable THIS IS my name in the Plan.

This substitution of values is performed by Attune, so using the curly Brace {} notation to reference attribute values works with all scripts regardless of the type of script - it will work with Bash, Windows Powershell, Python, etc.

Referencing value attributes in Steps

OS Credential

Attributes of Type OS credential can be referenced as follows:

Variable Value Script Reference
Name name {myPlaceHolder.name}
User user {myPlaceHolder.user}
Password password {myPlaceHolder.password}
Comment comment {myPlaceHolder.comment}

SQL Credential

Attributes of Type SQL credential can be referenced as follows :

Variable Value Script Reference
Name name {myPlaceHolder.name}
User user {myPlaceHolder.user}
SID sid {myPlaceHolder.sid}
Password password {myPlaceHolder.password}
As Sysdba asSysDba {myPlaceHolder.asSysDba}
Comment comment {myPlaceHolder.comment}

Server

Attributes of Server are referenced as follows:

Variable Value Script Reference
Name name {myPlaceHolder.name}
IP Address ip {myPlaceHolder.ip}
Hostname hostname {myPlaceHolder.hostname}
Domain Name domain {myPlaceHolder.domain}
Comment comment {myPlaceHolder.comment}

Server Group

Server Group is an comma separated list of Server values (CSV), Attributes of Server Group are referenced as follows:

Variable Value Script Reference
Name name {myPlaceHolder.name}
Server serverNames {myPlaceHolder.serverNames} as CSV
Server serverIps {myPlaceHolder.serverIps} as CSV
Server serverHostnames {myPlaceHolder.serverHostnames} as CSV
Server serverTypes

{myPlaceHolder.serverTypes} as CSV

The types are:
  • 1 = Linux
  • 2 = Windows
Server serverDomains {myPlaceHolder.serverDomains} as CSV
Server serverFqns {myPlaceHolder.serverFqns} as CSV
Comment comment {myPlaceHolder.comment}

IPv4 Subnet

Attributes of the “IPv4 Subnet” value are referenced as follows:

Variable Value Script Reference
Name name {myPlaceHolder.name}
Subnet subnet {myPlaceHolder.subnet}
Netmask netmask {myPlaceHolder.netmask}
Gateway IP gateway {myPlaceHolder.gateway}
DNS IP 1 dns1 {myPlaceHolder.dns1}
DNS IP 2 dns2 {myPlaceHolder.dns2}
Comment comment {myPlaceHolder.comment}

Text

Attributes of Type Text can be referenced as follows:

Variable Value Script Reference
Name name {myPlaceHolder.name}
Value value {myPlaceHolder.value}
Comment comment {myPlaceHolder.comment}