I have scenario for processing operational data in which I will expect user to pass some arguments to Netconf request, based on that input arguments, I have to fetch data and respond to confd.
So, the flow is based on the key_path I will execute the required script which will respond with Json data. I will have to process this json data and respond to confd. This json will have repetitive lists, nested of nested lists etc.,
I tried rpc approach, but I doubt action_reply_values() function can it handle repetition of list data in my output.
Can someone help me is there any other better approach to consider for this scenario?
To me this sounds like you will have a YANG that represents some data structure that you would like to access with a NETCONF GET and the path to data is enough to indicate which data you want and therefore which script to call. This sounds like a standard data provider with a callpoint (that is your script). I think you can use on of the well understood examples like the ARP data provider (in C or python) to implement a different callpoint for each of the paths that you might have and that will give you enough control to go get the data with scripts and populate the NETCONF response (based on the YANG) that is being requested.
Hi @sbarvick,
The data I am trying to process has multiple nested structures, I have defined yang in the below format
container bgp-neighbor {
tailf:callpoint show-oper-cli;
list bgp-data {
key "ppeid";
leaf ppeid {
type string;
}
leaf nc{
type string;
mandatory true;
}
list neighbors {
key "neighbor";
leaf neighbor {
type string;
mandatory false;
}
... more leaves
list address-family {
key "address-family-name";
leaf address-family-name {
type string;
mandatory false;
}
.... more leaves & lists
}
}
}
}
I am using filters and I am able to receive the filters in my dataProvider script. we implemented this using arpe example on filters provided by confd.
Currently what happens is we are getting get_next_object() callback, we have received the filter but while processing the response, we are constructing confd_values for ppeid, nc and neighbors, here neighbor is a list so I am setting it’s value to C_NOEXISTS. I am not getting a next callback for neighbor. And in the logs I see that Nested-lists or leaf-lists not supported.
Is it like if we are using filters we will not be able to process the nested-lists. Because when I have implemented dataprovider without filters, I didn’t have any issue while processing nested-lists, I was getting an other call for nested_list immediately after sending C_NOEXISTS.
Are we missing something? or can you suggest something for this scenario.