"Bogaert, Bart (Nokia - BE)" <[email protected]> wrote: > Hi I have a question about the usage of if-feature. Assume the following > YANG module: > > > > module performance-management { > > namespace "http://www.example.com/performance-management"; > > prefix if-pm; > > > > import ietf-interfaces { > > prefix if; > > } > > > > feature performance-24hr { > > description > > "Indicates that collection of 24 hour performance intervals > > is supported"; > > } > > > > augment "/if:interfaces-state/if:interface" { > > description > > "Data nodes for the performance status parameters"; > > > > container performance { > > description > > "Performance parameters"; > > > > container intervals-24hr { > > if-feature performance-24hr; > > description > > "24 hour interval performance history"; > > > > container current { > > description > > "Contains the counts that are currently accumulating."; > > } > > > > list history { > > key interval-number; > > max-elements 7; > > description > > "A history of 24 hour intervals."; > > > > leaf interval-number { > > type uint16; > > description > > "The number of the interval relative to the current > > interval."; > > } > > } > > } > > } > > } > > } > > > > Another YANG module augments the container which is defined under a feature. > > > > module use-performance-management { > > yang-version 1.1; > > namespace "http://www.example.com/use-performance-management"; > > prefix use-pm; > > > > import ietf-interfaces { > > prefix if; > > } > > > > import performance-management { > > prefix if-pm; > > } > > > > augment '/if:interfaces-state/if:interface/if-pm:performance/' > > + 'if-pm:intervals-24hr/if-pm:current' { > > description > > "Augment the current 24 hour interface performance counts with > > Ethernet specific attributes."; > > > > container ethernet { > > description > > "Current 24 hour Ethernet performance counters."; > > leaf some-value { > > type uint32; > > } > > } > > } > > } > > > > According to me an if-feature statement is missing here: how can a module > augment a container defined under the 'restriction" of a feature. If the > feature is not supported then the container is not there and hence one can't > augment that container in another YANG module. Is my understanding correct?
Note that "support a feature" is a run-time property, whereas the augmentation happens at design-time. If a server doesn't support the feature, it will not support the container, and thus not support anything in the schema below that container (added via augmentation or not). /martin _______________________________________________ netmod mailing list [email protected] https://www.ietf.org/mailman/listinfo/netmod
