-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarification on usage of TOSCA grammar to define objects in Metadata #126
Comments
Hi @abhishek-kumar0409 , The "Is it permitted to use TOSCA functions such as This applies the |
The short answer is yes. In general, it is legal to use function values anywhere in a template (or a profile) where a value needs to be specified (although there are a number of exceptions). TOSCA v1.3 does not do a very good job of detailing this, but we're trying to be much more precise in TOSCA v2.0 If you look at Section 6.1 of https://www.oasis-open.org/committees/document.php?document_id=70220&wg_abbrev=tosca, you'll see that we're starting to spell out the rules for where function values are allowed. We're working on defining where function values are not allowed in detail as well. I believe the team is currently on the fence regarding function values in metadata. |
Thanks Chris, in light of explicit advice, then my opinion is that if we are compliant to the TOSCA v1.3 specification, then as get_input isn't explicitly forbidden in the context described (in this version of the specification), that there would be no restrictions in the given context. This may change in the future (for example, TOSCA v2.0), but for the moment, it should not be considered "illegal" to use get_input under the metadata as shown by the example by "Abhishek" and commented on by "Aidan". If that interpretation is incorrect, then please let us know. Much thanks. |
Many thanks @lauwers (for ensuring that these issues are being addressed in your future work) , @ahanniga (for simplifying my question). @lauwers: Can you provide us some guidance on interpretation of the grammar in the existing standards ? As per section 3.10.3.2 metadata (TOSCA-1.3), This clause in TOSCA-1.3 spec seems to contradict with the statements made above. Regards, |
I do not think metadata should support function calls. The issue is that metadata is essentially structural. It is associated with almost all TOSCA entities, which includes types, but if it must be dynamically rendered (with calls to Your example would support my point. It seems you are using metadata to provide extra properties/attributes that were not included in the node type, essentially working around deficiencies in the profile. But, notice another problem: TOSCA values are marked as either "properties" or "attributes", with different runtime and storage semantics. How do you expect metadata to work? Like a property, or like an attribute? This is undefined and, I argue, shouldn't be defined. Alternative solutions would be:
I admit, these three alternatives are all more challenging than simply adding more properties/attributes. If this use case seems prevalent, I would propose we discuss an addition to TOSCA 2.0: An This might seem scary because these extra properties and attributes have not been declared and are thus non-typed. However, let's remember that we allow for undeclared (non-typed) values as operation inputs and service template outputs. I'm not excited about such an addition because it is very rife for abuse. Essentially all type information can be ignored. Imagine all your node templates being of However, I likewise do not think we want to see metadata being abused as a way to provide such "extra properties". |
I fully agree with @tliron : metadata should be seen as annotations attached to TOSCA elements (e.g. types, node templates), and should not be seen as properties or attributes of type/template instances. According to section 3.6.2.2, the grammar defines that metadata is a map of strings, the grammar does not define that metadata is a map of string expressions. According to section 3.6.2.4, " |
I believe we decided that the specification should state explicitly where function values are allowed. https://docs.oasis-open.org/tosca/TOSCA/v2.0/csd05/TOSCA-v2.0-csd05.html#_Toc125468800 starts to do this, but the language in that section is somewhat wishy-washy. It should be cleaned up. |
The consensus is that function values are not allowed in metadata. Issue #139 will be used to further define the areas in the spec where function values are explicitly allowed. |
As it is evident from the standards, the data type of the metadata is a map of strings. I've come across some VNF Descriptors that use map of strings along with expressions as shown in the below example.
e.g.
In this example, the assumption is made that the security group is pre-created by the cloud administrators. And, the VNF-D designer has to simply reference the name of the security group name in the VNF-D, without creating the security groups in the Openstack. Some designers may use inputs section to define the value of the security group or any other k-V parameters and use get_input property to .
Perhaps it is not evident for the TOSCA grammar whether the objects defined in the metadata section is map of strings or map of strings with expression.
Question - Is it allowed to define values as map of string with expressions in the metadata ?
The text was updated successfully, but these errors were encountered: