Subject: [netmod] Augment non-existing input?

From: Robert Varga <[email-masked]>
Date: Tue, 4 Oct 2016 13:55:28 +0200

Hello,

I would like to ask about interoperability of RPC's input statement and
augments. Given two modules:

module foo {
    rpc foo {
        output {
            leaf foo { type string; }
        }
    }
}

module bar {
    import foo { prefix foo; }

    augment /foo:foo/input {
        leaf bar { type string; }
    }
}

Should the augment statement trigger a failure or not?

My take is that it should fail, as the lack of an empty input statement
in foo indicates the author's intent that the RPC should not have an
extensible input...

Thanks,
Robert

---

From: Ladislav Lhotka <[email-masked]>
Date: Tue, 4 Oct 2016 14:08:24 +0200

Hi Robert,

> On 04 Oct 2016, at 13:55, Robert Varga <[email-masked]> wrote:
> 
> Hello,
> 

Sec. 7.14 says:

   The "rpc" statement defines an rpc node in the schema tree.  Under
   the rpc node, a schema node with the name "input" and a schema node
   with the name "output" are also defined.

This seems to be independent of whether "input" and "output" statements are present, so I believe your example is valid.

Lada

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

--
Ladislav Lhotka, CZ.NIC Labs
PGP Key ID: E74E8C0C

---

From: "Jernej Tuljak" <[email-masked]>
Date: Tue, 4 Oct 2016 14:17:03 +0200

> -----Original Message-----
> From: netmod [mailto:[email-masked]] On Behalf Of Robert
> Varga
> Sent: Tuesday, October 4, 2016 1:55 PM
> To: [email-masked]
> Subject: [netmod] Augment non-existing input?
> 
> Hello,
> 

It would would be an error because there is no "input" list/container from bar's namespace present in the target module. What you probably meant is:

augment /foo:foo/foo:input {}

which is perfectly fine. The "input" schema node is inherently present within an "rpc" schema node even if not explicitly defined. Both in YANG 1 and 1.1. 

   The "rpc" statement defines an rpc node in the schema tree.  Under
   the rpc node, a schema node with the name "input", and a schema node
   with the name "output" are also defined.  The nodes "input" and
   "output" are defined in the module's namespace.

Jernej