1 _status_values: &status_values
8 #I do not know that the lists and maps qualify as 'primitive' ..
9 _primitive_types: &primitive_types
10 enum: [string,integer,float,boolean,timestamp,list,map,version,range,scalar-unit.size,scalar_unit.frequency,scalar_unit.time]
12 #needs custom validation as we have to make sure there are 2 elements and allow for the
13 #UNBOUNDED keyword as second element
14 _range_definition: &range_definition
16 name: range_definition
21 #this is where the need of verifying the size of a collection (sequence/map) came from
22 #this is specified as a sequence where each entry is a map with one entry??
23 _constraints_sequence: &constraints_sequence
24 name: constraints_sequence
32 desc: "Constrains a property or parameter to a value equal to the value declared."
36 desc: "Constrains a property or parameter to a value greater than the value declared"
40 desc: "Constrains a property or parameter to a value greater than or equal to the value declared."
44 desc: "Constrains a property or parameter to a value less than the value declared"
48 desc: "Constrains a property or parameter to a value less than or equal to the value declared."
52 desc: "Constrains a property or parameter to a value in range of (inclusive) the two values declared.
60 desc: "Constrains a property or parameter to a value that is in the list of declared values"
66 desc: "Constrains the property or parameter to a value of a given length."
70 desc: "Constrains the property or parameter to a value to a minimum length"
74 desc: "Constrains the property or parameter to a value to a maximum length"
78 desc: "Constrains the property or parameter to a value that is allowed by the provided regular expression."
82 # section A.5.3 property_filter_definition
83 # it is a constraints sequence that gets attached to a property ..
84 _property_filter_definition: &property_filter_definition
85 name: property_filter_definition
91 #section A.5.4 node_filter_definition
92 _node_filter_definition: &node_filter_definition
94 name: node_filter_definition
97 desc: "property names to constraints to be applied to those properties"
101 - *property_filter_definition
105 # *constraints_sequence
112 name: node_filter_capabilities_sequence
113 desc: "the key is a capability name or type"
116 name: node_filter_capabilities_entry
120 desc: "the capability properties and their constraints"
121 name: node_filter_capabilities_properties
125 name: node_filter_capabilities_property
127 =: *constraints_sequence
129 #used in property and attribute definitions
130 _entry_schema_definition: &entry_schema_definition
131 desc: "The optional key that is used to declare the name of the Datatype definition for entries of set types such as the TOSCA list or map"
132 name: entry_schema_definition
138 desc: "collection element type"
145 *constraints_sequence
148 _artifact_definition: &artifact_definition
150 name: artifact_definition
151 short: implementation # assumes type can be inferred ..
154 desc: "The required artifact type for the artifact definition"
158 desc: "The optional description for the artifact definition"
162 desc: "The optional URI string (relative or absolute) which can be used to locate the artifacts file.
167 desc: "The optional name of the repository definition which contains the location of the external repository that contains the artifact"
171 desc: "The file path the associated file would be deployed into within the target nodes container."
176 _repository_definition: &repository_definition
178 name: repository_definition
182 desc: "The optional description for the repository."
186 desc: "The required URL or network address used to access the repository"
190 desc: "The optional Credential used to authorize access to the repository"
195 _import_definition: &import_definition
197 name: import_definition
205 desc: "symbolic name of the repository definition where the imported file can be found"
209 desc: "namespace URI to that will be applied to type definitions found within the imported file"
213 desc: "optional namespace prefix (alias) that will be used to indicate the namespace_uri when forming a qualified name (i.e., qname) when referencing type definitions from the imported"
218 _property_definition: &property_definition
220 name: property_definition
225 #not as easy, it can be an user defined data type
226 # <<: *primitive_types
231 desc: "The optional list of sequenced constraint clauses for the Data Type."
233 <<: *constraints_sequence
245 <<: *entry_schema_definition
246 # desc: "used to declare the name of the Datatype definition for entries of set types such as the TOSCA list or map."
251 #_property_assignment_definition: &property_assignment_definition
254 _attribute_definition: &attribute_definition
256 name: attribute_definition
261 # <<: *primitive_types
269 desc: "The optional status of the attribute relative to the specification or implementation"
274 <<: *entry_schema_definition
277 #here again, we must support the short form which is the most common
278 _attribute_assignment_definition: &attribute_assignment_definition
280 name: attribute_assignment_definition
283 desc: "The optional description of the attribute."
287 #actually 'value | value_expression'
288 desc: "represent the type-compatible value to assign to the named attribute. Attribute values may be provided as the result from the evaluation of an expression or a function"
293 # see spec section A.5.11
295 # see spec section A.5.11.1: variant to be used in node or relationship type definitions
296 _type_operation_definition: &type_operation_definition
298 name: type_operation_definition
299 short: implementation
302 desc: "The optional description string for the associated named operation."
306 desc: "The optional implementation artifact name (e.g., a script file name within a TOSCA CSAR file)"
315 desc: "a property value or an expression providing a input value"
316 name: property_assignment
320 _template_operation_definition: &template_operation_definition
322 name: template_operation_definition
323 short: implementation
326 desc: "The optional description string for the associated named operation."
330 desc: "The optional implementation artifact name (e.g., a script file name within a TOSCA CSAR file)"
331 name: template_operation_implementation_definition
337 desc: "The optional implementation artifact name (e.g., the primary script file name within a TOSCA CSAR file). "
341 desc: "The optional list of one or more dependent or secondary implementation artifact name which are referenced by the primary implementation artifact (e.g., a library the script installs or a secondary script)"
352 desc: "a property value or an expression providing a input value"
353 name: property_assignment
357 # see section A.5.12, specifically A.5.12.2.1 : definition to be used in node or relationship type definition
358 _type_interface_definition: &type_interface_definition
360 name: type_interface_definition
363 desc: "represents the required name of the Interface Type for the interface definition
368 desc: "The optional list of input property definitions available to all defined operations"
374 *type_operation_definition
376 # see section A.5.12.2.2, extended notation to be used in node or relationship template definitions
377 _template_interface_definition: &template_interface_definition
379 name: template_interface_definition
382 desc: "The optional list of input property definitions available to all defined operations"
386 desc: "a property value or an expression providing a property value"
387 name: property_assignment
390 *template_operation_definition
393 # A.6 section: type specific definitions
396 _capability_definition: &capability_definition
398 name: capability_definition
402 desc: "The required name of the Capability Type the capability definition is based upon"
406 desc: "The optional description of the Capability definition"
417 desc: "An optional list of property definitions for the Capability definition"
422 *attribute_definition
430 desc: "The optional minimum and maximum occurrences for the capability."
432 <<: *range_definition
436 _requirement_definition: &requirement_definition
438 name: requirement_definition
439 short: capability #as per A.6.2.2.1
442 desc: "The required reserved keyname used that can be used to provide the name of a valid Capability Type that can fulfil the requirement"
446 desc: "The optional reserved keyname used to provide the name of a valid Node Type that contains the capability definition that can be used to fulfil the requirement. "
450 # and from section A.6.2.1, this one is an oddball
451 desc: "The optional reserved keyname used to provide the name of a valid Relationship Type to construct when fulfilling the requirement."
453 name: requirement_relationship_definition
458 desc: "The optional reserved keyname used to provide the name of the Relationship Type for the requirement definitions relationship keyname.
463 #not clear which interface definition is to be used here
464 desc: "allows augmentation (additional properties and operations) of the interfaces defined by the relationship type indicated above"
469 *type_interface_definition
471 desc: "The optional minimum and maximum occurrences for the requirement."
473 <<: *range_definition
476 _artifact_type_definition: &artifact_type_definition
478 name: artifact_type_definition
481 desc: "An optional parent Artifact Type name the Artifact Type derives from"
485 desc: "An optional description for the Artifact Type."
489 desc: "The required mime type property for the Artifact Type."
493 desc: "The required file extension property for the Artifact Type"
499 desc: "An optional list of property definitions for the Artifact Type"
506 #see spec section #A.6.4
507 _interface_type_definition: &interface_type_definition
509 name: interface_type_definition
512 desc: "The optional list of input property definitions available to all defined operations"
517 desc: "property_name to property_value(_expression) mapping"
519 *type_operation_definition
522 _data_type_definition: &data_type_definition
524 name: data_type_definition
527 desc: "The optional key used when a datatype is derived from an existing TOSCA Data Type.
532 desc: "The optional description for the Data Type.
537 desc: "The optional list of sequenced constraint clauses for the Data Type."
538 <<: *constraints_sequence
540 desc: "The optional list property definitions that comprise the schema for a complex Data Type in TOSCA"
547 _capability_type_definition: &capability_type_definition
549 name: capability_type_definition
552 desc: "An optional parent capability type name this new Capability Type derives from."
556 desc: "An optional description for the Capability Type"
560 desc: "An optional list of property definitions for the Capability Type."
567 desc: "An optional list of attribute definitions for the Capability Type"
572 *attribute_definition
574 desc: "An optional list of one or more valid names of Node Types that are supported as valid sources of any relationship established to the declared Capability Type"
580 # section A.6.7 requirement definition: TOSCA YAML profile relies on capability types to
581 # define requirements
584 _relationship_type_definition: &relationship_type_definition
586 name: relationship_type_definition
589 desc: "An optional parent Relationship Type name the Relationship Type derives from"
593 desc: "An optional description for the Relationship Type."
597 desc: "An optional list of property definitions for the Relationship Type"
604 desc: "An optional list of attribute definitions for the Relationship Type"
609 *attribute_definition
611 desc: "An optional list of interface definitions interfaces supported by the Relationship Type"
616 *type_interface_definition
618 desc: "An optional list of one or more names of Capability Types that are valid targets for this relationship. "
625 _group_type_definition: &group_type_definition
627 name: group_type_definition
630 desc: "An optional parent Group Type name this new Group Type derives from"
634 desc: "An optional version for the Group Type definition"
638 desc: "An optional description for the Group Type"
642 desc: "An optional list of property definitions for the Group Type."
649 desc: "An optional list of one or more names of Node Types that are valid
650 (allowed) as members of the Group Type."
656 desc: "An optional list of interface definitions supported by the Group Type"
661 *type_interface_definition
664 _policy_type_definition: &policy_type_definition
666 name: policy_type_definition
669 desc: "An optional parent Policy Type name this new Policy Type derives from"
673 desc: "An optional version for the Policy Type definition"
677 desc: "An optional description for the Policy Type"
681 desc: "An optional list of property definitions for the Policy Type."
688 desc: "An optional list of valid Node Types or Group Types the Policy Type
696 _node_type_definition: &node_type_definition
698 name: node_type_definition
701 desc: "An optional parent Node Type name this new Node Type derives from"
705 desc: "An optional description for the Node Type"
709 desc: "An optional list of property definitions for the Node Type."
716 desc: "An optional list of attribute definitions for the Node Type.
722 *attribute_definition
724 desc: "An optional sequenced list of requirement definitions for the Node Type.
732 *requirement_definition
734 desc: "An optional list of capability definitions for the Node Type"
739 *capability_definition
746 *type_interface_definition
748 desc: "An optional list of named artifact definitions for the Node Type"
755 # A.7 Template specific definitions
758 _capability_assignment_definition: &capability_assignment_definition
760 name: capability_assignment_definition
763 # list of property assignments
764 desc: "An optional list of property definitions for the Capability definition"
769 desc: "a property value or an expression providing a property value"
770 name: property_assignment
773 # list of attribute assignments
774 desc: "An optional list of attribute definitions for the Capability definition"
780 name: attribute_assignment
784 _requirement_assignment_definition: &requirement_assignment_definition
786 name: requirement_assignment_definition
790 desc: " used to provide the name of either a: Capability definition within a target node template that can fulfill the requirement or Capability Type that the provider will use to select a type-compatible target node template to fulfill the requirement at runtime."
794 #why is this a reference to a node type and not to a node template??
795 desc: "used to identify the target node of a relationship: Node Template name that can fulfil the target node requirement or Node Type name that the provider will use to select a type-compatible node template to fulfil the requirement at runtime"
801 #fins a better name name: relationship_definition
806 desc: "The optional reserved keyname used to provide the name of the Relationship Type for the requirement assignments relationship keyname"
815 desc: "a property value or an expression providing a property value"
816 name: property_assignment
819 desc: "from A.5.12.2.2, right?"
824 *template_interface_definition
826 desc: "The optional filter definition that TOSCA orchestrators or providers would use to select a type-compatible target node that can fulfill the associated abstract requirement at runtime."
828 <<: *node_filter_definition
831 _node_template_definition: &node_template_definition
833 name: node_template_definition
836 desc: "The required name of the Node Type the Node Template is based upon"
840 desc: "An optional description for the Node Template"
844 desc: "An optional list of directive values to provide processing instructions to orchestrators and tooling."
850 #custom check needs to be added: the value or expression providing the property value
851 #needs to be compatible with the property definition
852 desc: "An optional list of property value assignments for the Node Template."
858 name: property_assignment
859 desc: "a property value or an expression providing a property value"
861 desc: "An optional list of attribute value assignments for the Node Template"
866 *attribute_assignment_definition
868 desc: "An optional sequenced list of requirement assignments for the Node Template."
875 *requirement_assignment_definition
877 desc: "An optional list of capability assignments for the Node Template."
882 *capability_assignment_definition
884 desc: "An optional list of named interface definitions for the Node Template"
889 *template_interface_definition
891 desc: "An optional list of named artifact definitions for the Node Template.
899 desc: "The optional filter definition that TOSCA orchestrators would use to select the correct target node. This keyname is only valid if the directive has the value of 'selectable' set."
901 <<: *node_filter_definition
903 desc: "The optional (symbolic) name of another node template to copy into (all keynames and values) and use as a basis for this node template."
908 _relationship_template_definition: &relationship_template_definition
910 name: relationship_template_definition
913 desc: "The required name of the Relationship Type the Relationship Template is based upon"
917 desc: "The optional name of a different Relationship Template definition whose values are (effectively) copied into the definition for this Relationship Template (prior to any other overrides)."
921 desc: "An optional description for the Relationship Template"
925 desc: "An optional list of property assignments for the Relationship Template."
927 name: properties_assignment_validation
933 desc: "an expression providing a property value"
935 desc: "An optional list of attribute value assignments for the Relationship Template"
937 name: attributes_assignment_validation
942 desc: "an expression providing an attribute value"
944 desc: "An optional list of named interface definitions for the Relationship Template ('augmentation' is allowed here)"
949 *template_interface_definition
951 desc: "The optional (symbolic) name of another relationship template to copy into (all keynames and values) and use as a basis for this relationship template."
957 _group_definition: &group_definition
959 name: group_definition
962 desc: "The required name of the group type the group definition is based upon"
966 desc: "The optional description for the group definition"
969 desc: " represents the optional list of property assignments for the group definition that provide values for properties defined in its declared Group Type"
975 name: property_assignment
977 desc: "contains the required list of one or more node template names (within the same topology template) that are members of this logical group"
983 desc: "represents the optional list of interface definitions for the group definition that augment those provided by its declared Group Type"
988 *template_interface_definition
991 _policy_template_definition: &policy_template_definition
993 name: policy_definition
996 desc: "The required name of the policy type the policy definition is based upon"
1000 desc: "The optional description for the policy definition"
1003 desc: "represents the optional list of property assignments for the policy definition that provide values for properties defined in its declared Policy Type"
1009 name: property_assignment
1011 desc: "represents the optional list of names of node templates or groups that the policy is to applied to"
1017 # see section 3.8 Topology Template definition: defines the topology template of a cloud application.
1018 # described as a a reusable grammar as it can be a part of a service template definition
1019 _topology_template_definition: &topology_template_definition
1021 name: topology_template_definition
1024 desc: "a description of the topology template"
1028 desc: "definition of input parameters for the topology template"
1034 *property_definition
1036 desc: "definition of the node templates of the topology"
1037 name: node_templates
1042 *node_template_definition
1043 relationship_templates:
1044 desc: "definition of the relationship templates of the topology"
1046 name: relationship_templates
1050 *relationship_template_definition
1052 desc: "definition of output parameters for the topology template"
1058 *attribute_assignment_definition
1060 desc: "An optional list of Group definitions whose members are node templates defined within this same Topology Template"
1068 # see 8.2.3, initially the list is not described as sequenced but then the grammar shows it as such !?
1069 desc: "An optional sequenced?? list of Policy definitions for the Topology Template."
1077 *policy_template_definition
1078 substitution_mappings:
1079 # one possible short-coming that is visible here is that the definition of the capability
1080 # and requirements mappings are given in the spec only with the short/inline version of a
1081 # YAML list/sequence, which cannot be enforced here ..
1082 desc: " a description of the topology template"
1083 name: substitution_mappings
1088 desc: "node type name"
1092 desc: "map_of_capability_mappings_to_expose"
1100 desc: "map_of_requirement_mapping_to_expose"
1109 # see A.9 Service Template definition: A TOSCA Service Template (YAML) document contains
1110 # element definitions of building blocks for cloud application, or complete models of cloud applications.
1113 name: service_template_definition
1115 tosca_definitions_version:
1116 desc: "Required TOSCA Definitions version string"
1119 enum: [tosca_simple_yaml_1_0_0]
1121 tosca_default_namespace:
1122 desc: "Optional. default namespace (for type schema)"
1127 desc: "Optional metadata keyname: value pairs"
1133 desc: "Optional name of this service template"
1137 desc: "Optional author of this service template"
1141 desc: "Optional version of this service template"
1145 desc: "User defined entry"
1149 #to add, the spec says: "Optional list of domain or profile specific metadata keynames"
1152 desc: "Optional description of the definitions inside the file"
1157 desc: "ordered list of import statements for importing other definitions files"
1168 desc: "list of YAML alias anchors (or macros)"
1169 name: dsl_definitions
1174 desc: "some piece of valid yaml that makes the anchor/alias definition"
1179 desc: "list of external repository definitions which host TOSCA artifacts"
1185 *repository_definition
1188 desc: "list of TOSCA datatype definitions"
1194 *data_type_definition
1197 desc: "list of node type definitions"
1203 *node_type_definition
1206 desc: "list of capability type definitions"
1207 name: capability_types
1212 *capability_type_definition
1215 desc: "list of relationship type definitions"
1216 name: relationship_types
1221 *relationship_type_definition
1224 desc: "list of artifact type definitions"
1225 name: artifact_types
1230 *artifact_type_definition
1233 desc: "list of interface type definitions"
1234 name: interface_types
1239 *interface_type_definition
1242 desc: "list of group type definitions"
1248 *group_type_definition
1251 desc: "list of policy type definitions"
1257 *policy_type_definition
1260 desc: "topology template definition of the cloud application or service"
1262 <<: *topology_template_definition