...
"derivedFrom" is referenced to a ToscaEntity of the same type and placed in same collection.
Example | Key |
---|---|
derivedFrom: onap.datatypes.ToscaConceptIdentifier | onap.datatypes.ToscaConceptIdentifier (any version) |
derivedFrom: org.onap.policy.clamp.acm.PolicyAutomationCompositionElement:1.0.0 | org.onap.policy.clamp.acm.PolicyAutomationCompositionElement:1.0.0 |
Validation in new ORM layer
...
"type_version" is optional and "0.0.0" is the default value, "namespace" is optional and "DefaultNameSpace" is the default value, type could be used as formatted string: {namespace}:{name}:{version}. The "Key" is used for the validation to find if the ToscaEntity exists in same ServiceTemplate or in other one.
Examples:
Example | Key (if defined in same service template) | Key (for external service template) |
---|---|---|
type: onap.datatypes.ToscaConceptIdentifier | "onap.datatypes.ToscaConceptIdentifier:0.0.0" | "DefaultNameSpace:onap.datatypes.ToscaConceptIdentifier:0.0.0" |
type: org.onap.policy.clamp.acm.PolicyAutomationCompositionElement | "org.onap.policy.clamp.acm.PolicyAutomationCompositionElement:1.0.0" | "DefaultNameSpace:org.onap.policy.clamp.acm.PolicyAutomationCompositionElement:1.0.0" |
type: onap.datatype.acm.Target:1.2.3 | "onap.datatype.acm.Target:1.2.3" | "DefaultNameSpace:onap.datatype.acm.Target:1.2.3" |
type: CustomNamespace:onap.datatype.acm.Operation:1.0.1 | "onap.datatype.acm.Operation:1.0.1" | "CustomNamespace:onap.datatype.acm.Operation:1.0.1" |
"derivedFrom" should have same logic as before and it could be used as formatted string: {namespace}:{name}:{version}.
Example | Key (if defined in same service template) | Key (for external service template) |
---|---|---|
derivedFrom: onap.datatypes.ToscaConceptIdentifier | "onap.datatypes.ToscaConceptIdentifier:0.0.0" | "DefaultNameSpace:onap.datatypes.ToscaConceptIdentifier:0.0.0" |
derivedFrom: onap.datatype.acm.Target:1.2.3 | "onap.datatype.acm.Target:1.2.3" | "DefaultNameSpace:onap.datatype.acm.Target:1.2.3" |
derivedFrom: CustomNamespace:onap.datatype.acm.Operation:1.0.1 | "onap.datatype.acm.Operation:1.0.1" | "CustomNamespace:onap.datatype.acm.Operation:1.0.1" |
Update
There are two kind of update:
...
- We could consider Service templates references to each other as a DAG ( directed acyclic graph), where Service templates are nodes, and a references as edges. Cyclic references are not allowed.
- Should be available a functionality to load a full version of the service template that contains own tosca entities and also all tosca entities referenced from other service templates
- A service template cannot be deleted if there are references to it
- Any Tosca Entity in a common service template cannot be deleted if there are references to that service template
- Any Tosca Entity in a common service template cannot change "namespace", "type" and "type_version" if there are references to that service template
- Any Tosca Entity in a common service template cannot change values if there are automation compositions referenced to that service template (and references to that service template?)
- A Tosca Entity cannot be add in a common service template if there are automation compositions referenced to that service template
- Functionality as create, update and delete of a ToscaEntity in a service template should be validated and restricted to the service template itself. (Example: update property values of a service template should never update property values from other service templates referenced)
- To reduce the complexity, could be useful to save additional information about the service template:
- A full version of the service template that contains own tosca entities and also all tosca entities referenced from other service templates. it will be used in read-only for business logic purpose
- A table to save relations between service templates
- A table to save relations between service templates and automation compositions (with all service templates referenced)
Current ORM layer for ToscaServiceTemplate
ORM layer for ToscaServiceTemplate Proposed
Conclusion
- Work in progress