CESNET / libnetconf

C NETCONF library
Other
113 stars 83 forks source link

rpc-reply for output leaf is throwing illegal state exception: Unknown child node detected #222

Closed pradyp11 closed 8 years ago

pradyp11 commented 8 years ago

@Hi, I'm using ODL as a Netopeer client and whenever i send a rpc request, it throws an error. ERROR:

"error-type": "application",
"error-tag": "operation-failed",
"error-message": "The operation encountered an unexpected error while executing.",
"error-info": "java.lang.IllegalStateException: Unknown child(ren) node(s) detected, identified by: (http://com/org/netopeer/connectivity)data, in: RPC Output output\n\tat

RPC:

 rpc connectivity-test-start {
    input {
        leaf key-chain {
            type string;
            description "mutually agreed key-chain";
        }
        leaf test-agent-ip {
            type inet:ip-address;
            description "single test agent IP address";
        }   
    }

    output {

        leaf config-result {
            type success-fail;
            description "results of the configuration operation";
        }
    }
  }  // end of rpc start

I user nc_reply_data_ns and nc_reply_custom for rpc-reply but still it is throwing the error.

rpc-reply with nc_reply_custom is :

<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="b7e6c900-6df1-11e6-8d3b-b8ca3ada4021">
<config-result>SUCCESS</config-result>
<rpc-reply>

The above result i can see it on Netconfc client but not on ODL.

Please provide me a solution to solve this.

Thank you pradeep

michalvasko commented 8 years ago

Hi Pradeep, it seems this feature is missing in libnetconf, support for user-defined RPCs. We only support the standard ones. However, all this is supported in the new generation of our tools, that is why we want to focus on them and not waste time on the old libnetconf. If you require it, you will have to add it yourself, we will gladly accept a patch.

Regards, Michal

pradyp11 commented 8 years ago

Thank you Michal. What are the new tools that supports user-defined RPCs?

michalvasko commented 8 years ago

Hi, for a working and usable software you will need libyang, libnetconf2, netopeer2, and finally also sysrepo. All of it is in different stages of development, so it is not recommended for normal use, but most standard features should work reliably.

Regards, Michal

pradyp11 commented 8 years ago

Thank you Michal. I Understand from the docs that Libnetconf2 does not support datastore implementation. I would like to know more about, how to implement the datastore for libnetconf2 and netopeer2?. Thank you.

On Fri, Sep 2, 2016 at 3:02 AM, michalvasko notifications@github.com wrote:

Hi, for a working and usable software you will need libyang https://github.com/CESNET/libyang, libnetconf2 https://github.com/CESNET/libnetconf2, netopeer2 https://github.com/CESNET/netopeer2, and finally also sysrepo https://github.com/sysrepo/sysrepo. All of it is in different stages of development, so it is not recommended for normal use, but most standard features should work reliably.

Regards, Michal

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/CESNET/libnetconf/issues/222#issuecomment-244299039, or mute the thread https://github.com/notifications/unsubscribe-auth/ASfz6jhDG_FEsLpG4t5syMpeHrQtbN6fks5ql8n3gaJpZM4Jvj6x .

michalvasko commented 8 years ago

Hi, you do not need to implement the datastore, sysrepo acts as one if you use netopeer2.

Regards, Michal

pradyp11 commented 8 years ago

Thank you for your quick response.

Thnx, pradeep

On Fri, Sep 2, 2016 at 9:52 AM, michalvasko notifications@github.com wrote:

Hi, you do not need to implement the datastore, sysrepo acts as one if you use netopeer2.

Regards, Michal

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/CESNET/libnetconf/issues/222#issuecomment-244380639, or mute the thread https://github.com/notifications/unsubscribe-auth/ASfz6hpRd1s5RzgmggOZXZS-ALJfv-kIks5qmCoPgaJpZM4Jvj6x .