Thank @mnovak, you are right. It’s not enabled in our confd.conf. After it is enabled, Query API is supported now. But the query result is not what I expect. Sounds like the and are not set correctly. But I don’t know how to fill out these two nodes. Please help me. Thanks.
The snippet of yang data model is as below:
==ietf-interfaces.yang
container interfaces {
list interface {
key "name";
leaf name {
type string;
}
leaf description {
type string;
}
leaf type {
type identityref {
base interface-type;
}
mandatory true;
description
"The type of the interface.
}
leaf enabled {
type boolean;
default "true";
}
leaf link-up-down-trap-enable {
if-feature if-mib;
type enumeration {
enum "enabled" {
value 1;
}
enum "disabled" {
value 2;
}
}
} // list interface
} // container interfaces
===ethernet-std.yang
augment /if:interfaces/if:interface {
// Ethernet Interface Config Object List
when "if:type = 'eth-std:ethernetCsmacd'";
container ethernet{
leaf mtu {
type exa:IF_MTU;
description "Ethernet port MTU";
tailf:info "Ethernet port MTU";
default "2000";
}
...
...
...
} // ethernet
}
augment /if:interfaces/if:interface/eth-std:ethernet {
list vlan {
key "vlan-id";
leaf vlan-id{
description "VlanId (range: 1-4094)";
type string;
}
list policy-map {
...
...
...
}
list c-vlan{
...
...
...
}
list match-vlan{
...
...
...
}
...
...
...
}
}
Now there are 996 vlan instances under /interfaces/interface [name=‘1/1/x4’]/ethernet,
and lots of match-vlan, polic-map under /interfaces/interface [name=‘1/1/x4’]/ethernet/vlan,
But when I send Query API , the confd only return the top leaf nodes and then return “no more data”. Please see below quest and response.
==start-query
<rpc message-id="m-51" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<start-query xmlns="http://tail-f.com/ns/netconf/query">
<foreach>/interfaces/interface[name='1/1/x4']</foreach>
<select><expression>/interfaces/interface[name='1/1/x4']</expression><result-type>inline</result-type></select>
<limit>100</limit>
<offset>1</offset>
</start-query>
</rpc>
]]>]]>
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-51"><query-handle xmlns="http://tail-f.com/ns/netconf/query">4</query-handle>
</rpc-reply>]]>]]>
==fetch-query-result only gets 3 leaf nodes
> <rpc message-id="m-51" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
> <fetch-query-result xmlns="http://tail-f.com/ns/netconf/query"> <query-handle>4</query-handle> </fetch-query-result></rpc>]]>]]>
> <?xml version="1.0" encoding="UTF-8"?>
> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-51"><query-result xmlns="http://tail-f.com/ns/netconf/query">
> <result>
> <select>
> <data>
> <name xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">1/1/x4</name>
> <type xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces" xmlns:eth-std="http://www.calix.com/ns/ethernet-std">eth-std:ethernetCsmacd</type>
> <link-up-down-trap-enable xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">disabled</link-up-down-trap-enable></data>
> </select>
> </result>
> </query-result>
> </rpc-reply>]]>]]>
==fetch-query-result again and only confd returns no-more-data.
<rpc message-id="m-51" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<fetch-query-result xmlns="http://tail-f.com/ns/netconf/query"> <query-handle>4</query-handle> </fetch-query-result></rpc>]]>]]>
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-51"><query-result xmlns="http://tail-f.com/ns/netconf/query">
<result>
<no-more-data/>
</result>
</query-result>
</rpc-reply>]]>]]>
Please give me some directions to solve this issue. Much appreciated.