OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

tosca-comment message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [tosca-comment] Using entity name in implementation scripts


Chris,

Thank you. My primary use case is when using a node template to represent deployment of an image to Kubernetes. It would be convenient to use the template name as the value for the NAME variable in the kubectl run command.

My secondary use case was a specialised form of logging where the logs keep track of  certain types of relationships. Now that I better understand TARGET and SOURCE in relationship templates I can see that they can reference a node property of, say, kubernetes_name at each end of the relationship.

So while enhancing the TOSCA spec to allow the kubernetes command NAME value to be equal to the node template name might be nice to have, without further support from the community I'm not sure it is worth the additional complexity in the spec and implementations.

Regards

Paul

On 04/11/2021 18:22, Chris Lauwers wrote:

Hi Paul,

 

Apologies for the delayed response. You are correct that there currently is no way to access the node template names (or the names of any other entities for that matter). Even the SOURCE and TARGET keywords donât return names. Instead, they return references to the node template at the source or the target of the relationship (with the goal of then being able to retrieve property/attribute values from those nodes).

 

I assume youâre use case is for logging purposes only? Or if you have something else in mind, could you please share what youâre trying to accomplish? As weâre defining TOSCA v2.0, we could potentially add more built-in names (such as your SELF_NAME idea).

 

Thanks,

 

Chris

 

From: tosca-comment@lists.oasis-open.org <tosca-comment@lists.oasis-open.org> On Behalf Of Paul Jordan
Sent: Monday, November 1, 2021 1:42 AM
To: tosca-comment@lists.oasis-open.org
Subject: [tosca-comment] Using entity name in implementation scripts

 

Regarding both 1.3 and draft 2.0, there is no method for the mandatory name of a modelable entity (e.g., Node Template or Relationship Template name) as declared in the service template to be referenced by an implementation script associated with that entity.
This is because the get_property function defines <property_name> as mandatory which must be a property name.

Note that this situation is in contrast to Relationship templates which do have access to the mandatory node template names at each end via the TARGET and SOURCE variables.

My current work-around is to define a property in the Node Template which is given a value equal to the node template name. This is not ideal as it may inadvertently be set to the wrong value and thus not match a test with the value TARGET and SOURCE.

A potential enhancement would be to allow <property_name> to optionally be a new reserved work such as SELF_NAME

Regards

Paul Jordan





[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]