blob: 2cdec9c45fa9be6eb4d102ac2782f13bf88b81f0 [file] [log] [blame]
Matteo Scandolo9ce18252017-06-22 10:48:25 -07001tosca_definitions_version: tosca_simple_yaml_1_0
2
3node_types:
4{% for m in proto.messages %}
5 tosca.nodes.{{ m.name }}:
6 derived_from: tosca.nodes.Root
Matteo Scandolo485b7132017-06-30 11:46:47 -07007 description: {% if m.options.tosca_description -%}{{ m.options.tosca_description}}{% else%}"An XOS {{ m.name }}"{%- endif %}
8 capabilities:
9 {{ m.name|lower }}:
10 type: tosca.capabilities.xos.{{ m.name }}
Matteo Scandolo9ce18252017-06-22 10:48:25 -070011 properties:
Matteo Scandolod12be212017-07-07 10:44:34 -070012 must-exist:
Matteo Scandolo9ce18252017-06-22 10:48:25 -070013 type: boolean
14 default: false
Matteo Scandolod12be212017-07-07 10:44:34 -070015 description: Allow to reference existing models in TOSCA recipes
Matteo Scandolo485b7132017-06-30 11:46:47 -070016 {% for f in m.fields %}
17 {%- if not f.link -%}
Matteo Scandolo9ce18252017-06-22 10:48:25 -070018 {{ f.name }}:
Matteo Scandolo485b7132017-06-30 11:46:47 -070019 type: {{ xproto_tosca_field_type(f.type) }}
Matteo Scandolo9ce18252017-06-22 10:48:25 -070020 required: {{ xproto_tosca_required(f.options.null, f.options.blank, f.options.default) }}
21 description: {{ f.options.help_text }}
Matteo Scandolo485b7132017-06-30 11:46:47 -070022 {% endif %}
Matteo Scandolo9ce18252017-06-22 10:48:25 -070023 {%- endfor %}
Matteo Scandolo485b7132017-06-30 11:46:47 -070024
25 {% for l in m.links %}
26 {%- if l.link_type == "manytoone" -%}
27 tosca.relationships.BelongsToOne:
28 derived_from: tosca.relationships.Root
29 valid_target_types: [ tosca.capabilities.xos.{{ l.peer.name }} ]
30 {%- endif%}
31 {%- if l.link_type == "manytomany" -%}
32 tosca.relationships.BelongsToMany:
33 derived_from: tosca.relationships.Root
34 valid_target_types: [ tosca.capabilities.xos.{{ l.peer.name }} ]
35 {%- endif%}
36 {% endfor %}
37
38 tosca.capabilities.xos.{{ m.name }}:
39 derived_from: tosca.capabilities.Root
40 description: {{ m.name }}
Matteo Scandolo9ce18252017-06-22 10:48:25 -070041{%- endfor %}