Sure, it is seen below. I saved it as a file named "v.yaml" and then ran
these commands to see the values of the function calls, which in both cases
was "hello":

aria service-templates store v.yaml v
aria service-templates show v -f

The file "v.yaml":

tosca_definitions_version: tosca_simple_yaml_1_0

data_types:

  Payload:
    properties:
      config:
        type: string

node_types:

  my_Node_Server:
    derived_from: tosca.nodes.Root
    attributes:
      vmme_configuration:
        type: string
        default: hello
    interfaces:
      Standard:
        type: tosca.interfaces.node.lifecycle.Standard
        create:
          implementation: sample.sample_test.call_test
          inputs: {}
        configure:
          implementation: sample.sample_test.call_name
          inputs:
            payload:
              type: Payload

topology_template:

   node_templates:
     v_mme:
       type: my_Node_Server
       interfaces:
         Standard:
           configure:
             inputs:
               payload: {
                 "config": {get_attribute: [ SELF, vmme_configuration ]}}
               config: {get_attribute: [ SELF, vmme_configuration ]}




On Tue, Dec 5, 2017 at 1:56 PM, Vaishali Krishnamurthy <
[email protected]> wrote:

> I have tried the same in the latest master version. Could you please
> provide
> the service template you used ?
>
> -----Original Message-----
> From: Tal Liron [mailto:[email protected]]
> Sent: Tuesday, December 05, 2017 3:41 PM
> To: [email protected]
> Subject: Re: get_attribute function not supporting SELF as
> <modelable_entity_name>
>
> I tried here and it did work for me. Are you using the latest master
> version? We had a few recent commits that have fixed various things.
>
> Perhaps you can provide a fully working minimal example that could clearly
> reproduce this bug?
>
> On Tue, Dec 5, 2017 at 12:02 PM, Vaishali Krishnamurthy <
> [email protected]> wrote:
>
> > Thanks. I tried this workaround. Still, the get_attribute function
> > returns the value 'none' when used in the first level of inputs. In my
> > case, I am trying to update the attribute value in one operation using
> > plugin and fetch the updated attribute value in another operation
> > using the get_attribute function, for which it returns 'none' when I
> > use SELF as modelable entity.
> > For the same scenario if I use the node name as modelable entity, it
> > works fine.
> >
> > -----Original Message-----
> > From: Tal Liron [mailto:[email protected]]
> > Sent: Tuesday, December 05, 2017 3:10 PM
> > To: [email protected]
> > Subject: Re: get_attribute function not supporting SELF as
> > <modelable_entity_name>
> >
> > The bug, in case you want to follow its progress:
> > https://issues.apache.org/jira/browse/ARIA-424
> >
> > On Tue, Dec 5, 2017 at 11:35 AM, Tal Liron <[email protected]> wrote:
> >
> > > There is a bug here, but it has nothing to do with SELF.
> > >
> > > The issue is that you are using an "ad hoc", typeless input here for
> > > the "configure" operation. Because it's typeless, ARIA sends it "as
> > > is" and thus has no idea that what's inside might be a syntactical
> > > intrinsic function.
> > >
> > > I will open a big for this, but for now the workaround is to
> > > explicitly declare the input at the type, which I think is generally
> > > a good idea. (And actually, I would rather ARIA not allow the
> > > current typeless input
> > > situation.)
> > >
> > > Here's how it would look:
> > >
> > > tosca_definitions_version: tosca_simple_yaml_1_0
> > >
> > > data_types:
> > >
> > >   Payload:
> > >     properties:
> > >       config:
> > >         type: string
> > >
> > > node_types:
> > >
> > >   my_Node_Server:
> > >     derived_from: tosca.nodes.Root
> > >     attributes:
> > >       vmme_configuration:
> > >         type: string
> > >         default: test default value
> > >     interfaces:
> > >       Standard:
> > >         type: tosca.interfaces.node.lifecycle.Standard
> > >         create:
> > >           implementation: sample.sample_test.call_test
> > >           inputs: {}
> > >         configure:
> > >           implementation: sample.sample_test.call_name
> > >           inputs:
> > >             payload:
> > >               type: Payload
> > >
> > > topology_template:
> > >
> > >    node_templates:
> > >      v_mme:
> > >        type: my_Node_Server
> > >        interfaces:
> > >          Standard:
> > >            configure:
> > >              inputs:
> > >                payload:
> > >                  config: {get_attribute: [ SELF, vmme_configuration ]}
> > >                config: {get_attribute: [ SELF, vmme_configuration ]}
> > >
> > >
> > >
> > >
> > >
> > >
> > > On Tue, Dec 5, 2017 at 10:58 AM, Vaishali Krishnamurthy <
> > > [email protected]> wrote:
> > >
> > >> Here, I have used the get_attribute in the input defined in the
> > >> second level, for which it returns me the dictionary object.
> > >> inputs:
> > >>       payload: {
> > >>             "config": {get_attribute: [ SELF, vmme_configuration
> > >> ]}}
> > >>
> > >> When I use the get_attribute in inputs defined in the first level
> > >> it returns me none.
> > >> inputs:
> > >>        config: {get_attribute: [ SELF, vmme_configuration ]}
> > >>
> > >> Please find the service template below.
> > >> node_types:
> > >>   my_Node_Server:
> > >>     derived_from: tosca.nodes.Root
> > >>     attributes:
> > >>       vmme_configuration:
> > >>         type: string
> > >>     interfaces:
> > >>       Standard:
> > >>         create:
> > >>           implementation: sample > sample.sample_test.call_test
> > >>           inputs: {}
> > >>         configure:
> > >>           implementation: sample > sample.sample_test.call_name
> > >>           inputs: {}
> > >>
> > >> topology_template:
> > >>
> > >>    node_templates:
> > >>      v_mme:
> > >>        type: my_Node_Server
> > >>        interfaces:
> > >>          Standard:
> > >>            configure:
> > >>              inputs:
> > >>                payload: {
> > >>                  "config": {get_attribute: [ SELF,
> > >> vmme_configuration
> > ]}}
> > >>                config: {get_attribute: [ SELF, vmme_configuration
> > >> ]}
> > >>
> > >> Regards,
> > >> Vaishali.
> > >>
> > >> -----Original Message-----
> > >> From: Tal Liron [mailto:[email protected]]
> > >> Sent: Tuesday, December 05, 2017 2:06 PM
> > >> To: [email protected]
> > >> Subject: Re: get_attribute function not supporting SELF as
> > >> <modelable_entity_name>
> > >>
> > >> Thanks for the report. Do you possibly have a minimal TOSCA
> > >> template we can use to reproduce the error?
> > >>
> > >> On Tue, Dec 5, 2017 at 8:29 AM, Vaishali Krishnamurthy <
> > >> [email protected]> wrote:
> > >>
> > >> > Hi,
> > >> >
> > >> > We have observed the attribute resolution is not proper when we
> > >> > use SELF as <modelable_entity_name> in  get_attribute function
> > >> > and it works fine when we use the node name as
> > >> > <modelable_entity_name> .
> > >> > With SELF it takes the default value. Could you confirm if there
> > >> > is any fix for this issue ?
> > >> >
> > >> >
> > >> > Regards,
> > >> >
> > >> > Vaishali
> > >> >
> > >>
> > >
> > >
> >
>

Reply via email to