lyd_parse_op help required, #2272
Answered
by
michalvasko
srikanths1
asked this question in
Q&A
-
Hi, Below is our sample yang file module cmAgent {
namespace "http://cmAgent/ns/cmAgent";
prefix "cm";
container day1-data {
description "Information about the system";
leaf available {
type boolean;
default false;
description "day1 data available";
}
}
notification commit {
description "Notification sent when a commit operation occurs after day1 data is pushed.";
leaf message {
type string;
}
}
} and for get rpc, we have below reply, <get xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<data>
<day1-data xmlns="http://cmAgent/ns/cmAgent">
<available>false</available>
</day1-data>
</data>
</get> we are trying to to lyd_parse on the output to get leaf available, but facing below issue,
we need help in identifying what is the problem we are doing, struct ly_in *in;
ly_in_new_filepath("/tmp/rp.xml", 0, &in);
struct lyd_node *tree, *node;
struct ly_set *set;
printf("parsing data now \n");
// parse data
rc=lyd_parse_op(ctx, NULL, in, LYD_XML, LYD_TYPE_RPC_YANG, &tree, &node); |
Beta Was this translation helpful? Give feedback.
Answered by
michalvasko
Jul 29, 2024
Replies: 1 comment 2 replies
-
Just fix the error, the module with this namespace is |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In this code you have loaded only
cmAgent.yang
, no other module. So do as I said and it should work.