"Dale R. Worley" <[email protected]> writes: > Balazs Lengyel <[email protected]> writes: >> Problem: how do you restrict values for (3) - file-compression so that >> it is one of the nodes-supported-compression-types. The natural solution >> would be to use a must expression or a leaf-ref, but as >> nodes-supported-compression-types is config-false data, it is not >> allowed to constrain the config=true leaf, file-compression, with it. > > I'm no expert at this, but it seems to me that the way to do it is to > have the overall data structure be config-true but make the contained > supported-compression-types be config-false. You can nest config-false > nodes in a config-true structure. The Yang would be something like > this: > > typedef Compression-Method { > ... > } > > list node { > config true; > key name; > > string name; > > leaf-list supported-compression-methods { > type Compression-Method; > config false; > } > > Compression-Method compression-method; > must "compression-method ... supported-compression-methods"; > }
I think this is a good idea. It would have to be done on ad hoc basis but, on the other hand, not all enumerations permit implementations to choose a subset of enums. The only technical problem with your mock-up is that "must" expressions on config nodes cannot refer to state data. Lada > > Dale > > _______________________________________________ > 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
