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
Params
{"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.
Result
{"values": <array of string>,
"source": <string>}
The source param will point to the keypath where the values originate.