Now I am working on a list nodes with two keys: key “node-type node-id”, then use xml file to create a new entry of nodes, in which the leafs appear in different order: node-id precedes by node-type. But the result fails with the following error message:
< error-message xml:lang=“en”>expected tag: ‘node-type’, got tag: 'node-id’node-type< /bad-element>
It works when I change the order of leafs according to the order in the key statement. In a reality scenario, I have a yang with the key of five leafs and it’s inconvenient to always keep order in mind. So is it possible to let confd ignore keys ordering in xml in such case?
The Yang File:
container ranges-multi {
list nodes {
config true;
key "node-type node-id";
leaf node-type {
type enumeration {
enum ethernet;
enum wireless;
enum optical;
enum coaxial;
}
}
leaf node-id {
type uint32;
}
leaf payload {
type string;
description "Dummy payload leaf to show callback invocations";
}
}
}
The XML file:
< edit-config>
< target>
< running/>
< /target>
< config>
< ranges-multi xmlns="https://tail-f.com/example/ranges-multi">
< nodes>
< node-id>4< /node-id>
< node-type>wireless< /node-type>
< payload>test< /payload>
< /nodes>
< /ranges-multi>
< /config>
< / edit-config>
The Error Message:
netconf> rpc ./xml/test_mkey1.xml
<? xml version='1.0' encoding='UTF-8'?>
< rpc-error xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
< error-type>application</error-type>
< error-tag>missing-element</error-tag>
< error-severity>error</error-severity>
< error-path xmlns:ranges-multi="https://tail-f.com/example/ranges-multi" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
/nc:rpc/nc:edit-config/nc:config/ranges-multi:ranges-multi/ranges-multi:nodes
</error-path><error-message xml:lang="en">expected tag: 'node-type', got tag: 'node-id'</error-message>< error-info><bad-element>node-type</bad-element>
< /error-info>
< /rpc-error>