Templates allow you to define parameters which take on a value. That value is
then substituted wherever the parameter is referenced. References can be
defined in any text field in the objects list field.
Each parameter describes a variable and the variable value which can be
referenced in any text field in the objects
list field. During
processing, the value can be set explicitly or it can be generated by
OpenShift.
An explicit value can be set as the parameter default using the value
field:
parameters:
- name: USERNAME
description: "The user name for Joe"
value: joe
The generate
field can be set to 'expression' to specify generated
values. The from
field should specify the pattern for generating
the value using a pseudo regular expression syntax:
parameters:
- name: PASSWORD
description: "The random user password"
generate: expression
from: "[a-zA-Z0-9]{12}"
In the example above, processing will generate a random password 12
characters long consisting of all upper and lowercase alphabet letters
and numbers.
The syntax available is not a full regular expression syntax. However, you can
use \w
, \d
, and \a
modifiers:
-
[\w]{10}
produces 10 alphabet characters, numbers, and underscores. This
follows the PCRE standard and is equal to [a-zA-Z0-9_]{10}
.
-
[\d]{10}
produces 10 numbers. This is equal to [0-9]{10}
.
-
[\a]{10}
produces 10 alphabetical characters. This is equal to
[a-zA-Z]{10}
.