Skip to content

YDK-gen to provide a way to recover the default value of a leaf programmatically #1025

@valeriodigregorio

Description

@valeriodigregorio

Expected Behavior

In example for Python I can see that Cisco_IOS_XE_wireless_wlan_cfg.WlanCfgData.WlanCfgEntries.WlanCfgEntry.__doc__ contains indication of default value for each leaf:

            .. attribute:: wpa1_enabled
            
            	Configures WPA1 support
            	**type**\: bool
            
            	**default value**\: false

I would expect the user to be able to programmatically recover that value, in example like:

Cisco_IOS_XE_wireless_wlan_cfg.WlanCfgData.WlanCfgEntries.WlanCfgEntry.get_yang_default_value("wpa1_enabled")

That should also return the right type and eventually support enums.

Note that querying some devices via Netconf may not return indication of config/oper for leafs that are set to a default value.

Current Behavior

It's impossible to recover the default value programmatically.

Steps to Reproduce

Try to print the default value of a leaf.

Your Script

There's no way to do this.

Logs

N/A

System Information

YDK 0.8.4

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions