"directives" is just a list of strings. Moreover, it seems like a placeholder for something in the future. Also note that "directives" exist only for node templates, not node type, so this means that in order to use substitution we would have to have a node template marked as being abstract. If we want to use a directive with some sophistication, we would have to invent some weird string-based language for this (like we did for operation configuration) in order to configure exactly how substitution would happen.
I really think that a policy is the correct way to handle this for now, and possibly for the future. It is the most "TOSCA-in-spirit" solution. On Wed, Sep 6, 2017 at 3:45 AM, Avia Efrat <[email protected]> wrote: > On Tue, Sep 5, 2017 at 6:09 PM, Tal Liron <[email protected]> wrote: > > > > > Just like you can specify a specific node template for a requirement, I > > believe it can be useful and often necessary to specify a substituted > > service template. > > > > Even if it is needed, the question is how to do that. Using a policy > seems too much like a catch-all solution. In the spec, there is the notion > of the "substitutable" directive [2.10.2]. At first I thought it was meant > as a general concept, but then I noticed that: > > 1. node templates have a `directives` field, that is described as "an > optional list of directive values to provide processing instructions to > orchestrators and tooling" [3.7.3.1]. > 2. section [2.10.2] does not mention "substitutable directive", but rather > "substitutable" directive. It seems that their intention is the adding the > "substitutable" string to the `directives` field of the node template is > the mean by TOSCA is designating a node to be substituted. > 3. section [2.9] extensively deals with abstract nodes. It mentions another > use of the `directives` field, this time the "selectable" directive (also > in [3.7.3.1], [3.7.3.3]). > > Although section [3.3.3] states that there are no defined directives in > TOSCA 1.0, the de facto usages of the directive field indicates at least > that there is intent of using this field, and maybe define it more > explicitly in future versions. > > Bottom line, currently I see the `directives` field as the the indicator of > substitutable nodes (by specifying the "substitutable" directive). It is > needed to enquire OASIS regarding their future plans of TOSCA. >
