Matteo Scandolo | 9ce1825 | 2017-06-22 10:48:25 -0700 | [diff] [blame] | 1 | tosca_definitions_version: tosca_simple_yaml_1_0 |
| 2 | |
| 3 | node_types: |
| 4 | {% for m in proto.messages %} |
| 5 | tosca.nodes.{{ m.name }}: |
| 6 | derived_from: tosca.nodes.Root |
Matteo Scandolo | 485b713 | 2017-06-30 11:46:47 -0700 | [diff] [blame] | 7 | 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 Scandolo | 9ce1825 | 2017-06-22 10:48:25 -0700 | [diff] [blame] | 11 | properties: |
| 12 | no-delete: |
| 13 | type: boolean |
| 14 | default: false |
| 15 | description: Do not allow Tosca to delete this object |
| 16 | no-create: |
| 17 | type: boolean |
| 18 | default: false |
| 19 | description: Do not allow Tosca to create this object |
| 20 | no-update: |
| 21 | type: boolean |
| 22 | default: false |
| 23 | description: Do not allow Tosca to update this object |
| 24 | replaces: |
| 25 | type: string |
| 26 | required: false |
| 27 | descrption: Replaces/renames this object |
Matteo Scandolo | 485b713 | 2017-06-30 11:46:47 -0700 | [diff] [blame] | 28 | {% for f in m.fields %} |
| 29 | {%- if not f.link -%} |
Matteo Scandolo | 9ce1825 | 2017-06-22 10:48:25 -0700 | [diff] [blame] | 30 | {{ f.name }}: |
Matteo Scandolo | 485b713 | 2017-06-30 11:46:47 -0700 | [diff] [blame] | 31 | type: {{ xproto_tosca_field_type(f.type) }} |
Matteo Scandolo | 9ce1825 | 2017-06-22 10:48:25 -0700 | [diff] [blame] | 32 | required: {{ xproto_tosca_required(f.options.null, f.options.blank, f.options.default) }} |
| 33 | description: {{ f.options.help_text }} |
Matteo Scandolo | 485b713 | 2017-06-30 11:46:47 -0700 | [diff] [blame] | 34 | {% endif %} |
Matteo Scandolo | 9ce1825 | 2017-06-22 10:48:25 -0700 | [diff] [blame] | 35 | {%- endfor %} |
Matteo Scandolo | 485b713 | 2017-06-30 11:46:47 -0700 | [diff] [blame] | 36 | |
| 37 | {% for l in m.links %} |
| 38 | {%- if l.link_type == "manytoone" -%} |
| 39 | tosca.relationships.BelongsToOne: |
| 40 | derived_from: tosca.relationships.Root |
| 41 | valid_target_types: [ tosca.capabilities.xos.{{ l.peer.name }} ] |
| 42 | {%- endif%} |
| 43 | {%- if l.link_type == "manytomany" -%} |
| 44 | tosca.relationships.BelongsToMany: |
| 45 | derived_from: tosca.relationships.Root |
| 46 | valid_target_types: [ tosca.capabilities.xos.{{ l.peer.name }} ] |
| 47 | {%- endif%} |
| 48 | {% endfor %} |
| 49 | |
| 50 | tosca.capabilities.xos.{{ m.name }}: |
| 51 | derived_from: tosca.capabilities.Root |
| 52 | description: {{ m.name }} |
Matteo Scandolo | 9ce1825 | 2017-06-22 10:48:25 -0700 | [diff] [blame] | 53 | {%- endfor %} |