Subject: [netmod] validating a YANG action

From: Andy Bierman <[email-masked]>
Date: Thu, 2 May 2019 16:15:28 -0700

Hi,

The text about invoking actions in RFC 7950, sec. 7.15 is not clear
about whether the ancestor data nodes have to exist.

sec 7.15.2, para 2:

   The <action> element contains a hierarchy of nodes that identifies
the node in the datastore.

The RFC does not say anything about if the data node is required to
exist or not.  There is no distinction between NP-container, P-container,
or list which are ancestors of the action node. It does not specify
which datastore, and that is not supplied in the <action> RPC.
The text specifies what must be in the <rpc> request, not in any datastore
or state data.

It seems like the intent is that no instance test is specified at all and
the corresponding ancestor nodes to the action node do not have to
exist for the action to be invoked. (The action may succeed or fail).
The issue is whether there is an existence-test before invoking the action.

Andy

---

From: Juergen Schoenwaelder <[email-masked]>
Date: Fri, 3 May 2019 07:57:24 +0200

> The issue is whether there is an existence-test before invoking the action.

We discussed actions during the work on NMDA. RFC 8342 has this text
in section 6, in particular 6.1 says:

   Actions are always invoked in the context of the operational state
   datastore.  The node for which the action is invoked MUST exist in
   the operational state datastore.

/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/>

---

From: Andy Bierman <[email-masked]>
Date: Fri, 3 May 2019 01:10:58 -0700

>    the operational state datastore.
This only applies to a server implementing NMDA.
There is no requirement for a server implementing RFC 7950 to make this
test.

Andy

---

From: Juergen Schoenwaelder <[email-masked]>
Date: Fri, 3 May 2019 11:20:12 +0200

> There is no requirement for a server implementing RFC 7950 to make this

Yes, the behavior is unspecified in RFC 7950. However, note that RFC
8342 formally updates RFC 7950 and the Introduction section says:

   This document updates RFC 7950 by refining the definition of the
   accessible tree for some XML Path Language (XPath) context (see
   Section 6.1) and the invocation context of operations (see
   Section 6.2).

This update may not affect your implementation but since you asked
whether there is an existence-test before invoking the action, I
thought a pointer to RFC 8342 is perhaps relevant.

/js

---

From: Andy Bierman <[email-masked]>
Date: Fri, 3 May 2019 09:43:44 -0700

> thought a pointer to RFC 8342 is perhaps relevant.
OK, but the update wrt/ action invocation is irrelevant unless the server
implements the <operational> datastore.

This NMDA requirement means that a server MUST implement the
operational values of config=true ancestor data nodes in order to
implement an action nested within configuration.

If the server does not implement these operational values,
and follows YANG library guidelines by omitting
these ancestor schema nodes from the schema for <operational>,
then the YANG action is not accessible on the server.

I don't think the YANG Library RFC makes it clear that an action must exist
in the schema for <operational> in order for it to be accessible. This
should
be confirmed and an errata posted if needed.

This also means that any mechanism which disables configuration and
therefore
removes the corresponding data nodes from <operational>, also disables any
actions within that configuration.

The keystore thread has already discussed the rather awkward procedures
for waiting and confirming that <operational> has synched with <running>
before being able to invoke an action.

Maybe YANG 1.2 can fix this mess, or maybe new protocol operations are
needed.

/js
Andy

---

From: Juergen Schoenwaelder <[email-masked]>
Date: Fri, 3 May 2019 18:53:45 +0200

On Fri, May 03, 2019 at 09:43:44AM -0700, Andy Bierman wrote:
> should be confirmed and an errata posted if needed.

I am not sure which text you propose or why YANG Library should say
something specific.

> therefore removes the corresponding data nodes from <operational>,
> also disables any actions within that configuration.

I think the model is that you invoke an action on an existing
resource.

> before being able to invoke an action.

Lets see what comes out of the discussion.

> Maybe YANG 1.2 can fix this mess, or maybe new protocol operations are

It is not clear yet to me what 'this mess' is and hence what needs fixing.

/js

---

From: Andy Bierman <[email-masked]>
Date: Fri, 3 May 2019 10:17:20 -0700

On Fri, May 3, 2019 at 9:53 AM Juergen Schoenwaelder <
[email-masked]> wrote:

> > > > > > The issue is whether there is an existence-test before invoking
> the
> > > > > action.
> > > > >
The "mess" is that NMDA declared an action is always invoked in
<operational>
and this creates extra implementation burdens and complexity for clients
and servers.

Andy