Manually using shared parameters in service interpolations
Shared parameters can be manually linked and used in service interpolations.
For linking shared parameters from the user interface, see Link parameter section in Managing an existing activity parameter and Read-write End-User Permissions in Parameters tab of Helm charts / Templates activity section.
The shared parameter interpolation syntax that you can use to manually link:
${datatypes.<DATATYPE_ID>.<attribute name>}
Where,
DATATYPE_IDis an identifier of Data Type to Data Object mapping that is defined in the service file.attribute nameis the attribute name from the Data Type definition.
For example:
"actions": [
{
"type": "provision",
"name": "Provision",
"description": "Default action for deployment of service",
"input_parameters": [
{
"name": "bastionhost1",
"label": "Bastion Host Configuration",
"customtype": "sharedparameter",
"type": "sharedparameter",
"immutable": false,
"hidden": false,
"required": true,
"secured": false,
"description": "Bastion Host Configuration",
"default": "DefaultNoBastionHostRequired",
"datatype": "bastionhost"
}
For more information on the attributes and a detailed example, see Data Types in Service Composition Language.
In this example, the DATATYPE_ID is "bastionhost1" and it is mapped to bastionhost Data Type.
If there are multiple DataObjects created for a DataType, then a Data Object must be identified as a default object. In this example, the default DataObject is DefaultNoBastionHostRequired. In the following interpolation syntax, you
override the default Data Object and make use of bastion_host Data Object:
${datatypes.bastionhost1.bastion_host}
The element datatypes is included in SCL V3 to support Shared Parameters in service definition, that is, DataObject to Datatype mapping. For more information, see datatypes section of Editing a service file topic.
Note: Only the Data Types that are created as string are supported in service context.