Re: [netmod] YANG action not allowed at root?

2020-05-05 Thread Juergen Schoenwaelder
On Tue, May 05, 2020 at 12:06:34PM +0200, Per Hedeland wrote:
> On 2020-05-05 11:55, Juergen Schoenwaelder wrote:
> > On Tue, May 05, 2020 at 11:45:41AM +0200, Per Hedeland wrote:
> >> On 2020-05-05 11:00, Martin Björklund wrote:
> >>> Hi,
> >>>
> >>> If we were to redo YANG, I would prefer to have a single statement
> >>> "operation", either on the top-level, or tied to a node.
> >>
> >> So, no rpc statement, and thereby no possibility to extend NETCONF
> >> with new RPCs? (Or to be precise, YANG would extend NETCONF with
> >> exactly one RPC, called "operation"?)
> >>
> >
> > OLD
> >
> >   rpc foo {}
> >   list something { action bar {} }
> >
> > NEW
> >
> >   operation foo {}
> >   list something { operation bar {} }
> 
> Yes, that much is obvious, my question was really about the NETCONF
> encoding.
> 
> > Syntactic sugar if you will.
> 
> So you're saying that the NETCONF encoding of "operation foo" at the
> top level would be an RPC called "foo", while the NETCONF encoding of
> "operation foo" elsewhere would be an RPC called "action"?
>

Yes. Unless you want to change the protocol (or the protocols) as
well, which would involve another WG (or even WGs). Perhaps this is
what will happen if we were to start this.

But ideally, we would use a YANG next activity to get the interface
between YANG, the encodings of YANG defined data, and the protocols
better worked out (since we now know that we have several of them to
take care of and we I think we learned where we could have made things
simpler).

/js

-- 
Juergen Schoenwaelder   Jacobs University Bremen gGmbH
Phone: +49 421 200 3587 Campus Ring 1 | 28759 Bremen | Germany
Fax:   +49 421 200 3103 

___
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod


Re: [netmod] YANG action not allowed at root?

2020-05-05 Thread Martin Björklund
"Rob Wilton (rwilton)"  wrote:
> 
> 
> > -Original Message-
> > From: netmod  On Behalf Of Martin Björklund
> > Sent: 05 May 2020 11:30
> > To: p...@hedeland.org
> > Cc: netmod@ietf.org
> > Subject: Re: [netmod] YANG action not allowed at root?
> > 
> > Per Hedeland  wrote:
> > > On 2020-05-05 11:55, Juergen Schoenwaelder wrote:
> > > > On Tue, May 05, 2020 at 11:45:41AM +0200, Per Hedeland wrote:
> > > >> On 2020-05-05 11:00, Martin Björklund wrote:
> > > >>> Hi,
> > > >>>
> > > >>> If we were to redo YANG, I would prefer to have a single statement
> > > >>> "operation", either on the top-level, or tied to a node.
> > > >>
> > > >> So, no rpc statement, and thereby no possibility to extend NETCONF
> > > >> with new RPCs? (Or to be precise, YANG would extend NETCONF with
> > > >> exactly one RPC, called "operation"?)
> > > >>
> > > >
> > > > OLD
> > > >
> > > >   rpc foo {}
> > > >   list something { action bar {} }
> > > >
> > > > NEW
> > > >
> > > >   operation foo {}
> > > >   list something { operation bar {} }
> > >
> > > Yes, that much is obvious, my question was really about the NETCONF
> > > encoding.
> > >
> > > > Syntactic sugar if you will.
> > >
> > > So you're saying that the NETCONF encoding of "operation foo" at the
> > > top level would be an RPC called "foo"
> > 
> > Yes.
> > 
> > > while the NETCONF encoding of
> > > "operation foo" elsewhere would be an RPC called "action"?
> > 
> > Yes; or called something else.
> [RW] 
> 
> What is your reasoning for not wanting to unify the encoding?

I don't want to change the protocol.

