Subject: [netmod] NMDA RPC/action validation

From: Michal Vaško <[email-masked]>
Date: Wed, 06 May 2020 10:13:15 +0200

Hi,
when we were implementing support for NMDA, we came across the section about actions and RPCs [1]. What I understood from it is that, effectively, all RPCs and actions are validated against the data in the operational datastore. So, for example, instance-identifiers and leafref targets in the RPC/action are searched for in the operational datastore. But I realized just now that I may have interpreted this short section in a wrong way and read between the lines.

Because while the section is named "Invocation of Actions and RPCs", no changes for RPCs are explicitly mentioned, I just assumed it does not really make sense for them to behave differently. Also, I basically interpreted "invocation" as validation because I am not sure how else to understand it. It would be best if these terms could be clarified but I am not sure it is possible since new errata is probably not the right way.

Thanks for clarifying this.

Regards,
Michal

[1] https://tools.ietf.org/html/rfc8342#section-6.2

---

From: Martin Björklund <[email-masked]>
Date: Wed, 06 May 2020 11:12:21 +0200 (CEST)

Michal Vaško <[email-masked]> wrote:
> Hi,
> when we were implementing support for NMDA, we came across the section
> about actions and RPCs [1]. What I understood from it is that,
> effectively, all RPCs and actions are validated against the data in
> the operational datastore. So, for example, instance-identifiers and
> leafref targets in the RPC/action are searched for in the operational
> datastore.

This is correct, but it is specified in section 6.1.

(Note that it applies to instance-identifiers and leafrefs defined as
rpc or action input parameters; not the contents of e.g. edit-config).

> But I realized just now that I may have interpreted this
> short section in a wrong way and read between the lines.
> 
> Because while the section is named "Invocation of Actions and RPCs",
> no changes for RPCs are explicitly mentioned, I just assumed it does
> not really make sense for them to behave differently. Also, I
> basically interpreted "invocation" as validation because I am not sure
> how else to understand it. It would be best if these terms could be
> clarified but I am not sure it is possible since new errata is
> probably not the right way.

Note that 6.2 says that it updates 7.15 of RFC 7950, which talks about
action invocation.  And also note that _validation_ is handled in 6.1.

The text in 6.2 says that if a server gets this action (from 7.15.3 in
RFC 7950):

     <rpc message-id="101"
          xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
       <action xmlns="urn:ietf:params:xml:ns:yang:1">
         <server xmlns="urn:example:server-farm">
           <name>apache-1</name>
           <reset>
             <reset-at>2014-07-29T13:42:00Z</reset-at>
           </reset>
         </server>
       </action>
     </rpc>

then the "server" with "name" "apache-1" must exist in the operational
state datastore.

/martin

> _______________________________________________
> netmod mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netmod

---

From: Michal Vaško <[email-masked]>
Date: Wed, 06 May 2020 12:00:16 +0200

Hi Martin,

right, I did not realize XPath context is also used for evaluating leafrefs or instance-identifiers and not just must or when. Okay, so my understanding is correct, thanks.

Regards,
Michal

On Wednesday, May 6, 2020 11:12 CEST, Martin Björklund <[email-masked]> wrote: 
 
> > leafref targets in the RPC/action are searched for in the operational> datastore.
>