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
15 desc: "Section used to declare additional metadata information"
18 name: range_definition
22 _version_definition: &version_definition
23 desc: "An optional TOSCA version number"
26 name: version_definition
27 # pattern: <major_version>.<minor_version>[.<fix_version>[.<qualifier>[-<build_version] ] ]
29 #common metadata defintion syntax
30 _metadata_definition: &metadata_definition
31 desc: "Section used to declare additional metadata information"
39 #this is where the need of verifying the size of a collection (sequence/map) came from
40 #this is specified as a sequence where each entry is a map with one entry??
41 _constraints_sequence: &constraints_sequence
42 name: constraints_sequence
50 desc: "Constrains a property or parameter to a value equal to the value declared."
54 desc: "Constrains a property or parameter to a value greater than the value declared"
58 desc: "Constrains a property or parameter to a value greater than or equal to the value declared."
62 desc: "Constrains a property or parameter to a value less than the value declared"
66 desc: "Constrains a property or parameter to a value less than or equal to the value declared."
70 desc: "Constrains a property or parameter to a value in range of (inclusive) the two values declared."
77 desc: "Constrains a property or parameter to a value that is in the list of declared values"
83 desc: "Constrains the property or parameter to a value of a given length."
87 desc: "Constrains the property or parameter to a value to a minimum length"
91 desc: "Constrains the property or parameter to a value to a maximum length"
95 desc: "Constrains the property or parameter to a value that is allowed by the provided regular expression."
99 # section A.5.3 property_filter_definition
100 # it is a constraints sequence that gets attached to a property ..
101 _property_filter_definition: &property_filter_definition
102 name: property_filter_definition
106 *constraints_sequence
108 #section A.5.4 node_filter_definition
109 _node_filter_definition: &node_filter_definition
111 name: node_filter_definition
114 desc: "property names to constraints to be applied to those properties"
118 - *property_filter_definition
122 # *constraints_sequence
129 name: node_filter_capabilities_sequence
130 desc: "the key is a capability name or type"
133 name: node_filter_capabilities_entry
137 desc: "the capability properties and their constraints"
138 name: node_filter_capabilities_properties
142 name: node_filter_capabilities_property
144 =: *constraints_sequence
146 #used in property and attribute definitions
147 _entry_schema_definition: &entry_schema_definition
148 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"
149 name: entry_schema_definition
155 desc: "collection element type"
162 *constraints_sequence
165 _artifact_definition: &artifact_definition
167 name: artifact_definition
168 short: implementation # assumes type can be inferred ..
171 desc: "The required artifact type for the artifact definition"
175 desc: "The optional description for the artifact definition"
179 desc: "The optional URI string (relative or absolute) which can be used to locate the artifacts file."
183 desc: "The optional name of the repository definition which contains the location of the external repository that contains the artifact"
187 desc: "The file path the associated file would be deployed into within the target nodes container."
192 _repository_definition: &repository_definition
194 name: repository_definition
198 desc: "The optional description for the repository."
202 desc: "The required URL or network address used to access the repository"
206 desc: "The optional Credential used to authorize access to the repository"
211 _import_definition: &import_definition
213 name: import_definition
221 desc: "symbolic name of the repository definition where the imported file can be found"
225 desc: "namespace URI to that will be applied to type definitions found within the imported file"
229 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"
234 _property_definition: &property_definition
236 name: property_definition
241 #not as easy, it can be an user defined data type
242 # <<: *primitive_types
247 desc: "The optional list of sequenced constraint clauses for the Data Type."
249 <<: *constraints_sequence
261 <<: *entry_schema_definition
262 # desc: "used to declare the name of the Datatype definition for entries of set types such as the TOSCA list or map."
267 #_property_assignment_definition: &property_assignment_definition
270 _attribute_definition: &attribute_definition
272 name: attribute_definition
277 # <<: *primitive_types
285 desc: "The optional status of the attribute relative to the specification or implementation"
290 <<: *entry_schema_definition
293 #here again, we must support the short form which is the most common
294 _attribute_assignment_definition: &attribute_assignment_definition
296 name: attribute_assignment_definition
299 desc: "The optional description of the attribute."
303 #actually 'value | value_expression'
304 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"
310 _parameter_definition: ¶meter_definition
312 name: parameter_definition
317 #not as easy, it can be an user defined data type
318 # <<: *primitive_types
323 desc: "The optional list of sequenced constraint clauses for the Data Type."
325 <<: *constraints_sequence
337 desc: "represent the type-compatible value to assign to the named parameter. Parameter values may be provided as the result from the evaluation of an expression or a function"
341 <<: *entry_schema_definition
346 # see spec section 3.5.13
348 # see spec section 3.5.13.2: variant to be used in node or relationship type definitions
349 _type_operation_definition: &type_operation_definition
351 name: type_operation_definition
352 short: implementation
355 desc: "The optional description string for the associated named operation."
359 desc: "The optional implementation artifact name (e.g., a script file name within a TOSCA CSAR file)"
368 desc: "a property value or an expression providing a input value"
369 name: property_assignment
373 _template_operation_definition: &template_operation_definition
375 name: template_operation_definition
376 short: implementation
379 desc: "The optional description string for the associated named operation."
383 desc: "The optional implementation artifact name (e.g., a script file name within a TOSCA CSAR file)"
384 name: template_operation_implementation_definition
390 desc: "The optional implementation artifact name (e.g., the primary script file name within a TOSCA CSAR file). "
394 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)"
405 desc: "a property value or an expression providing a input value"
406 name: property_assignment
410 # see section 3.5.14, specifically 3.5.14.2.1 : definition to be used in node or relationship type definition
411 _type_interface_definition: &type_interface_definition
413 name: type_interface_definition
416 desc: "represents the required name of the Interface Type for the interface definition"
420 desc: "The optional list of input property definitions available to all defined operations"
426 *type_operation_definition
428 # see section 3.5.14.2.2, extended notation to be used in node or relationship template definitions
429 _template_interface_definition: &template_interface_definition
431 name: template_interface_definition
434 desc: "The optional list of input property definitions available to all defined operations"
438 desc: "a property value or an expression providing a property value"
439 name: property_assignment
442 *template_operation_definition
445 _event_filter_definition: &event_filter_definition
447 name: event_filter_definition
450 desc: "The required name of the node type or template that contains either the attribute to be monitored or contains the requirement that references the node that contains the attribute to be monitored"
454 desc: "The optional name of the requirement within the filter
\92s node that can be used to locate a referenced node that contains an attribute to monitor."
458 desc: "The optional name of a capability within the filter
\92s node or within the node referenced by its requirement that contains the attribute to monitor."
463 # to be revised, based on working version
464 _trigger_definition: &trigger_definition
466 name: trigger_definition
473 desc: "The required name of the event type that activates the trigger
\92s action."
488 <<: *event_filter_definition
489 #the section made up of condition/constraint/period/evaluations/method has a mistmatching example in the spec doc ..
493 <<: *constraints_sequence
497 <<: *constraints_sequence
499 desc: "The optional period to use to evaluate for the condition"
507 desc: "The optional statistical method name to use to perform the evaluation of the condition"
511 desc: "The if of the workflow to be invoked when the event is triggered and the condition is met (i.e, evaluates to true) OR the required operation to invoke when the event is triggered and the condition is met (i.e., evaluates to true)."
513 type: str # or operation definition?
517 # to be revised, based on working version
518 # example on 3.5.17.4 shows this as a sequence of maps, each with one entry @!?
519 _workflow_activity_definition: &workflow_activity_definition
521 name: workflow_activity_definition
542 # to be revised, based on working version
543 _workflow_assertion_definition: &workflow_assertion_definition
544 name: workflow_assertion_definition
548 *constraints_sequence
552 # to be revised, based on working version
553 # it employs a recursive definition which yaml allows but teh parsers we've tried complain about, i.e the pattern
556 # is theoretically allowed in YAML
557 _workflow_condition_clause_definition: &workflow_condition_clause_definition
558 name: workflow_condition_clause_definition
562 name: workflow_condition_clause_entry
563 # here too length=1 would be good as a map can have only one entry
566 <<: *workflow_assertion_definition
568 # recursive definition ! yaml parser cannot deal with it
569 # <<: *workflow_condition_clause_definition
574 # recursive definition ! yaml parser cannot deal with it
575 # <<: *workflow_condition_clause_definition
583 # to be revised, based on working version
584 # here too, not clear if this a map or a sequence .. there is no example
585 _workflow_precondition_definition: &workflow_precondition_definition
586 name: workflow_precondition_definition
596 desc: "list of condition clause definition .. !@#$%"
597 <<: *workflow_condition_clause_definition
601 # to be revised, based on working version
602 _workflow_step_definition: &workflow_step_definition
603 name: workflow_step_definition
604 desc: "A workflow step allows to define one or multiple sequenced activities in a workflow and how they are connected to other steps in the workflow. They are the building blocks of a declarative workflow."
610 desc: "The target of the step (this can be a node template name, a group name)"
618 desc: "Filter is a map of attribute name, list of constraint clause that allows to provide a filtering logic"
622 *constraints_sequence
627 <<: *workflow_activity_definition
629 desc: "The optional list of step names to be performed after this one has been completed with success (all activities has been correctly processed)."
634 desc: "The optional list of step names to be called after this one in case one of the step activity failed."
642 # 3.6 section: type specific definitions
645 _capability_definition: &capability_definition
647 name: capability_definition
651 desc: "The required name of the Capability Type the capability definition is based upon"
655 desc: "The optional description of the Capability definition"
666 desc: "An optional list of property definitions for the Capability definition"
671 *attribute_definition
679 desc: "The optional minimum and maximum occurrences for the capability."
681 <<: *range_definition
688 _requirement_definition: &requirement_definition
690 name: requirement_definition
691 short: capability #as per A.6.2.2.1
694 desc: "The required reserved keyname used that can be used to provide the name of a valid Capability Type that can fulfil the requirement"
698 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. "
702 # and from section A.6.2.1, this one is an oddball
703 desc: "The optional reserved keyname used to provide the name of a valid Relationship Type to construct when fulfilling the requirement."
705 name: requirement_relationship_definition
710 desc: "The optional reserved keyname used to provide the name of the Relationship Type for the requirement definitions relationship keyname.
715 #not clear which interface definition is to be used here
716 desc: "allows augmentation (additional properties and operations) of the interfaces defined by the relationship type indicated above"
721 *type_interface_definition
723 desc: "The optional minimum and maximum occurrences for the requirement."
725 <<: *range_definition
728 _artifact_type_definition: &artifact_type_definition
730 name: artifact_type_definition
733 desc: "An optional parent Artifact Type name the Artifact Type derives from"
737 <<: *version_definition
739 <<: *metadata_definition
741 desc: "An optional description for the Artifact Type."
745 desc: "The required mime type property for the Artifact Type."
749 desc: "The required file extension property for the Artifact Type"
755 desc: "An optional list of property definitions for the Artifact Type"
762 #see spec section #3.6.5
763 _interface_type_definition: &interface_type_definition
765 name: interface_type_definition
768 desc: "The name of the Interface Type this Interface Type definition derives from"
772 desc: "The optional description for the Interface Type."
776 <<: *version_definition
778 <<: *metadata_definition
780 desc: "The optional list of input property definitions available to all defined operations"
785 desc: "property_name to property_value(_expression) mapping"
787 *type_operation_definition
789 #see spec section #3.6.6
790 _data_type_definition: &data_type_definition
792 name: data_type_definition
795 desc: "The optional key used when a datatype is derived from an existing TOSCA Data Type."
799 desc: "The optional description for the Data Type."
803 <<: *version_definition
805 <<: *metadata_definition
807 desc: "The optional list of sequenced constraint clauses for the Data Type."
808 <<: *constraints_sequence
810 desc: "The optional list property definitions that comprise the schema for a complex Data Type in TOSCA"
817 _capability_type_definition: &capability_type_definition
819 name: capability_type_definition
822 desc: "An optional parent capability type name this new Capability Type derives from."
826 desc: "An optional description for the Capability Type"
830 desc: "An optional list of property definitions for the Capability Type."
837 desc: "An optional list of attribute definitions for the Capability Type"
842 *attribute_definition
844 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"
850 # section A.6.7 requirement definition: TOSCA YAML profile relies on capability types to
851 # define requirements
853 # see section #3.6.10
854 _relationship_type_definition: &relationship_type_definition
856 name: relationship_type_definition
859 desc: "An optional parent Relationship Type name the Relationship Type derives from"
863 desc: "An optional description for the Relationship Type."
867 <<: *version_definition
869 <<: *metadata_definition
871 desc: "An optional list of property definitions for the Relationship Type"
878 desc: "An optional list of attribute definitions for the Relationship Type"
883 *attribute_definition
885 desc: "An optional list of interface definitions interfaces supported by the Relationship Type"
890 *type_interface_definition
892 desc: "An optional list of one or more names of Capability Types that are valid targets for this relationship. "
899 _group_type_definition: &group_type_definition
901 name: group_type_definition
904 desc: "An optional parent Group Type name this new Group Type derives from"
908 desc: "An optional description for the Group Type"
912 <<: *version_definition
914 <<: *metadata_definition
916 desc: "An optional list of property definitions for the Group Type."
923 desc: "An optional list of one or more names of Node Types that are valid
924 (allowed) as members of the Group Type."
930 desc: "An optional list of interface definitions supported by the Group Type"
935 *type_interface_definition
936 #TODO: group types have gained capabilities and requirements
940 _policy_type_definition: &policy_type_definition
942 name: policy_type_definition
945 desc: "An optional parent Policy Type name this new Policy Type derives from"
949 desc: "An optional description for the Policy Type"
953 <<: *version_definition
955 <<: *metadata_definition
957 desc: "An optional list of property definitions for the Policy Type."
964 desc: "An optional list of valid Node Types or Group Types the Policy Type
974 _node_type_definition: &node_type_definition
976 name: node_type_definition
979 desc: "An optional parent Node Type name this new Node Type derives from"
983 desc: "An optional description for the Node Type"
987 <<: *version_definition
989 <<: *metadata_definition
991 desc: "An optional list of property definitions for the Node Type."
998 desc: "An optional list of attribute definitions for the Node Type.
1004 *attribute_definition
1006 desc: "An optional sequenced list of requirement definitions for the Node Type.
1014 *requirement_definition
1016 desc: "An optional list of capability definitions for the Node Type"
1021 *capability_definition
1028 *type_interface_definition
1030 desc: "An optional list of named artifact definitions for the Node Type"
1035 *artifact_definition
1037 # A.7 Template specific definitions
1040 _capability_assignment_definition: &capability_assignment_definition
1042 name: capability_assignment_definition
1045 # list of property assignments
1046 desc: "An optional list of property definitions for the Capability definition"
1051 desc: "a property value or an expression providing a property value"
1052 name: property_assignment
1055 # list of attribute assignments
1056 desc: "An optional list of attribute definitions for the Capability definition"
1062 name: attribute_assignment
1066 _requirement_assignment_definition: &requirement_assignment_definition
1068 name: requirement_assignment_definition
1072 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."
1076 #why is this a reference to a node type and not to a node template??
1077 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"
1083 #fins a better name name: relationship_definition
1088 desc: "The optional reserved keyname used to provide the name of the Relationship Type for the requirement assignments relationship keyname"
1097 desc: "a property value or an expression providing a property value"
1098 name: property_assignment
1101 desc: "from A.5.12.2.2, right?"
1106 *template_interface_definition
1108 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."
1110 <<: *node_filter_definition
1113 _node_template_definition: &node_template_definition
1115 name: node_template_definition
1118 desc: "The required name of the Node Type the Node Template is based upon"
1122 desc: "An optional description for the Node Template"
1126 <<: *metadata_definition
1128 desc: "An optional list of directive values to provide processing instructions to orchestrators and tooling."
1134 #custom check needs to be added: the value or expression providing the property value
1135 #needs to be compatible with the property definition
1136 desc: "An optional list of property value assignments for the Node Template."
1142 name: property_assignment
1143 desc: "a property value or an expression providing a property value"
1145 desc: "An optional list of attribute value assignments for the Node Template"
1150 *attribute_assignment_definition
1152 desc: "An optional sequenced list of requirement assignments for the Node Template."
1159 *requirement_assignment_definition
1161 desc: "An optional list of capability assignments for the Node Template."
1166 *capability_assignment_definition
1168 desc: "An optional list of named interface definitions for the Node Template"
1173 *template_interface_definition
1175 desc: "An optional list of named artifact definitions for the Node Template.
1181 *artifact_definition
1183 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."
1185 <<: *node_filter_definition
1187 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."
1192 _relationship_template_definition: &relationship_template_definition
1194 name: relationship_template_definition
1197 desc: "The required name of the Relationship Type the Relationship Template is based upon"
1201 desc: "An optional description for the Relationship Template"
1205 <<: *metadata_definition
1207 desc: "An optional list of property assignments for the Relationship Template."
1209 name: properties_assignment_validation
1215 desc: "an expression providing a property value"
1217 desc: "An optional list of attribute value assignments for the Relationship Template"
1219 name: attributes_assignment_validation
1224 desc: "an expression providing an attribute value"
1226 desc: "An optional list of named interface definitions for the Relationship Template ('augmentation' is allowed here)"
1231 *template_interface_definition
1233 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."
1239 _group_definition: &group_definition
1241 name: group_definition
1244 desc: "The required name of the group type the group definition is based upon"
1248 desc: "The optional description for the group definition"
1251 <<: *metadata_definition
1253 desc: " represents the optional list of property assignments for the group definition that provide values for properties defined in its declared Group Type"
1259 name: property_assignment
1261 desc: "contains the required list of one or more node template names (within the same topology template) that are members of this logical group"
1267 desc: "represents the optional list of interface definitions for the group definition that augment those provided by its declared Group Type"
1272 *template_interface_definition
1275 _policy_template_definition: &policy_template_definition
1277 name: policy_definition
1280 desc: "The required name of the policy type the policy definition is based upon"
1284 desc: "The optional description for the policy definition"
1287 <<: *metadata_definition
1289 desc: "represents the optional list of property assignments for the policy definition that provide values for properties defined in its declared Policy Type"
1295 name: property_assignment
1297 desc: "represents the optional list of names of node templates or groups that the policy is to applied to"
1303 #see section 3.7.7, obviously incomplete spec
1304 _workflow_definition: &workflow_definition
1306 name: workflow_definition
1309 desc: "The optional description for the workflow definition"
1312 <<: *metadata_definition
1314 desc: "optional list of input parameter definitions"
1319 *property_definition
1321 desc: "List of preconditions to be validated before the workflow can be processed."
1323 type: any #incomplete spec
1327 type: any #incomplete spec
1330 # see section 3.8 Topology Template definition: defines the topology template of a cloud application.
1331 # described as a a reusable grammar as it can be a part of a service template definition
1332 _topology_template_definition: &topology_template_definition
1334 name: topology_template_definition
1337 desc: "a description of the topology template"
1341 desc: "definition of input parameters for the topology template"
1347 *property_definition
1349 desc: "definition of the node templates of the topology"
1350 name: node_templates
1355 *node_template_definition
1356 relationship_templates:
1357 desc: "definition of the relationship templates of the topology"
1359 name: relationship_templates
1363 *relationship_template_definition
1365 desc: "definition of output parameters for the topology template"
1371 *attribute_assignment_definition
1373 desc: "An optional list of Group definitions whose members are node templates defined within this same Topology Template"
1381 # see 8.2.3, initially the list is not described as sequenced but then the grammar shows it as such !?
1382 desc: "An optional sequenced?? list of Policy definitions for the Topology Template."
1390 *policy_template_definition
1392 desc: "optional map of imperative workflow definition for the Topology Template"
1398 *workflow_definition
1399 substitution_mappings:
1400 # one possible short-coming that is visible here is that the definition of the capability
1401 # and requirements mappings are given in the spec only with the short/inline version of a
1402 # YAML list/sequence, which cannot be enforced here ..
1403 desc: " a description of the topology template"
1404 name: substitution_mappings
1409 desc: "node type name"
1413 desc: "map_of_capability_mappings_to_expose"
1421 desc: "map_of_requirement_mapping_to_expose"
1430 # see A.9 Service Template definition: A TOSCA Service Template (YAML) document contains
1431 # element definitions of building blocks for cloud application, or complete models of cloud applications.
1434 name: service_template_definition
1436 tosca_definitions_version:
1437 desc: "Required TOSCA Definitions version string"
1440 enum: [tosca_simple_yaml_1_1, tosca_simple_yaml_1_1_0]
1442 tosca_default_namespace:
1443 desc: "Optional. default namespace (for type schema)"
1448 desc: "Optional metadata keyname: value pairs"
1454 desc: "Optional name of this service template"
1458 desc: "Optional author of this service template"
1462 desc: "Optional version of this service template"
1466 desc: "User defined entry"
1470 #to add, the spec says: "Optional list of domain or profile specific metadata keynames"
1473 desc: "Optional description of the definitions inside the file"
1478 desc: "ordered list of import statements for importing other definitions files"
1489 desc: "list of YAML alias anchors (or macros)"
1490 name: dsl_definitions
1495 desc: "some piece of valid yaml that makes the anchor/alias definition"
1500 desc: "list of external repository definitions which host TOSCA artifacts"
1506 *repository_definition
1509 desc: "list of TOSCA datatype definitions"
1515 *data_type_definition
1518 desc: "list of node type definitions"
1524 *node_type_definition
1527 desc: "list of capability type definitions"
1528 name: capability_types
1533 *capability_type_definition
1536 desc: "list of relationship type definitions"
1537 name: relationship_types
1542 *relationship_type_definition
1545 desc: "list of artifact type definitions"
1546 name: artifact_types
1551 *artifact_type_definition
1554 desc: "list of interface type definitions"
1555 name: interface_types
1560 *interface_type_definition
1563 desc: "list of group type definitions"
1569 *group_type_definition
1572 desc: "list of policy type definitions"
1578 *policy_type_definition
1581 desc: "topology template definition of the cloud application or service"
1583 <<: *topology_template_definition