Application template functions

IBM® Spectrum Conductor uses an application template that can include functions.

The following is a list of functions that you can add to an application template.
Table 1. Application template functions

Function

Description

get_attr: Mapping attributes of resources that are defined in the application template to the attribute. For example,
Application instance attributes: name, uuid, consumerpath
  • get_attr: [_appinstance_, name]
  • get_attr: [_appinstance_, uuid]
  • get_attr: [_appinstance_, consumerpath]
Service attributes: hostname, hostnames, userinfo
  • get_attr: [service_name, hostname]
  • get_attr: [service_name, hostnames]
  • get_attr: [service_name, userinfo, seq_number]
Note: service_name and seq_number represent the service name and service instance sequence number. The name and uuid must be preceded by the keyword _appinstance_.
get_param Mapping parameters that are defined in the application template to the attribute. For example,
  • cpu_share
  • port_number
  • user_name
get_optional_param
Restriction: This get_optional_param function is supported only for IBM Spectrum Conductor applications, and not for application instances, also referred to as ASC application instances.
The get_optional_param is a super function of the get_param, where both functions map parameters that are defined in the application template to the attribute. For example,
  • cpu_share
  • port_number
  • user_name
The distinction is the get_param fails if the parameter is not defined, whereas the get_optional_param defaults the parameter to null if the value of the parameter does not exist with no errors.

This function is useful for getting the value of a parameter that is specified with the required attribute set to false (required: false). For more information about configuring the required attribute, see Application template parameters topic.

get_random Generates a random ID for an attribute defined in the application template. For example, uuid.
get_resource Mapping resources that are defined in the application template to the attribute. For example:
  • serviceB_container
  • package_1
  • serviceA_activity
list_join Takes a delimiter that is added between each value, which can be an empty string , and then a list of values to join. For example,

value: { list_join: [ , [ http://, { get_attr: [serviceA, hostname] }, :, { get_param: port_number } ] ] }