← Prev in month
← Prev in thread
RE: Question on mandatory properties vs. node type substitution
Hi Gabor,
Apologies for the late reply.
I’m not sure if I understand your scenario correctly, but in general, property values in an abstract node will never be set by a substituting template. The must be set in the top-level template that includes the abstract node (e.g. using
get_input functions) and then these values will be propagated to inputs of the substituting template (assuming the property mappings are set up correctly).
Of course, since each property is automatically reflected in a corresponding attribute with the same name, the attribute values will get retrieved from the substituting template (assuming outputs of the substituting template are properly
mapped onto attributes of the abstract node).
Please let me know if I misunderstood your question.
Thanks,
Chris
From: <>
On Behalf Of Marton, Gabor (Nokia - HU/Budapest)
Sent: Tuesday, November 06, 2018 12:52 AM
To:
Subject: [tosca] Question on mandatory properties vs. node type substitution
Dear TOSCA Experts,
the following question is related to a problem under discussion in the ETSI NFV SOL001 group.
In the below second service template (example-top.tosca.yaml), can the value of property_2 come from a substitution template? In other words, is the second service template valid?
example-type.tosca.yaml:
tosca_definitions_version: tosca_simple_yaml_1_2
node_types:
node_type_1:
derived_from: tosca.nodes.Root
properties:
property_1:
type: string
constraints:
- valid_values: [ value_1, value_2 ]
property_2:
type: string
example-top.tosca.yaml:
tosca_definitions_version: tosca_simple_yaml_1_2
imports:
- example-type.tosca.yaml
topology_template:
node_templates:
node_template_1:
type: node_type_1
properties:
property_1:
value_1 # property value constraint for matching
outputs:
output_1:
value: { get_property: [ node_template_1,
property_2 ] } # value_3 from the sole matching substitution
example-subst-1.tosca.yaml:
tosca_definitions_version: tosca_simple_yaml_1_2
imports:
- example-type.tosca.yaml
topology_template:
substitution_mappings:
node_type: node_type_1
properties:
property_1:
value_1
property_2: value_3
example-subst-2.tosca.yaml:
tosca_definitions_version: tosca_simple_yaml_1_2
imports:
- example-type.tosca.yaml
topology_template:
substitution_mappings:
node_type: node_type_1
properties:
property_1:
value_2
property_2: value_4
In case the second service template is invalid, we need to use a work-around which is not perfect, e.g.:
example-type.tosca.yaml (modified):
tosca_definitions_version: tosca_simple_yaml_1_2
node_types:
node_type_1:
derived_from: tosca.nodes.Root
properties:
property_1:
type: string
constraints:
- valid_values: [ value_1, value_2 ]
property_2:
type: string
default: ''
Looking forward to receiving your response,
kind regards,
Gábor
← Prev in month
← Prev in thread