JSON-RPC Query CALL

Hello,

I am using JSON RPC Query for reading a multilevel yang file like the one below

container level1{
key name;
unique number;
leaf name {
type string;
}
leaf number {
type uint32;
mandatory true;
}
leaf enabled {
type boolean;
default true;
}
}

I assume this posting has been superseded by your other posting submitted under the [CDB and APIs] category with the title of “JSON RPC Query Call issue”. If not, please complete your question.

Yes I have another question … again related to JSON RPC…

If I have nested containers, what is the best way to get all the the leafs from all the containers for example

container 1 {
leaf1

Yes I have another question … again related to JSON RPC…
If I have nested containers, what is the best way to get all the the leafs from all the containers with key-value pairs… like a mib walk…
container 1 {
leaf1
container 2 {
leaf2
container 3 {
leaf 3
}
}
}

The best way is to use the query call and specify the path for container 1.

The best way is to provide the keypaths (/c1/leaf1, /c1/c2/leaf2, /c1/c2/c3/leaf3) to a series of get_value calls and their corresponding values will be returned with the key in the call itself and the value in the results.

You may also want to take a look at the get_schema call to dynamically discover the data elements in your YANG data model at runtime. This will allow you to read all of the leaf elements in your nested containers at runtime without knowing their actual structures at coding time.