module yangcli-ex {

  namespace
    "http://yuma123.org/ns/yangcli-ex";
  prefix "yangcli-ex";

  import yangcli { prefix yc; }
  import yuma-ncx { prefix ncx; }

  organization
    "Yuma123";

  contact
    "Vladimir Vassilev <mailto:vladimir@transpacket.com>";

  description
    "This module contains extra parameters for yangcli";

  revision 2018-08-08 {
    description
      "Reduced descripiton statement line length.";
  }

  grouping ConnectParmsEx {
    description
      "Common extended parms for connecting to a NETCONF server.
       Used by the connect operation and if present at
       the command line invocation, then the connect
       operation will be invoked automatically.";

    leaf dump-session {
      description
        "Filespec base for dumping the raw netconf
         traffic data and timestamp information. Example:
         --dump-session=<base> The following files are created:
          * <base>out - session data sent to server
          * <base>in - session data received from server
          * <base>out.ts - timestamp-tee formated output transactions report
          * <base>in.ts - timestamp-tee formated input transactions report
          ";
         type string;
    }
  }

  augment "/yc:yangcli" {
    description
      "Adds extra parameters to yangcli.";

    leaf keep-session-model-copies-after-compilation {
      description
        "Controls if temporary session model copies are kept
         after compilation in ~/.yuma/tmp/<>/<sid> until yangcli
         is terminated.";
      type boolean;
      default false;
    }
    uses ConnectParmsEx;
  }

  augment "/yc:connect/yc:input" {
    description
      "Adds extra parameters to connect.";

    uses ConnectParmsEx;
  }

  rpc clear-counters {
    description 
      "Convenience function that allows the user to 'clear' all counters
       under the specified target path. The function performs <get>
       with the specified target and updates a copy of all the
       yang:counter32 and yang:counter64 values in a tree that is later
       used to subtract the stored values from the data returned with
       xget.
        
         * Example:
           yangcli>  clear-counters /interfaces-state/interface/statistics
           yangcli>  xget /interfaces-state/interface/statistics
       ";
    input {
      ncx:default-parm select;
      leaf select {
        description
          "The XPath expression to use in the retrieval
           operation.  The string may only contain
           single quotes, which are required for
           string literals.  The entire string
           will be inserted into a double-quoted
           string, within the get-config PDU.
           Character entities will be inserted as
           needed to maintain well-formed XML.";
           type string { length "1..max"; }
           ncx:xpath;
      }
    }
  }
}