> E.g. always treat the encoding like action, but with the  node 
> removed.

This would violate RFC 6241 which says:

   The name of the RPC is an element directly inside the
element, and any parameters are encoded inside this element.



/martin


> 
> Regards,
> Rob
> 
> [As an individual contributor]
> 
> > 
> > 
> > /martin
> > 
> > ___
> > netmod mailing list
> > netmod@ietf.org
> > https://www.ietf.org/mailman/listinfo/netmod

___
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod


Re: [netmod] YANG action not allowed at root?

2020-05-05 Thread Rob Wilton (rwilton)



> -Original Message-
> From: netmod  On Behalf Of Martin Björklund
> Sent: 05 May 2020 11:30
> To: p...@hedeland.org
> Cc: netmod@ietf.org
> Subject: Re: [netmod] YANG action not allowed at root?
> 
> Per Hedeland  wrote:
> > On 2020-05-05 11:55, Juergen Schoenwaelder wrote:
> > > On Tue, May 05, 2020 at 11:45:41AM +0200, Per Hedeland wrote:
> > >> On 2020-05-05 11:00, Martin Björklund wrote:
> > >>> Hi,
> > >>>
> > >>> If we were to redo YANG, I would prefer to have a single statement
> > >>> "operation", either on the top-level, or tied to a node.
> > >>
> > >> So, no rpc statement, and thereby no possibility to extend NETCONF
> > >> with new RPCs? (Or to be precise, YANG would extend NETCONF with
> > >> exactly one RPC, called "operation"?)
> > >>
> > >
> > > OLD
> > >
> > >   rpc foo {}
> > >   list something { action bar {} }
> > >
> > > NEW
> > >
> > >   operation foo {}
> > >   list something { operation bar {} }
> >
> > Yes, that much is obvious, my question was really about the NETCONF
> > encoding.
> >
> > > Syntactic sugar if you will.
> >
> > So you're saying that the NETCONF encoding of "operation foo" at the
> > top level would be an RPC called "foo"
> 
> Yes.
> 
> > while the NETCONF encoding of
> > "operation foo" elsewhere would be an RPC called "action"?
> 
> Yes; or called something else.
[RW] 

What is your reasoning for not wanting to unify the encoding?

E.g. always treat the encoding like action, but with the  node removed.

Regards,
Rob

[As an individual contributor]

> 
> 
> /martin
> 
> ___
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod

___
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod


Re: [netmod] YANG action not allowed at root?

2020-05-05 Thread Martin Björklund
"Rob Wilton (rwilton)"  wrote:
> [As an individual contributor]
> 
> Is this something that we should try and improve in a future revision
> of YANG?
> 
> E.g., deprecating either rpc or action, and allow the other one to be
> specified more flexibly?  Looking at the encodings it might make more
> sense to make rpc more generic and deprecate action.

No.


/martin



> 
> Regards,
> Rob
> 
> 
> > -Original Message-
> > From: netmod  On Behalf Of Juergen
> > Schoenwaelder
> > Sent: 05 May 2020 10:18
> > To: Martin Björklund 
> > Cc: netmod@ietf.org
> > Subject: Re: [netmod] YANG action not allowed at root?
> > 
> > On Tue, May 05, 2020 at 11:00:11AM +0200, Martin Björklund wrote:
> > > Hi,
> > >
> > > If we were to redo YANG, I would prefer to have a single statement
> > > "operation", either on the top-level, or tied to a node.
> > >
> > 
> > +1
> > 
> > /js
> > 
> > --
> > Juergen Schoenwaelder   Jacobs University Bremen gGmbH
> > Phone: +49 421 200 3587 Campus Ring 1 | 28759 Bremen | Germany
> > Fax:   +49 421 200 3103 <https://www.jacobs-university.de/>
> > 
> > ___
> > netmod mailing list
> > netmod@ietf.org
> > https://www.ietf.org/mailman/listinfo/netmod

___
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod


Re: [netmod] YANG action not allowed at root?

