I have a requirement wherein I need to Set a default value for the leaf to 1 only.
leaf xId {
type uint32;
default 1;
description "Identifier for x feature";
}
This default value should be sent to application if not provided.
But I see that the received XML file in Application doesn’t have this tag.
How to ensure that this tag is received by application if the leaf value is not provided.
Thanks
Durga
See the defaultHandlingMode configuration parameter in confd.conf:
/confdConfig/defaultHandlingMode (explicit|trim|report-all) [explicit]
defaultHandlingModeType is either “explicit”, “trim”, or “report-all”. This parameter controls how default values for leafs are handled in the northbound interfaces.
explicit
If a value is set over a northbound interface, it is not considered default.
Default values are not displayed in northbound interfaces, unless asked for by the user.
trim
If a value is set over a northbound interface, it is considered default if it is equal to the data model’s default value.
Values equal to the data model’s default value are not displayed in northbound interfaces, unless asked for by the user.
report-all
All values are logically stored in the data store, and displayed in northbound interfaces.
If the data store has the capability to handle default values, which for example CDB has, it will work with all values for this parameter. In this case, default values are never actaully stored in the data store. The value of this parameter should be chosen to give the end-user the best experience.
If the data store does not have the capability to handle default values, this parameter should be set to ‘report-all’.