...
Keyname | Required | Type | Constraints | Description |
occurrences | no | range of integer | when not specified, defaults to [1,1] | The optional minimum and maximum number of instances that can be created from this node template. If not specified, only one single instance can be created. |
instance_count | no | integer | when not specified, defaults to the lower bound of the range specified by the ‘occurrences’ keyname | The requested number of runtime instance of the node template. |
Specifying Inputs
The service template in the previous section conveniently ignores the location property of the Site node. As shown earlier, the location property is expected to be provided as an input value. If Site node templates can be instantiated multiple times, then it follows that multiple input values are required to initialize the location property for each of the Site node instances.
To allow specific input values to be matched with specific node template instances, a new reserved keyword is introduced:
Keyword | Valid Contexts | Description |
INDEX | Node Template | A TOSCA orchestrator will interpret this keyword as the runtime index in the list of node instances created from a single Node Template. |
The following service template shows how the INDEX keyword is used to retrieve specific values from a list of input values in a service template:
tosca_definitions_version: tosca_simple_yaml_1_2
description: Template for deploying SD-WAN with a variable number of sites.
topology_template: inputs: numberOfSites: type: integer locations: type: list entry_schema: Location
node_templates: sdwan: type: VPN site: type: VPNSite occurrences: [1, UNBOUNDED] instance_count: { get_input: numberOfSites } properties: location: { get_input: [ locations, INDEX ] } requirements: - vpn: sdwan |
see Reference:
1, TOSCA Enhancements to Support Multiple Node Template Instances
...