2020-05-05 Thread Martin Björklund
Per Hedeland  wrote:
> On 2020-05-05 11:55, Juergen Schoenwaelder wrote:
> > On Tue, May 05, 2020 at 11:45:41AM +0200, Per Hedeland wrote:
> >> On 2020-05-05 11:00, Martin Björklund wrote:
> >>> Hi,
> >>>
> >>> If we were to redo YANG, I would prefer to have a single statement
> >>> "operation", either on the top-level, or tied to a node.
> >>
> >> So, no rpc statement, and thereby no possibility to extend NETCONF
> >> with new RPCs? (Or to be precise, YANG would extend NETCONF with
> >> exactly one RPC, called "operation"?)
> >>
> >
> > OLD
> >
> >   rpc foo {}
> >   list something { action bar {} }
> >
> > NEW
> >
> >   operation foo {}
> >   list something { operation bar {} }
> 
> Yes, that much is obvious, my question was really about the NETCONF
> encoding.
> 
> > Syntactic sugar if you will.
> 
> So you're saying that the NETCONF encoding of "operation foo" at the
> top level would be an RPC called "foo"

Yes.

> while the NETCONF encoding of
> "operation foo" elsewhere would be an RPC called "action"?

Yes; or called something else.


/martin

___
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod


Re: [netmod] YANG action not allowed at root?

2020-05-05 Thread Per Hedeland
On 2020-05-05 11:55, Juergen Schoenwaelder wrote:
> On Tue, May 05, 2020 at 11:45:41AM +0200, Per Hedeland wrote:
>> On 2020-05-05 11:00, Martin Björklund wrote:
>>> Hi,
>>>
>>> If we were to redo YANG, I would prefer to have a single statement
>>> "operation", either on the top-level, or tied to a node.
>>
>> So, no rpc statement, and thereby no possibility to extend NETCONF
>> with new RPCs? (Or to be precise, YANG would extend NETCONF with
>> exactly one RPC, called "operation"?)
>>
>
> OLD
>
>   rpc foo {}
>   list something { action bar {} }
>
> NEW
>
>   operation foo {}
>   list something { operation bar {} }

Yes, that much is obvious, my question was really about the NETCONF
encoding.

> Syntactic sugar if you will.

So you're saying that the NETCONF encoding of "operation foo" at the
top level would be an RPC called "foo", while the NETCONF encoding of
"operation foo" elsewhere would be an RPC called "action"?

--Per

___
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod


Re: [netmod] YANG action not allowed at root?

2020-05-05 Thread Juergen Schoenwaelder
On Tue, May 05, 2020 at 11:45:41AM +0200, Per Hedeland wrote:
> On 2020-05-05 11:00, Martin Björklund wrote:
> > Hi,
> >
> > If we were to redo YANG, I would prefer to have a single statement
> > "operation", either on the top-level, or tied to a node.
> 
> So, no rpc statement, and thereby no possibility to extend NETCONF
> with new RPCs? (Or to be precise, YANG would extend NETCONF with
> exactly one RPC, called "operation"?)
>

OLD

  rpc foo {}
  list something { action bar {} }

NEW

  operation foo {}
  list something { operation bar {} }

Syntactic sugar if you will.

/js

-- 
Juergen Schoenwaelder   Jacobs University Bremen gGmbH
Phone: +49 421 200 3587 Campus Ring 1 | 28759 Bremen | Germany
Fax:   +49 421 200 3103 

___
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod


Re: [netmod] YANG action not allowed at root?

2020-05-05 Thread Rob Wilton (rwilton)
[As an individual contributor]

Is this something that we should try and improve in a future revision of YANG?

E.g., deprecating either rpc or action, and allow the other one to be specified 
more flexibly?  Looking at the encodings it might make more sense to make rpc 
more generic and deprecate action.

Regards,
Rob


