On Tue, Aug 16, 2016 at 8:25 AM, Ladislav Lhotka <[email protected]> wrote:
> > > On 16 Aug 2016, at 14:54, Radek Krejčí <[email protected]> wrote: > > > > Dne 16.8.2016 v 14:36 Martin Bjorklund napsal(a): > >> Radek Krejčí <[email protected]> wrote: > >>> Hi all, > >>> I'm not sure what is actually the default value in leaf-list if there > >>> are multiple default statements. Is it each of the values defined as > >>> default or the set of default values together? My point is, in case of > >>> NETCONF with-defaults capability, when the leaf-list instance is > >>> supposed to be marked as default (report-all-tagged retrieval mode) - > >>> when it contains one of the values defined as default or only when > >>> there is a complete set of default values (and in case of user-ordered > >>> leaf-list, when they are in correct order)? > >> > >> 6020bis says: > >> > >> If a leaf-list has one or more "default" statement, the leaf-list's > >> default values are the values of the "default" statements, and if the > >> leaf-list is user-ordered, the default values are used in the order of > >> the "default" statements. > >> > >> Doesn't this answer your questions? > > > > no, it doesn't - the "leaf-list's default values are" indicates that > there can be multiple default values for the leaf-list. So each of the > default statement defines one of the leaf-list's default values. But the > second part refers to the default values to be used together, as a set. I > think that it makes better sense to use the leaf-list's default value as a > set, but that first sentence confuses me. > > leaf-list foo { > type string; > default "zig"; > default "zag"; > } > > The default content is the sequence of values taken from all "default" > statements, i.e. in JSON encoding it is > > "foo": ["zig", "zag"] > > Or the server could return ["zag", "zig"] because this is an ordered-by system leaf-list. Let's say the client sets foo to the value "zag". If the server basic-mode=explicit, then foo = [ "zag" ] and foo is not a default. But if the basic-mode=trim, then there was no node created, so foo is still a default ["zig", "zag"]. Is this correct? What matches the YANG default for this node in with-defaults trim mode? 1) ["zig", "zag"] 2) ["zig"] and ["zag"] Andy > Lada > > > > > Radek > > > >> > >> /martin > > > > > > _______________________________________________ > > netmod mailing list > > [email protected] > > https://www.ietf.org/mailman/listinfo/netmod > > -- > Ladislav Lhotka, CZ.NIC Labs > PGP Key ID: E74E8C0C > > > > > _______________________________________________ > netmod mailing list > [email protected] > https://www.ietf.org/mailman/listinfo/netmod >
_______________________________________________ netmod mailing list [email protected] https://www.ietf.org/mailman/listinfo/netmod
