This page is a place to discuss and document our understanding of and rules for how referencing and versioning between TOSCA data types, policy types, and policies work.
Versioning
Versions of entities in TOSCA is poorly supported. One can specify versions on definitions of entities but not when referencing those entities from other entities. For example, when specifying the data type of a porperty in a policy type, the TOSCA definition says to specify it as a string. It is not possible to specify which version of a data type one is using.
CRUD with versions of Data Types, Policy Types and Policies
Chenfei Gao Would you perhaps write this section?
Referencing Data Types and Policy types
Today, when referencing a policy type from a data type, we add the "type_version" field:
tosca_definitions_version: tosca_simple_yaml_1_0_0 topology_template: policies: - operational.restart: type: onap.policies.controlloop.operational.common.Drools type_version: 1.0.0
An alternative that could work with all references could be as follows:
tosca_definitions_version: tosca_simple_yaml_1_0_0 topology_template: policies: - operational.restart: type: onap.policies.controlloop.operational.common.Drools#1.0.0
In other words, the '#' character acts as a delimiter between the type name and its version.
An alternative that could work with all references could be as follows:
tosca_definitions_version: tosca_simple_yaml_1_0_0 topology_template: policies: - operational.restart: type: onap.policies.controlloop.operational.common.Drools
Not specifying a version means to use the latest version available.
Reading Data Types and Policy Types
When a data type or a policy type is read from the database:
- The requested entity is returned
- Any data types referenced by the requested policy type or data type are returned
- Any Policy types from which a requested policy type inherits are returned