> -Original Message-
> From: netmod  On Behalf Of Juergen Schoenwaelder
> Sent: 05 May 2020 10:18
> To: Martin Björklund 
> Cc: netmod@ietf.org
> Subject: Re: [netmod] YANG action not allowed at root?
> 
> On Tue, May 05, 2020 at 11:00:11AM +0200, Martin Björklund wrote:
> > Hi,
> >
> > If we were to redo YANG, I would prefer to have a single statement
> > "operation", either on the top-level, or tied to a node.
> >
> 
> +1
> 
> /js
> 
> --
> Juergen Schoenwaelder   Jacobs University Bremen gGmbH
> Phone: +49 421 200 3587 Campus Ring 1 | 28759 Bremen | Germany
> Fax:   +49 421 200 3103 <https://www.jacobs-university.de/>
> 
> ___
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod

___
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod


Re: [netmod] YANG action not allowed at root?

2020-05-05 Thread Per Hedeland
On 2020-05-05 11:00, Martin Björklund wrote:
> Hi,
>
> If we were to redo YANG, I would prefer to have a single statement
> "operation", either on the top-level, or tied to a node.

So, no rpc statement, and thereby no possibility to extend NETCONF
with new RPCs? (Or to be precise, YANG would extend NETCONF with
exactly one RPC, called "operation"?)

--Per

> /martin
>
> Christian Hopps  wrote:
>> An action is defined as being something bound to a node. Talking about
>> actions that aren't bound to a node is talking about RPCs AFAICT. In
>> the server it just comes down to passing the bound node data in to the
>> function or not. Defining "unbound actions" to replace RPCs is just
>> different syntax for the same thing, right? Having 2 ways to do the
>> same thing wouldn't help make servers easier to implement (it would do
>> the opposite actually).
>>
>> Thanks,
>> Chris.
>>
>>> On Apr 30, 2020, at 11:50 AM, Sterne, Jason (Nokia - CA/Ottawa)
>>>  wrote:
>>>
>>> Yes - the intent was to address the limitation that an RPC can only be
>>> at root. Actions can be out in a tree & nicely associated with
>>> something (e.g. instead of having a pile of flat RPCs with long names
>>> that encode containers like reset-www-xxx-yyy-zzz-entity).
>>>
>>> But I don't really understand why we limited actions from being at the
>>> root. It prevents a strategy of implementing all operations in a
>>> server (some of which may be desirable at root for various reasons,
>>> some of which may be desirable in the tree) as actions.
>>>
>>> Why not allow this?
>>>
>>>module bar {
>>>  action do-stuff {
>>>input {
>>>  leaf iterations {
>>>type uint8;
>>>   }
>>> }
>>>  }
>>>}
>>>}
>>>
>>> Which could be called from NETCONF like this:
>>>
>>>  >>   xmlns="urn:ietf:params:xml:ns:netconf:base:1..0">
>>>
>>>  
>>>5
>>>  
>>>
>>>  
>>>
>>>
>>> Jason
>>>
>>> From: Reshad Rahman (rrahman) 
>>> Sent: Thursday, April 30, 2020 11:31 AM
>>> To: Sterne, Jason (Nokia - CA/Ottawa) ;
>>> netmod@ietf.org
>>> Subject: Re: [netmod] YANG action not allowed at root?
>>>
>>> I dont know the history on this but the intent is to have action tied
>>> to a data node.
>>>
>>> https://tools.ietf.org/html/rfc7950#section-7.15
>>>The difference between an action and an rpc is that an action is tied
>>>to a node in the datastore, whereas an rpc is not.  When an action is
>>>invoked, the node in the datastore is specified along with the name
>>>of the action and the input parameters.
>>>
>>> Regards,
>>> Reshad.
>>>
>>> From: netmod  on behalf of "Sterne, Jason
>>> (Nokia - CA/Ottawa)" 
>>> Date: Thursday, April 30, 2020 at 11:08 AM
>>> To: "netmod@ietf.org" 
>>> Subject: [netmod] YANG action not allowed at root?
>>>
>>> Hi all,
>>>
>>> I was a bit surprised to find this in section 7.15 of 7950 recently:
>>>
>>>Since an action cannot be defined at the top level of a module or in
>>>a "case" statement, it is an error if a grouping that contains an
>>>action at the top of its node hierarchy is used at the top level of a
>>>module or in a case definition.
>>>
>>> I realize that actions can be placed down in a schema tree (i.e. sit
>>> in the context of a container or list), but why is it phrased that
>>> they *must* be in a container?
>>>
>>> RPCs are limited to being at the root. I would have thought actions
>>> could be anywhere (root or down in the tree).
>>>
>>> Jason
>>>
>>>
>>> ___
>>> netmod mailing list
>>> netmod@ietf.org
>>> https://www.ietf.org/mailman/listinfo/netmod
>>
>> ___
>> netmod mailing list
>> netmod@ietf.org
>> https://www.ietf.org/mailman/listinfo/netmod
> ___
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod
>

