On Thu, Aug 31, 2023 at 12:02:59PM +0000, tom petch wrote:
>
> <tp>
> The issue I come across, saw it again today in nrp-yang, is
>
> container interfaces
> list interface
> key interface
> leaf interface
>
> which I find clunky but do not have a good alternative for.
>
Surprising is the leaf interface. I know, we have multiple encodings
today, but back then we had XML and this translates into
<interfaces>
<interface>
<interface>x</interface>
</interface>
<interface>
<interface>y</interface>
</interfaces>
<interfaces>
RFC 8343 has
container interfaces {
list interface {
key "name";
}
leaf name;
}
which in XML becomes
<interfaces>
<interface>
<namex</name>
</interface>
<interface>
<name>y</name>
</interfaces>
<interfaces>
and initially NETCONF only had XML encodings. in JSON you get
something like this:
{
"interfaces": {
"interface": [
{
"name": "x"
},
{
"name": "y"
}
]
}
}
Perhaps what people find clunky is a function of which encoding they
are using. Perhaps it helps if people read 'list interfaces {}' as
"list of interfaces".
/js
--
Jürgen Schönwälder Constructor University Bremen gGmbH
Phone: +49 421 200 3587 Campus Ring 1 | 28759 Bremen | Germany
Fax: +49 421 200 3103 <https://constructor.university/>
_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod