+
+Testing User defined RPC
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+The NETCONF test-tool allows using custom RPC. Custom RPC needs to be defined in yang model provide to test-tool along
+with parameter ``--schemas-dir``.
+
+The input and output of the custom RPC should be provided with ``--rpc-config`` parameter as a path to the file containing
+definition of input and output. The format of the custom RPC file is xml as shown below.
+
+Start the device with following command:
+
+::
+
+ java -jar netconf/tools/netconf-testtool/target/netconf-testtool-1.7.0-SNAPSHOT-executable.jar --schemas-dir ~/test-schemas/ --rpc-config ~/tmp/customrpc.xml --debug=true
+
+Example YANG model file:
+
+::
+
+ module example-ops {
+ namespace "urn:example-ops:reboot";
+ prefix "ops";
+
+ import ietf-yang-types {
+ prefix "yang";
+ }
+
+
+ revision "2016-07-07" {
+ description "Initial version.";
+ reference "example document.";
+ }
+
+
+ rpc reboot {
+ description "Reboot operation.";
+ input {
+ leaf delay {
+ type uint32;
+ units "seconds";
+ default 0;
+ description
+ "Delay in seconds.";
+ }
+ leaf message {
+ type string;
+ description
+ "Log message.";
+ }
+ }
+ }
+ }
+
+
+Example payload (RPC config file customrpc.xml):
+
+::
+
+ <rpcs>
+ <rpc>
+ <input>
+ <reboot xmlns="urn:example-ops:reboot">
+ <delay>300</delay>
+ <message>message</message>
+ </reboot>
+ </input>
+ <output>
+ <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+ <ok/>
+ </rpc-reply>
+ </output>
+ </rpc>
+ </rpcs>
+
+
+
+Example of use:
+
+::
+
+ POST http://localhost:8181/restconf/operations/network-topology:network-topology/topology/topology-netconf/node/new-netconf-device/yang-ext:mount/example-ops:get-reboot-info
+
+If successful the command will return code 200.
+
+
+
+.. note::
+
+ A working example of user defined RPC can be found in TestToolTest.java class of the tools[netconf-testtool] project.
+
+