___
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod


Re: [netmod] YANG action not allowed at root?

2020-05-05 Thread Robert Varga
On 05/05/2020 11:00, Martin Björklund wrote:
> Hi,
> 
> If we were to redo YANG, I would prefer to have a single statement
> "operation", either on the top-level, or tied to a node.

Yeah, and we could introduce 'operation' as a generalized concept and
have rpc/action be just syntactic aliases for it in yang-next... :)

Regards,
Robert



signature.asc
Description: OpenPGP digital signature
___
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod


Re: [netmod] YANG action not allowed at root?

2020-05-05 Thread Juergen Schoenwaelder
On Tue, May 05, 2020 at 11:00:11AM +0200, Martin Björklund wrote:
> Hi,
> 
> If we were to redo YANG, I would prefer to have a single statement
> "operation", either on the top-level, or tied to a node.
>

+1

/js

-- 
Juergen Schoenwaelder   Jacobs University Bremen gGmbH
Phone: +49 421 200 3587 Campus Ring 1 | 28759 Bremen | Germany
Fax:   +49 421 200 3103 

___
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod


Re: [netmod] YANG action not allowed at root?

2020-05-05 Thread Martin Björklund
Hi,

If we were to redo YANG, I would prefer to have a single statement
"operation", either on the top-level, or tied to a node.


/martin

Christian Hopps  wrote:
> An action is defined as being something bound to a node. Talking about
> actions that aren't bound to a node is talking about RPCs AFAICT. In
> the server it just comes down to passing the bound node data in to the
> function or not. Defining "unbound actions" to replace RPCs is just
> different syntax for the same thing, right? Having 2 ways to do the
> same thing wouldn't help make servers easier to implement (it would do
> the opposite actually).
> 
> Thanks,
> Chris.
> 
> > On Apr 30, 2020, at 11:50 AM, Sterne, Jason (Nokia - CA/Ottawa)
> >  wrote:
> > 
> > Yes - the intent was to address the limitation that an RPC can only be
> > at root. Actions can be out in a tree & nicely associated with
> > something (e.g. instead of having a pile of flat RPCs with long names
> > that encode containers like reset-www-xxx-yyy-zzz-entity).
> >  
> > But I don't really understand why we limited actions from being at the
> > root. It prevents a strategy of implementing all operations in a
> > server (some of which may be desirable at root for various reasons,
> > some of which may be desirable in the tree) as actions.
> >  
> > Why not allow this?
> >  
> >module bar {
> >  action do-stuff {
> >input {
> >  leaf iterations {
> >type uint8;
> >   }
> > }
> >  } 
> >} 
> >} 
> >  
> > Which could be called from NETCONF like this:
> >  
> >   >   xmlns="urn:ietf:params:xml:ns:netconf:base:1..0">
> >    
> >      
> >5
> >  
> >
> >  
> >  
> >  
> > Jason
> >  
> > From: Reshad Rahman (rrahman)  
> > Sent: Thursday, April 30, 2020 11:31 AM
> > To: Sterne, Jason (Nokia - CA/Ottawa) ;
> > netmod@ietf.org
> > Subject: Re: [netmod] YANG action not allowed at root?
> >  
> > I don’t know the history on this but the intent is to have action tied
> > to a data node.
> >  
> > https://tools.ietf.org/html/rfc7950#section-7.15
> >The difference between an action and an rpc is that an action is tied
> >to a node in the datastore, whereas an rpc is not.  When an action is
> >invoked, the node in the datastore is specified along with the name
> >of the action and the input parameters.
> >  
> > Regards,
> > Reshad.
> >  
> > From: netmod  on behalf of "Sterne, Jason
> > (Nokia - CA/Ottawa)" 
> > Date: Thursday, April 30, 2020 at 11:08 AM
> > To: "netmod@ietf.org" 
> > Subject: [netmod] YANG action not allowed at root?
> >  
> > Hi all,
> >  
> > I was a bit surprised to find this in section 7.15 of 7950 recently:
> >  
> >Since an action cannot be defined at the top level of a module or in
> >a "case" statement, it is an error if a grouping that contains an
> >action at the top of its node hierarchy is used at the top level of a
> >module or in a case definition.
> >  
> > I realize that actions can be placed down in a schema tree (i.e. sit
> > in the context of a container or list), but why is it phrased that
> > they *must* be in a container?
> >  
> > RPCs are limited to being at the root. I would have thought actions
> > could be anywhere (root or down in the tree).
> >  
> > Jason
> >  
> >  
> > ___
> > netmod mailing list
> > netmod@ietf.org
> > https://www.ietf.org/mailman/listinfo/netmod
> 
> ___
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod
___
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod


