Subject: [yang-doctors] Clarification on YANG Schema Node Identifiers (wrt RPCs)

From: Abhinava Shivakumar Sadasivarao <[email-masked]>
Date: Tue, 28 Aug 2018 04:04:00 +0000

Hello!

I had a question on YANG schema node identifiers as defined in the RFC 6020 (Section 6.5<https://tools.ietf.org/html/rfc6020#section-6.5>). As per the RFC:

A schema node identifier is a string that identifies a node in the schema tree.  It has two forms, "absolute" and "descendant", defined by the rules "absolute-schema-nodeid" and "descendant-schema-nodeid" in Section 12, respectively. A schema node identifier consists of a path of identifiers, separated by slashes ("/"). In an absolute schema node identifier, the first identifier after the leading slash is any top-level schema node in the local module or in all imported modules.

References to identifiers defined in external modules MUST be qualified with appropriate prefixes, and references to identifiers defined in the current module and its submodules MAY use a prefix. For example, to identify the child node "b" of top-level node "a", the string "/a/b" can be used.

My question is, can identifiers (absolute or otherwise) include nodes defined either in the input or output blocks of an RPC? From the example RPC<https://tools.ietf.org/html/rfc6020#section-7.13.5> in the RFC 6020:

        rpc rock-the-house {
             input {
                 leaf zip-code {
                     type string;
                 }
             }
         }

Can "/rock-the-house/input/zip-code" be considered a schema identifier, given the above description and the YANG grammar?
Section 7.13<https://tools.ietf.org/html/rfc6020#section-7.13> describes that the "rpc" statement defines an rpc node in the schema tree. So I would think the answer to the question is "Yes".

Thanks!
Abhinava