get_input function in TOSCA 1.1 only includes one argument. Here we use the syntax in TOSCA 1.3 to support more complicated scenario. For example, it can support List type of input.
CCVPN use case team will extend the get_input function by using syntax in TOSCA 1.3 to realize multi-resource creation when instantiating service.
Related modules in ONAP to support this updates are SDC, SO, U-UI, SDN-C.
For more details of how CCVPN describes it in service template, please refer to Details of targeted service templateV2.pptx.
The reference document of the extended get_input function is from TOSCA-Simple-Profile-YAML-v1.3-wd01-rev19 (clean).docx
Here are what we obtained from this document:
The get_input function is used to retrieve the values of properties declared within the inputs section of a TOSCA Service Template.
1.Grammar
get_input: <input_property_name> |
or
get_input: [ <input_property_name>, <nested_input_property_name_or_index_1>, ..., <nested_input_property_name_or_index_n> ] |
2. Parameters
Parameter | Required | Type | Description |
<input_property_name> | yes | The name of the property as defined in the inputs section of the service template. | |
<nested_input_property_name_or_index_*> | no | Some TOSCA input properties are complex (i.e., composed as nested structures). These parameters are used to dereference into the names of these nested structures when needed.
Some properties represent list types. In these cases, an index may be provided to reference a specific entry in the list (as named in the previous parameter) to return. |
3.Examples
The following snippet shows an example of the simple get_input grammar:
inputs: cpus: type: integer
node_templates: my_server: type: tosca.nodes.Compute capabilities: host: properties: num_cpus: { get_input: cpus } |
The following template shows an example of the nested get_input grammar. The template expects two input values, each of which has a complex data type. The get_input function is used to retrieve individual fields from the complex input data.
data_types: NetworkInfo: derived_from: tosca.Data.Root properties: name: type: string gateway: type: string
RouterInfo: derived_from: tosca.Data.Root properties: ip: type: string external: type: string
topology_template: inputs: management_network: type: NetworkInfo router: type: RouterInfo
node_templates: Bono_Main: type: vRouter.Cisco directives: [ substitutable ] properties: mgmt_net_name: { get_input: [management_network, name]} mgmt_cp_v4_fixed_ip: { get_input: [router, ip]} mgmt_cp_gateway_ip: { get_input: [management_network, gateway]} mgmt_cp_external_ip: { get_input: [router, external]} requirements: - lan_port: node: host_with_net capability: virtualBind - mgmt_net: mgmt_net |