Re: [netmod] YANG action not allowed at root?

2020-05-05 Thread Christian Hopps
An action is defined as being something bound to a node. Talking about actions 
that aren't bound to a node is talking about RPCs AFAICT. In the server it just 
comes down to passing the bound node data in to the function or not. Defining 
"unbound actions" to replace RPCs is just different syntax for the same thing, 
right? Having 2 ways to do the same thing wouldn't help make servers easier to 
implement (it would do the opposite actually).

Thanks,
Chris.

> On Apr 30, 2020, at 11:50 AM, Sterne, Jason (Nokia - CA/Ottawa) 
>  wrote:
> 
> Yes - the intent was to address the limitation that an RPC can only be at 
> root. Actions can be out in a tree & nicely associated with something (e.g. 
> instead of having a pile of flat RPCs with long names that encode containers 
> like reset-www-xxx-yyy-zzz-entity).
>  
> But I don't really understand why we limited actions from being at the root. 
> It prevents a strategy of implementing all operations in a server (some of 
> which may be desirable at root for various reasons, some of which may be 
> desirable in the tree) as actions.
>  
> Why not allow this?
>  
>module bar {
>  action do-stuff {
>input {
>  leaf iterations {
>type uint8;
>   }
> }
>  } 
>} 
>} 
>  
> Which could be called from NETCONF like this:
>  
> xmlns="urn:ietf:params:xml:ns:netconf:base:1..0">
>
>  
>5
>  
>
>  
>  
>  
> Jason
>  
> From: Reshad Rahman (rrahman)  
> Sent: Thursday, April 30, 2020 11:31 AM
> To: Sterne, Jason (Nokia - CA/Ottawa) ; 
> netmod@ietf.org
> Subject: Re: [netmod] YANG action not allowed at root?
>  
> I don’t know the history on this but the intent is to have action tied to a 
> data node.
>  
> https://tools.ietf.org/html/rfc7950#section-7.15
>The difference between an action and an rpc is that an action is tied
>to a node in the datastore, whereas an rpc is not.  When an action is
>invoked, the node in the datastore is specified along with the name
>of the action and the input parameters.
>  
> Regards,
> Reshad.
>  
> From: netmod  on behalf of "Sterne, Jason (Nokia - 
> CA/Ottawa)" 
> Date: Thursday, April 30, 2020 at 11:08 AM
> To: "netmod@ietf.org" 
> Subject: [netmod] YANG action not allowed at root?
>  
> Hi all,
>  
> I was a bit surprised to find this in section 7.15 of 7950 recently:
>  
>Since an action cannot be defined at the top level of a module or in
>a "case" statement, it is an error if a grouping that contains an
>action at the top of its node hierarchy is used at the top level of a
>module or in a case definition.
>  
> I realize that actions can be placed down in a schema tree (i.e. sit in the 
> context of a container or list), but why is it phrased that they *must* be in 
> a container?
>  
> RPCs are limited to being at the root. I would have thought actions could be 
> anywhere (root or down in the tree).
>  
> Jason
>  
>  
> ___
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod

