Retreiving possible values for leaf through WEBUI

Hi Team,

In WebUI, I am trying to get the possible values for the leaf of a list.

In Yang, the respective leaf is defined as leafref and the path to the leaf ref have set of predefined values loaded from xml.

I am trying to use the same leafref path to feed the input to same leaf of list through WEBUI.

In get_schema API, I am giving the path as same leafref path defined in yang file. But webui unable to retrieve the possible values.

I am able to see the values while feeding input through cli for same leaf

Thanks in advance,
Banumoorthy M

You can use the get_leafref_values JSON-RPC API call to get all possible values for a leaf with a leafref type.

The man page for get_leafref_values can be found in Chapter 19.7, Methods - data - leafref, of the ConfD 6.1 User Guide. It is listed below for your convenience:

Method get_leafref_values

    Gets all possible values for a leaf with a leafref type

    {"th": <number>,
     "path": <string>,
     "skip_grouping": <boolean, default: false>,
     "keys": <array of string>}

     The th param is as returned from a call to new_read_trans or new_write_trans. The path param is a keypath pointing to a leaf with a leafref type.

     The skip_grouping param is by default set to false and is only needed to be set to true if if a set of sibling leafref leafs points to a list instance with multiple keys and if get_leafref_values should return an array of possible leaf values instead an array of arrays with possible key value combinations.

     The keys param is an optional array of values that should be set if a more than one leafref statement is used within action input parameters and if they refer to each other using `deref()` or `current()` XPath functions.

    {"values": <array of string>,
     "source": <string>}

    The source param will point to the keypath where the values originate.

Hi Wai,

It worked for us!!!

Thank you very much.

Thanks once again,