OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

tosca message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: 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

 



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]