___
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod


Re: [netmod] YANG action not allowed at root?

2020-05-04 Thread Balázs Lengyel
Hello Jason,

I was the original advocate of actions.

At that point I had to fight to get actions into YANG at all. So I had to 
emphasize why they are different, why they are better. Replacing rpcs would 
have been a no go from the start.

Also some people might have an aversion towards having 2 ways to do the same 
thing.

In my world we avoid top level actions/rpcs altogether, so it was not important 
for me.

But truly, these are not really strong arguments against top level actions.

Regards Balazs

 

From: netmod  On Behalf Of Sterne, Jason (Nokia - 
CA/Ottawa)
Sent: 2020. április 30., csütörtök 17:51
To: Reshad Rahman (rrahman) ; netmod@ietf.org
Subject: Re: [netmod] YANG action not allowed at root?

 

Yes - the intent was to address the limitation that an RPC can only be at root. 
Actions can be out in a tree & nicely associated with something (e.g. instead 
of having a pile of flat RPCs with long names that encode containers like 
reset-www-xxx-yyy-zzz-entity).

 

But I don't really understand why we limited actions from being at the root. It 
prevents a strategy of implementing all operations in a server (some of which 
may be desirable at root for various reasons, some of which may be desirable in 
the tree) as actions.

 

Why not allow this?

 

   module bar {

 action do-stuff {

   input {

 leaf iterations {

   type uint8;

  }

}

 } 

   } 

   } 

 

Which could be called from NETCONF like this:

 

 

   

 

   5

 

   

 

 

 

Jason

 

From: Reshad Rahman (rrahman) mailto:rrah...@cisco.com> > 
Sent: Thursday, April 30, 2020 11:31 AM
To: Sterne, Jason (Nokia - CA/Ottawa) mailto:jason.ste...@nokia.com> >; netmod@ietf.org <mailto:netmod@ietf.org> 
Subject: Re: [netmod] YANG action not allowed at root?

 

I don’t know the history on this but the intent is to have action tied to a 
data node.

 

https://tools.ietf.org/html/rfc7950#section-7.15

   The difference between an action and an rpc is that an action is tied

   to a node in the datastore, whereas an rpc is not.  When an action is

   invoked, the node in the datastore is specified along with the name

   of the action and the input parameters.

 

Regards,

Reshad.

 

From: netmod < <mailto:netmod-boun...@ietf.org> netmod-boun...@ietf.org> on 
behalf of "Sterne, Jason (Nokia - CA/Ottawa)" < <mailto:jason.ste...@nokia.com> 
jason.ste...@nokia.com>
Date: Thursday, April 30, 2020 at 11:08 AM
To: " <mailto:netmod@ietf.org> netmod@ietf.org" < <mailto:netmod@ietf.org> 
netmod@ietf.org>
Subject: [netmod] YANG action not allowed at root?

 

Hi all,

 

I was a bit surprised to find this in section 7.15 of 7950 recently:

 

   Since an action cannot be defined at the top level of a module or in

   a "case" statement, it is an error if a grouping that contains an

   action at the top of its node hierarchy is used at the top level of a

   module or in a case definition.

 

