blob: 313874bf5cac60ea9d4270c97a64554eb11c3e70 [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:
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 Scandolo485b7132017-06-30 11:46:47 -070028 {% for f in m.fields %}
29 {%- if not f.link -%}
Matteo Scandolo9ce18252017-06-22 10:48:25 -070030 {{ f.name }}:
Matteo Scandolo485b7132017-06-30 11:46:47 -070031 type: {{ xproto_tosca_field_type(f.type) }}
Matteo Scandolo9ce18252017-06-22 10:48:25 -070032 required: {{ xproto_tosca_required(f.options.null, f.options.blank, f.options.default) }}
33 description: {{ f.options.help_text }}
Matteo Scandolo485b7132017-06-30 11:46:47 -070034 {% endif %}
Matteo Scandolo9ce18252017-06-22 10:48:25 -070035 {%- endfor %}
Matteo Scandolo485b7132017-06-30 11:46:47 -070036
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 Scandolo9ce18252017-06-22 10:48:25 -070053{%- endfor %}