I'm relating it to programming languages.   Long ago many languages did
away with 'structs' in favor of accessors (i.e. getters and setters).
 Just trying to make the same basic advance here.  There is nothing in
TOSCA that says an attribute has to equate to a fixed value in memory (that
I've seen).  It is portable, because the plugin is in charge of attributes
for the types it defines.  Basic stuff.

On Thu, Nov 16, 2017 at 11:25 AM, Steve Baillargeon <
steve.baillarg...@ericsson.com> wrote:

> Hi
> A follow-up question.
> I am trying to understand the meaning of "function" here.
>
> Is the solution as simple as defining an attribute (say of type string),
> skip the attribute assignment in the template and let the plugin decides
> the "value" for the attribute which can be a calculated value or any
> function implemented by the plugin? Yes I agree this is not portable.
> Did I miss something?
>
> -Steve
>
> -----Original Message-----
> From: Tal Liron [mailto:t...@cloudify.co]
> Sent: Wednesday, November 15, 2017 4:24 PM
> To: dev@ariatosca.incubator.apache.org
> Subject: Re: attributes
>
> Well, this is a bit complex.
>
> Attributes are ostensibly filled during runtime by other systems, for
> example during the install workflow an ip_address would get its real value.
> It's not really clear how another system would be able to insert a
> function here, but it's not impossible. In ARIA's case, functions are
> implemented as pickled Python classes, so it would be possible to do this,
> however obviously it would not be portable.
>
> But, you can also give attributes default values. For default values,
> obviously you can use functions.
>
> On Wed, Nov 15, 2017 at 2:51 PM, DeWayne Filppi <dewa...@cloudify.co>
> wrote:
>
> > General TOSCA question.  Is there anything in the spec that requires
> > attributes to be values rather than functions?  IOW, is there anything
> > in there that prevents an orchestrator from representing an attribute
> > read as more of a "getter", rather than a database fetch?  I ask
> > because I've run across a case where I'd prefer an attribute reference
> > to return a calculated value.  Seems more flexible if allowed, and if
> > not allowed, it should be allowed.
> >
> > DeWayne
> >
>

Reply via email to