I realize that actions can be placed down in a schema tree (i.e. sit in the 
context of a container or list), but why is it phrased that they *must* be in a 
container?

 

RPCs are limited to being at the root. I would have thought actions could be 
anywhere (root or down in the tree).

 

Jason

 

 



smime.p7s
Description: S/MIME cryptographic signature
___
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod


Re: [netmod] YANG action not allowed at root?

2020-04-30 Thread Sterne, Jason (Nokia - CA/Ottawa)
Yes - the intent was to address the limitation that an RPC can only be at root. 
Actions can be out in a tree & nicely associated with something (e.g. instead 
of having a pile of flat RPCs with long names that encode containers like 
reset-www-xxx-yyy-zzz-entity).

But I don't really understand why we limited actions from being at the root. It 
prevents a strategy of implementing all operations in a server (some of which 
may be desirable at root for various reasons, some of which may be desirable in 
the tree) as actions.

Why not allow this?

   module bar {
 action do-stuff {
   input {
 leaf iterations {
   type uint8;
  }
}
 }
   }
   }

Which could be called from NETCONF like this:

 
   
 
   5
 
   
 


Jason

From: Reshad Rahman (rrahman) 
Sent: Thursday, April 30, 2020 11:31 AM
To: Sterne, Jason (Nokia - CA/Ottawa) ; netmod@ietf.org
Subject: Re: [netmod] YANG action not allowed at root?

I don’t know the history on this but the intent is to have action tied to a 
data node.

https://tools.ietf.org/html/rfc7950#section-7.15
   The difference between an action and an rpc is that an action is tied
   to a node in the datastore, whereas an rpc is not.  When an action is
   invoked, the node in the datastore is specified along with the name
   of the action and the input parameters.

Regards,
Reshad.

From: netmod mailto:netmod-boun...@ietf.org>> on 
behalf of "Sterne, Jason (Nokia - CA/Ottawa)" 
mailto:jason.ste...@nokia.com>>
Date: Thursday, April 30, 2020 at 11:08 AM
To: "netmod@ietf.org<mailto:netmod@ietf.org>" 
mailto:netmod@ietf.org>>
Subject: [netmod] YANG action not allowed at root?

Hi all,

I was a bit surprised to find this in section 7.15 of 7950 recently:

   Since an action cannot be defined at the top level of a module or in
   a "case" statement, it is an error if a grouping that contains an
   action at the top of its node hierarchy is used at the top level of a
   module or in a case definition.

I realize that actions can be placed down in a schema tree (i.e. sit in the 
context of a container or list), but why is it phrased that they *must* be in a 
container?

RPCs are limited to being at the root. I would have thought actions could be 
anywhere (root or down in the tree).

Jason


___
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod


Re: [netmod] YANG action not allowed at root?

2020-04-30 Thread Reshad Rahman (rrahman)
I don’t know the history on this but the intent is to have action tied to a 
data node.

https://tools.ietf.org/html/rfc7950#section-7.15
   The difference between an action and an rpc is that an action is tied
   to a node in the datastore, whereas an rpc is not.  When an action is
   invoked, the node in the datastore is specified along with the name
   of the action and the input parameters.

Regards,
Reshad.

From: netmod  on behalf of "Sterne, Jason (Nokia - 
CA/Ottawa)" 
Date: Thursday, April 30, 2020 at 11:08 AM
To: "netmod@ietf.org" 
Subject: [netmod] YANG action not allowed at root?

Hi all,

I was a bit surprised to find this in section 7.15 of 7950 recently:

   Since an action cannot be defined at the top level of a module or in
   a "case" statement, it is an error if a grouping that contains an
   action at the top of its node hierarchy is used at the top level of a
   module or in a case definition.

I realize that actions can be placed down in a schema tree (i.e. sit in the 
context of a container or list), but why is it phrased that they *must* be in a 
container?

RPCs are limited to being at the root. I would have thought actions could be 
anywhere (root or down in the tree).

Jason


___
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod