netconfcentral logo

yangcli-pro@2017-12-12



  module yangcli-pro {

    yang-version 1.1;

    namespace
      "http://yumaworks.com/ns/yangcli-pro";

    prefix yc;

    import ietf-yang-types {
      prefix yang;
    }
    import ietf-inet-types {
      prefix inet;
    }
    import yuma-ncx {
      prefix ncx;
    }
    import yuma-app-common {
      prefix ncxapp;
    }
    import yumaworks-types {
      prefix ywt;
    }
    import yumaworks-app-common {
      prefix ywapp;
    }
    import yumaworks-extensions {
      prefix ywx;
    }
    import yuma-types {
      prefix nt;
    }
    import yuma-netconf {
      prefix nc;
    }
    import yumaworks-restconf {
      prefix yrc;
    }

    organization "YumaWorks, Inc.";

    contact
      "Support <support@yumaworks.com>.";

    description
      "
        Command Line Interface for the NETCONF protocol: Client side

        Usage:
           yangcli-pro [parameters]
           yangcli-pro --help
           yangcli-pro --version

        Normal Mode:
           An interactive CLI shell with command line history.

        Autostart-mode:
           If the 'server' parameter is present, then yangcli-pro will
           attempt to connect to that server upon startup.  If the
           'user' and 'password' parameters are also present, then
           the user will not be prompted before the connection
           is attempted.  This parameter will be processed first,
           if script-mode or batch-mode is used.

        Script-mode:
           If the 'run-script' or 'run-command' parameter is present,
           then the specified script or command will be run
           automatically upon startup.

        Batch-mode:
           If the 'batch-mode' parameter is present, then either the
           'run-script' or 'run-command' parameter will be invoked, if
           present, and then the program will exit.  Any interactive
           input breaks in the script or command will be skipped.

     Copyright (c) 2010 - 2017 YumaWorks, Inc. All rights reserved.

     Redistribution and use in source and binary forms, with or
     without modification, is permitted pursuant to, and subject
     to the license terms contained in, the BSD 3-Clause License
     http://opensource.org/licenses/BSD-3-Clause";

    revision "2017-12-12" {
      description
        "Add CLI enum to display-mode.
          Add clear command.
          Add term-length parameter.
          Add terminal command.
          Add show terminal command.";
    }

    revision "2017-10-14" {
      description "Add action RPC.";
    }

    revision "2017-09-24" {
      description
        "Add no-aliases parameter.
          Add server-commands parameter.
          Add disable-command parameter.
          Add prompt-name parameter.";
    }

    revision "2017-09-12" {
      description
        "Add autoconfig-conf-mode parameter.";
    }

    revision "2017-08-12" {
      description
        "Add create parameter of user-cfg to create a new user.";
    }

    revision "2017-04-27" {
      description
        "Add with-ocpattern parameter.";
    }

    revision "2017-04-20" {
      description
        "Add show modules-state command.";
    }

    revision "2017-03-18" {
      description
        "Add callhome-user parameter.";
    }

    revision "2017-02-11" {
      description
        "Add RESTCONF entry-point parameter.
          Add callhome-enabled, callhome-address and callhome-port
          parameters.";
    }

    revision "2016-05-26" {
      description
        "Add auto-reconnect, auto-reconnect-interval, and
          auto-reconnect-max.";
    }

    revision "2016-03-17" {
      description
        "Add use-traceid parameter and variable.";
    }

    revision "2016-03-10" {
      description
        "Add autonvsave parameter and variable.
           Add nvsave command";
    }

    revision "2015-12-04" {
      description
        "Change target parameter to xpath1.0 to allow content-match
          expressions to be entered.
          Add device-cfg, devices-cfg, user-cfg,
          users-cfg CLI parameters.
          Add the leaf of device and userid to saved-sessions.
          Add autodevices and autousers parameter.
          Add auto-keepalive and  keepalive-interval.
          Add delete-all and remove-all operations.
          Add 'depth' parameter to sget, sget-config, xget,
          and xget-config commands.";
    }

    revision "2015-09-07" {
      description
        "Add encoding parameter to connect parameters";
    }

    revision "2015-07-07" {
      description
        "Add config-autosave CLI parameter.";
    }

    revision "2015-06-25" {
      description
        "Add transport tls parameter";
    }

    revision "2015-06-03" {
      description
        "Add value parameter to delete and remove commands";
    }

    revision "2015-01-08" {
      description
        "Add no-password leaf and make password part of
          pass choice. Add ask-password CLI parameter";
    }

    revision "2014-10-02" {
      description
        "Add select parameter to show running command.
          Add 'mandatory true' for stop-session command.";
    }

    revision "2014-09-18" {
      description
        "Add show running to show the entire configuration.
          Add show edit to display the subtree that is the current
          edit node.
          Add show diff to display the difference of the current config
          and edits that have not been applied yet.";
    }

    revision "2014-07-11" {
      description
        "Add tcp-ncx enum to the transport enumeration type.";
    }

    revision "2014-05-22" {
      description
        "Add show cache command. Add cache command.";
    }

    revision "2014-04-07" {
      description
        "Add check-output and check-replies CLI parameters.
          Add check-output-mode and check-replies-mode CLI parameters.
          Add use-session-vars CLI parameter.
          Add abstract objects for config mode help key support.
          Add session-vars and group-vars to the show command.
          Add vars struct to the saved-sessions struct.
          Add data template support.
          Add use-rawxml parameter.
          Add autoload-get, autoload-cache, autoload-save-cache
          parameters";
    }

    revision "2014-01-02" {
      description
        "Add show connected command.";
    }

    revision "2013-06-20" {
      description
        "Change defaults for --autonotif and --autoconfig
          from true to false. Add group command";
    }

    revision "2013-03-17" {
      description
        "Add message-indent parameter.
          Add config and exit commands.
          Add autoconfig CLI parameter.
          Fix bug in default sessions file name.
          Add prompt-type CLI parameter.
          Add config-edit-mode parameter.
          Add update-config command.
          Add start-session parameter to connect command.
          Add echo-notifs and echo-notif-loglevel CLI parameters.
          Add autonotif CLI parameter.
          Add session-name to connect a named session.
          Add connect-all to start all sessions in memory.
          Add record-test command.
          Move MatchParms to yumaworks-app-common.
          Add auto-test command.";
    }

    revision "2012-10-27" {
      description
        "Add run-unit-test operation
           Convert from yangcli to yangcli-pro
           Add sessions-cfg and session-cfg commands
           Added saved-sessions template for .conf file
           Added autosessions parameter
           Added start-session, stop-session commands
           Added start-rpc-timing, stop-rpc-timing commands.
           Added autotest, test-suite, session-cfg, session-cfg.";
    }

    revision "2011-10-10" {
      description
        "Add CLI parameters:
            --aliases-file
            --autoaliases
            --autouservars
            --uservars-file
            --home
          Add yangcli-pro local commands:
            alias
            aliases
            unset
            uservars
         ";
    }

    revision "2011-09-05" {
      description
        "Add 'json' to --display-mode enumerations.";
    }

    revision "2011-08-06" {
      description
        "Add --transport to ConnectParms grouping.";
    }

    revision "2011-07-19" {
      description
        "Add PublicKeyParms grouping.
          Added MatchParms (--match-names and --alt-names).
          Added --force-target parameter.
          Added show session command.
          Added --urltarget=<url> parameter to FillParms grouping
          to allow URL encoded requests to be converted to XPath
          before use.
          Added --use-xmlheader=<boolean> parameter to control
          how XML file variables are generated when written.";
    }

    revision "2011-06-05" {
      description
        "Added start-timer and stop-timer local RPC functions.
           Added --echo-replies parameter and system variable.
           Added --time-rpcs parameter and system variable
           Added remove command for base:1.1 support";
    }

    revision "2011-04-22" {
      description
        "Added --protocols parm via uses ProtocolsParm.
           Also allow setting --protocols in <connect> RPC.";
    }

    revision "2011-03-19" {
      description
        "Added 'xml-nons' display mode to display-mode parameter.
           Added 'cli' and 'system' to show command; subset of
           show vars.
           Changed history show default from -1 to 25.";
    }

    revision "2010-04-16" {
      description
        "Added eval command for XPath expression support";
    }

    revision "2010-01-14" {
      description
        "Initial published version for 0.9.9 release";
    }


    typedef LogCount {
      type int32 {
        range "-1 | 1 .. max";
      }
      description
        "Number of log entries. -1 means all entries";
    }

    typedef LogIndex {
      type uint32;
      description "Index into a log buffer.";
    }

    typedef TimerId {
      type uint8 {
        range "0 .. 15";
      }
      description
        "Identifier for a local timer to use with
           the start-timer and stop-timer commands.";
    }

    typedef YangcliVariableType {
      type enumeration {
        enum "session" {
          value 0;
          description
            "Session variable (for future use)";
        }
        enum "local" {
          value 1;
          description "Local user variable";
        }
        enum "config" {
          value 2;
          description
            "User configuration variable";
        }
        enum "global" {
          value 3;
          description "Global user variable";
        }
        enum "system" {
          value 4;
          description "System variable";
        }
        enum "queue" {
          value 5;
          description
            "System internal Queue variable";
        }
      }
      description
        "yangcli-pro user and system variable types";
    }

    typedef test-result-type {
      type enumeration {
        enum "skipped" {
          value 0;
          description "Test was skipped.";
        }
        enum "pass" {
          value 1;
          description "Test passed.";
        }
        enum "fail" {
          value 2;
          description "Test failed.";
        }
      }
      description
        "The unit test general result type.";
    }

    typedef IdentifierOrZero {
      type union {
        type nt:NcxIdentifier;
        type string {
          length "0";
        }
      }
      description
        "Indicates an identifier or empty string to use the
         schema or application defined default.";
    }

    typedef config-edit-mode-type {
      type enumeration {
        enum "line" {
          value 0;
          description
            "Automatically apply a config mode edit after
             each line";
        }
        enum "level" {
          value 1;
          description
            "Automatically apply a config mode edit when
             the current level is exited.";
        }
        enum "manual" {
          value 2;
          description
            "Only apply a config mode edit manually with
             the 'apply' command.";
        }
      }
      description
        "Specifies how edits will be applied in config mode.";
    }

    grouping SelectParm {
      leaf select {
        ncx:xpath;
        type string {
          length "1..max";
        }
        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.";
      }
    }  // grouping SelectParm

    grouping FillParms {
      choice target-parm {
        leaf target {
          type yang:xpath1.0 {
            length "1..max";
          }
          mandatory true;
          description
            "XPath target object to fill.  If prefixes are missing
              then the first match in any namespace will be used.
              Any prefix used must be the default prefix
              assigned to the desired YANG module. Prefix usage is
              optional.";
        }

        case urltarget-case {
          leaf urltarget {
            type ywt:UrlPath;
            mandatory true;
            description
              "URL encoded target object to fill.
                Encoding Rules: TBD.";
          }

          uses ywapp:MatchParms {
            description
              "These parameters are only supported for the
               'urltarget' parameter.";
          }
        }  // case urltarget-case
      }  // choice target-parm

      leaf optional {
        type empty;
        description
          "If present, then prompt for leafs that are optional.
            If not, skip these objects.";
      }

      anyxml value {
        description
          "Contains a string representing the content
            to use for the filled variable.

            If a string is entered, then the target value being
            filled must be a leaf or leaf-list.

            If a variable is referenced, then it will
            be used as the content, if the target value being
            filled is a leaf or a leaf-list.

            If the target value is a complex object,
            then the referenced variable must also be
            a complex object of the same type. E.g.,

            The global variable 'foo' would be specified as:

                value=$$foo

            The local variable 'bar' would be specified as:

                value=$bar

            An error will be reported if the global or local
            variable does not reference the same object type
            as the target parameter.";
      }
    }  // grouping FillParms

    grouping CommonPduParms {
      description
        "Common parms for some local commands that
             generate NETCONF PDUs";
      choice from {
        mandatory true;
        leaf varref {
          type string;
          description
            "Use the contents of the specified variable
                    as the content";
        }

        case from-cli {
          uses FillParms;
        }  // case from-cli
      }  // choice from
    }  // grouping CommonPduParms

    grouping EditParms {
      description
        "Common parms for create, merge, replace commands";
      uses CommonPduParms;

      leaf timeout {
        type nt:Timeout;
        description "Timeout to use";
      }
    }  // grouping EditParms

    grouping SGetParms {
      description
        "Common parms for sget and sget-config operations.";
      leaf nofill {
        type empty;
        description
          "If present, and the 'from-cli' option is used
             for input, then filling of mandatory nodes
             and key leafs will be skipped.  Instead, the target
             object will be treated as a terminating select node
             in the filter element.";
      }

      uses ncxapp:CliWithDefaultsParm;

      uses yrc:depth-parameter;
    }  // grouping SGetParms

    grouping XGetParms {
      description
        "Common parms for xget and xget-config operations.";
      choice from {
        mandatory true;
        leaf varref {
          type string;
          description
            "Use the contents of the specified variable
                    as the content";
        }

        case select {
          uses SelectParm;
        }  // case select
        leaf urltarget {
          type ywt:UrlPath;
          description
            "The URL path expression to use in the retrieval
                 operation.";
        }
      }  // choice from

      leaf timeout {
        type nt:Timeout;
        description "Timeout to use";
      }

      uses ncxapp:CliWithDefaultsParm;

      uses yrc:depth-parameter;

      uses ywapp:MatchParms {
        description
          "These parameters are ignored unless the
             'urltarget' parameter is also present.";
      }
    }  // grouping XGetParms

    grouping EntryPointParm {
      leaf entry-point {
        type string;
        description
          "RESTCONF entry point. Use this string instead of
             retrieving the XRD from the RESTCONF server to
             discover the entry point.";
      }
    }  // grouping EntryPointParm

    grouping SshKeyParms {
      leaf public-key {
        type string {
          length "1 .. max";
        }
        default "$HOME/.ssh/id_rsa.pub";
        description
          "Contains the file path specification
             for the file containing the client-side public key.
             If both 'public-key' and 'private-key' files are
             present, the client will attempt to connect
             to the server using these keys.  If this fails,
             or not done, then password authentication will
             be attempted.";
      }

      leaf private-key {
        type string {
          length "1 .. max";
        }
        default "$HOME/.ssh/id_rsa";
        description
          "Contains the file path specification
             for the file containing the client-side private key.
             If both 'public-key' and 'private-key' files are
             present, the client will attempt to connect
             to the server using these keys.  If this fails,
             or not done, then password authentication will
             be attempted.";
      }
    }  // grouping SshKeyParms

    grouping SslKeyParms {
      leaf ssl-fallback-ok {
        type boolean;
        default 'true';
        description
          "If true then an attempt to establish a plain TCP
              connection will be made if an SSL connection cannot
              be made. This parameter only applies of the
              'transport' is 'ssl'";
      }

      leaf ssl-certificate {
        type string {
          length "1 .. max";
        }
        default
          "$HOME/.ssl/yangapi-client.crt";
        description
          "Contains the file path specification
             for the file containing the client-side ssl certificate.
             If both 'certificate' and 'key' files are
             present, the client will attempt to setup a secure
             connection with the server using the certificate and
             SSL key.

             If this fails, and the 'ssl-fallback-ok' leaf is
             set to true, the client will attempt to setup
             a raw tcp connection with the server.";
      }

      leaf ssl-key {
        type string {
          length "1 .. max";
        }
        default
          "$HOME/.ssl/yangapi-client.key";
        description
          "Contains the file path specification
             for the file containing the client-side ssl key.
             If both 'certificate' and 'key' files are
             present, the client will attempt to setup a secure
             connection with the server using the certificate and
             SSLe key.  If this fails, client will attempt to setup
             a raw tcp connection with the server.";
      }

      leaf ssl-trust-store {
        type string {
          length "1 .. max";
        }
        default "$HOME/.ssl/trust-store.pem";
        description
          "Contains the file path specification
             for the file containing the client-side ssl trust-store.
             It includes the CA certificates of the server for
             verification purposes. Certificates in trust-store
             are trusted.";
      }
    }  // grouping SslKeyParms

    grouping ConnectParms {
      description
        "Common 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 user {
        type nt:NcxUserName;
        description
          "User name to use for NETCONF sessions.";
      }

      leaf server {
        type inet:host;
        description
          "IP address or DNS name of the NETCONF server target.";
      }

      choice pass {
        leaf password {
          ncx:password;
          type string;
          description
            "User password to use for NETCONF sessions.
               If none, then user will be prompted before connecting.";
        }
        leaf no-password {
          type empty;
          description
            "Indicates that no user password is needed for
               the connection.";
        }
      }  // choice pass

      leaf ncport {
        type uint16 {
          range "1..max";
        }
        default '830';
        description
          "NETCONF port number to use.  If not present, then
             port 830, followed by port 22, will be tried.";
      }

      leaf timeout {
        type nt:Timeout;
        description
          "Number of seconds to wait for a response
             from the server before declaring a timeout.
             Zero means do not timeout at all.";
      }

      uses SshKeyParms;

      uses SslKeyParms;

      uses ncxapp:ProtocolsParm;

      uses EntryPointParm;

      leaf transport {
        type enumeration {
          enum "ssh" {
            value 0;
            description "NETCONF over SSH.";
            reference
              "RFC 4742;  RFC 6242";

          }
          enum "tcp" {
            value 1;
            description
              "The transport is TCP. The usage depends on
                 the protocol used.

                 NETCONF over TCP: (tail-f NETCONF over TCP)
                 If this enum is selected, then the default --ncport
                 value is set to 2023 and the --protocols value
                 is set to netconf1.0.  The --password value will
                 be ignored.

                 YANG-API or RESTCONF over HTTP/TCP:
                 If this enum is selected, then the default --ncport
                 value is set to 80, and the --protocols value
                 will not be changed.";
            reference
              "NETCONF: tail-f conf-d
              RESTCONF: HTTP";

          }
          enum "tcp-ncx" {
            value 2;
            description
              "NETCONF over TCP.
                 If this enum is selected, then the default --ncport
                 value is set to 2023, and the --protocols value
                 is set to netconf1.0 and netconf1.1.  The --password
                 value will be ignored.";
            reference
              "YumaWorks <ncx-connect>";

          }
          enum "tls" {
            value 3;
            description
              "If this enum is selected the restconf client will try
                 to communicate with web server using https protocol.";
            reference
              "RFC 2818";

          }
          enum "coap" {
            value 4;
            description
              "RESTCONF over CoAP.
                 If this enum is selected, then the default --ncport
                 value is set to 5683. The --password value will be
                 ignored.";
            reference
              "YumaWorks <ncx-connect>";

          }
        }
        default 'ssh';
        description
          "Identifies the transport protocol that should be used.";
      }

      leaf encoding {
        type ywt:encoding-type;
        default 'xml';
        description
          "Identifies the desired encoding format.
              Only supported for RESTCONF and YANG-API at this time.";
      }
    }  // grouping ConnectParms

    grouping XPathParms {
      description
        "Common parameters used for XPath script constructs";
      leaf expr {
        type yang:xpath1.0 {
          length "1..max";
        }
        mandatory true;
        description
          "XPath expression string to evaluate.
             Use quotes if there are any whitespace or
             special characters in the expression.";
      }

      anyxml docroot {
        description
          "Use the contents of the specified variable or
             external XML file as the conceptual document to
             apply the expression specified in the 'expr' parameter.

             If this parameter is missing then a dummy document
             will be used.  This is only allowed if the
             expression only contains variable references
             or numeric/string constants.";
      }
    }  // grouping XPathParms

    grouping SessionGroupParms {
      leaf missing-ok {
        type boolean;
        default 'false';
        description
          "If truew, then it is OK to manage this group if 1 or
            more sessions identified in the session leaf-list
            are not found in the session list. The default is
            to require all session names to exist in the session list
            for the group to be used.";
      }

      leaf missing-connect-ok {
        type boolean;
        default 'false';
        description
          "If true, then it is OK to manage this group if 1 or
            more sessions identified in the session leaf-list
            cannot be established when the connect -group=name
            operation is used. The default is to require all
            sessions to connect OK for the group to be used.";
      }

      leaf lost-ok {
        type boolean;
        default 'false';
        description
          "If true, then it is OK to manage this group if 1 or
            more sessions are lost after connection is made.
            The default is to require all sessions to remain
            connected for the group to be used.";
      }

      leaf reconnect-tries {
        type uint32;
        default '5';
        description
          "Indicates the number of times yangcli will attempt
            to reconnect to a session if the server becomes unreachable.
            The default is 5 tries.";
      }

      leaf reconnect-interval {
        type uint32;
        units "seconds";
        default '10';
        description
          "Indicates the number of seconds yangcli will wait to
            re-establish a connection if a session is dropped
            and the server becomes unreachable.
            The default is 10 seconds.";
      }
    }  // grouping SessionGroupParms

    container yangcli-pro {
      ncx:cli;
      description
        "CLI Parameter Set for the NETCONF Client Application.";
      leaf aliases-file {
        type string;
        default
          "~/.yumapro/.yangcli_pro_aliases";
        description
          "Specifies the yangcli-pro command aliases file to use.";
      }

      leaf ask-password {
        type boolean;
        default 'true';
        description
          "Specifies whether the user will be required and
           prompted to provide a password parameter for the
           connect command.

           This parameter is intended to support servers
           that use keys for authentication instead of passwords.

           If 'true' then the connect command will expect
           that a password is needed.  If 'false' the connect
           command will no require a password, but it will
           use the password parameter if it is set.";
      }

      leaf auto-keepalive {
        type boolean;
        default 'false';
        description
          "Controls whether kepalive messages will be automatically
           sent on a connected session.
           If true, keepalive message is sent every keepalive-interval.
           If false, keepalive message will not be sent.";
      }

      leaf auto-reconnect {
        type boolean;
        default 'true';
        description
          "Controls whether yangcli will try to reconnect to
            the server If the session gets dropped by the server.
            If true, yangcli-pro will try to reconnect to the server.
            If false, yangcli-pro will not try to reconnect to
            the server.";
      }

      leaf auto-reconnect-interval {
        type uint16 {
          range "1 .. 3600";
        }
        units "seconds";
        default '10';
        description
          "Number of seconds to wait after first retry.
           The first retry will be done right away.";
      }

      leaf auto-reconnect-max {
        type uint16;
        default '5';
        description
          "Number of times to retry the connection.
           Zero means no limit, otherwise re-connect attempts
           will stop after this number of failures.";
      }

      leaf autoaliases {
        type boolean;
        default 'true';
        description
          "Controls whether the yangcli-pro command aliases will
           be saved at exit and loaded at startup.
           If true, the 'aliases-file' parameter will be used if it is set,
           or else the default aliases file will be used
           (~/.yumapro/.yangcli_pro_aliases), for loading
           and saving the yangcli-pro command aliases.
           If false, the yangcli-pro command aliases will only be stored
           and loaded manually with the aliases command.";
      }

      leaf autocomp {
        type boolean;
        default 'true';
        description
          "Controls whether partial keywords will be
           checked for interactive or script commands.
           By default, the first match for a partial keyword
           will be used if no definition is found for
           a command name or parameter name.";
      }

      leaf autoconfig {
        type boolean;
        default 'false';
        description
          "Controls whether the running configuration
           will be retrieved automatically for active sessions.
           By default, the running config will not be retrieved
           and maintained. This option must be set to true to
           support value-node command tab completion.";
      }

      leaf autoconfig-conf-mode {
        type boolean;
        default 'true';
        description
          "Controls whether the running configuration
           will be retrieved automatically for active sessions
           in config-mode.

           If autoconfig == TRUE then autoconfig-conf-mode is ignored
           and autoconfig will be done for config mode.

           If autoconfig == FALSE then autoconfig-conf-mode is checked
           and only set if autoconf-conf-mode == TRUE
           If false, the requests after each update will not be done.

           If false, the requests after each update will not be done.
           The current config will not be available to assist tab completion.

           Default for autoconfig-conf-mode is TRUE.";
      }

      leaf autodevices {
        type boolean;
        default 'true';
        description
          "Controls whether the saved devices will be loaded
           into memory at startup and saved to file at exit.
           If true, the default device-cfg file will be used
           (~/.yumapro/.yangcli_pro_devices.conf) for loading
           and saving the configured devices in memory.
           If false, the configured devices will only be stored
           and loaded manually with the devices-cfg command.";
      }

      leaf autohistory {
        type boolean;
        default 'true';
        description
          "Controls whether the command line history buffer will
           be saved at exit and loaded at startup.
           If true, the default history file will be used
           (~/.yumapro/.yangcli_pro_history) for loading
           and saving the history buffer.
           If false, the history buffer will only be stored
           and loaded manually with the history command.";
      }

      leaf autoload {
        type boolean;
        default 'true';
        description
          "Controls whether any modules (except this one)
           will be automatically loaded upon startup or
           upon session startup with a server. If false,
           the 'mgrload' command must be used to
           explicitly load all the desired YANG modules.";
      }

      leaf autoload-cache {
        type boolean;
        default 'true';
        description
          "Controls whether the modules retrieved with the
           <get-schema> operation are cached for use by the
           running instance of yangcli-pro.

           If true, then the YANG modules that are retrieved
           with the <get-schema> operation will be cached.
           A cached module will be used by yangcli-pro instead
           of calling <get-schema>, if that module revision
           is requested again.

           If false, then the YANG modules that are retrieved
           with the <get-schema> operation will not be cached.";
      }

      leaf autoload-get {
        type boolean;
        default 'true';
        description
          "Controls whether the <get> operation will be used
           to retrieve the /netconf-state/schemas sub-tree.

           If 'true', then the schema list will be used instead
           of the <hello> message module capabilities, if the
           server supports the 'ietf-netconf-monitoring' module.

           If 'false', then just the <hello> message module
           list will be used to retrieve YANG modules with
           the <get-schema> operation.

           This option is needed to autoload sub-modules
           that are not available to yangcli-pro, since
           YANG submodules are not advertised in the <hello>
           message.";
      }

      leaf autoload-save-cache {
        type boolean;
        default 'true';
        description
          "Controls whether the modules held in the YANG module
           cache (retrieved with the <get-schema> operation)
           are saved when yangcli-pro exits.

           If true, then the YANG modules that are cached
           will not be deleted when yangcli-pro exit.

           If false, then the YANG modules that are cached
           will be deleted when yangcli-pro exits.";
      }

      leaf autonotif {
        type boolean;
        default 'false';
        description
          "Controls whether notifications will automatically
           be enabled when a session starts.
           By default, notifications will not be enabled.
           If enabled, a <create-subscription> operation will
           be performed when the session starts, and notification
           events for the sesion will be monitored.";
      }

      leaf autonvsave {
        type boolean;
        default 'true';
        description
          "Controls whether the 'save' and 'apply' commands
           will NV-save the configuration changes or not.
           If the server advertises the :startup capability
           and this variable is set to 'false', then the
           final step to save running to startup will not
           be done.  The 'nvsave' command can be used to
           manually save the running datastore to non-volative
           memory.";
      }

      leaf autosessions {
        type boolean;
        default 'true';
        description
          "Controls whether the saved sessions will be loaded
           into memory at startup and saved to file at exit.
           If true, the default session-cfg file will be used
           (~/.yumapro/.yangcli_pro_sessions.conf) for loading
           and saving the configured sessions in memory.
           If false, the configured sessions will only be stored
           and loaded manually with the sessions-cfg command.";
      }

      leaf autotest {
        type boolean;
        default 'true';
        description
          "Controls whether the saved test suites will be loaded
           into memory at startup and saved to file at exit.
           If true, the default test-suite-cfg file will be used
           (~/.yumapro/yangcli_pro_tests.conf) for loading
           and saving the configured test-suites in memory.
           If false, the configured test-suites will only be stored
           and loaded manually with the test-suite command.";
      }

      leaf autousers {
        type boolean;
        default 'true';
        description
          "Controls whether the saved users will be loaded
           into memory at startup and saved to file at exit.
           If true, the default user-cfg file will be used
           (~/.yumapro/.yangcli_pro_users.conf) for loading
           and saving the configured users in memory.
           If false, the configured users will only be stored
           and loaded manually with the users-cfg command.";
      }

      leaf autouservars {
        type boolean;
        default 'true';
        description
          "Controls whether the yangcli-pro user variables will
           be saved at exit and loaded at startup.
           If true, the 'uservars-file' parameter will be used if set,
           or else the default user variables file will be used
           (~/.yumapro/yangcli_pro_uservars.xml), for loading
           and saving the yangcli-pro user variables.
           If false, the yangcli-pro user variables will only be stored
           and loaded manually with the uservars command.";
      }

      leaf bad-data {
        type enumeration {
          enum "ignore" {
            value 0;
            description
              "Silently accept invalid PDU and data model
               parameters.  Intended for advanced server
               testing mode only.";
          }
          enum "warn" {
            value 1;
            description
              "Warn, but accept invalid PDU and data model
               parameters.";
          }
          enum "check" {
            value 2;
            description
              "Prompt the user to keep the invalid value
               or re-enter the value.";
          }
          enum "error" {
            value 3;
            description
              "Prompt the user to re-enter the invalid value.";
          }
        }
        default "check";
        description
          "Specifies how invalid user input from the CLI
           will be handled when filling PDUs for remote
           operations.";
      }

      leaf batch-mode {
        type empty;
        description
          "If present, the interactive CLI will not be used.
           A script should be provided with the 'run-script'
           parameter, or a command provided with the 'run-command'
           parameter, or else the program will simply exit.
           If the auto-connect mode is enabled, then this will mode
           simply test if a NETCONF session can be established,
           then exit.";
      }

      leaf callhome-address {
        type inet:ip-address;
        default "0.0.0.0";
        description
          "Identifies the IP address that should be used to listen
           for callhome connections. Ignored if callhome-enabled
           is false.";
      }

      leaf callhome-enabled {
        type boolean;
        default 'false';
        description
          "If true, then yangcli-pro will listen for SSH CallHome
           connections on the socket identified by the
           callhome-address and callhome-port parameters.";
      }

      leaf callhome-port {
        type inet:port-number;
        default '4334';
        description
          "Identifies the TCP port that should be used to listen
           for callhome connections. Ignored if callhome-enabled
           is false.";
        reference
          "RFC 8071";

      }

      leaf callhome-user {
        type nt:NcxUserName;
        description
          "Specifies the name of a configured user entry that
           should be used as the default user for callhome
           sessions, if no saved session entry is found matching
           the server IP address.  Will be ignored if the user
           is not currently configured.";
      }

      leaf check-output {
        type boolean;
        default 'true';
        description
          "If true, then yangcli-pro will validate remote commands
           against the YANG definition for the rpc/input node.
           This checks the operation parameters about to be sent to
           a server session. Validation of the contents of a <config>
           element are not done.  Also the $$check-output global
           parameter.";
      }

      leaf check-output-error {
        type boolean;
        default 'false';
        description
          "If 'true', then errors found during the check-output
          validation tests will be treated as errors, causing
          the <rpc> about to be sent to fail.
          If 'false', then errors found during the check-output
          validation tests will be treated as warnings.
          Also the $$check-output-error global parameter.";
      }

      leaf check-replies {
        type boolean;
        default 'true';
        description
          "If true, then yangcli-pro will validate responses for
           remote commands against the YANG definition for
           the rpc/output node. This checks the parameters
           in the <rpc-reply> sent from a server session.
           If the 'output' section is missing or empty, then
           the <rpc-reply> will be checked to make sure it
           contains either <ok> or 1 or more <rpc-error> elements.
           Also the $$check-replies global parm.";
      }

      leaf check-replies-error {
        type boolean;
        default 'false';
        description
          "If 'false', then errors found during the check-replies
          validation tests will be treated as warnings.
          If 'true', then errors found during the check-replies
          validation tests will be treated as errors, causing
          the <rpc-reply> about to be processed to be rejected.";
      }

      leaf config-autosave {
        type boolean;
        default 'true';
        description
          "Controls how edits in config term mode are saved to
              NV-storage if the server supports the :startup capability.
              If 'true', automatically copy running to startup when
              an edit is applied. If 'false', no automatically copy
              from running to startup when an edit is applied.
              The user will enter 'save' or 'copy-config'
              manually once config term mode is exited.";
      }

      leaf config-edit-mode {
        type config-edit-mode-type;
        default 'level';
        description
          "Controls how edits are applied during config mode.";
      }

      leaf default-module {
        type nt:NcxName;
        description
          "Default module name string to use before 'yuma-netconf'
            and 'yangcli-pro' are tried.  The module prefix may need to be
            used for other modules.";
      }

      leaf-list disable-command {
        type nt:NcxIdentifier;
        description
          "Specifies a top-level command that should be disabled
            and not visible or available to a user. If the value
            does not contain a module name prefix, then the command
            will be disabled in all modules.

            For example, to disable the NETCONF <delete-config>
            operation:

               disable-command ietf-netconf:delete-config
            ";
      }

      leaf display-mode {
        type enumeration {
          enum "plain" {
            value 0;
            description
              "Plain identifier without any prefix format.";
          }
          enum "prefix" {
            value 1;
            description
              "Plain text with XML prefix added format.";
          }
          enum "module" {
            value 2;
            description
              "Plain text with module name as prefix added format.";
          }
          enum "xml" {
            value 3;
            description "XML format.";
          }
          enum "xml-nons" {
            value 4;
            description
              "XML format, but no namespace (xmlns) attributes
                 will be generated.";
          }
          enum "json" {
            value 5;
            description "JSON format.";
          }
          enum "cli" {
            value 6;
            description "CLI format.";
          }
        }
        default 'plain';
        description
          "Controls how values are displayed during output
            to STDOUT or a log file.";
      }

      leaf echo-notif-loglevel {
        type nt:NcDebugType;
        default 'debug';
        description
          "Specifies the log-level value that must be active before
           notifications will be echoed to the log or STDOUT.
           This parameter has no affect if 'echo-notifs' is false.
           The $$echo-notif-loglevel system variable is derived from
           this parameter.";
      }

      leaf echo-notifs {
        type boolean;
        default 'true';
        description
          "Allow notifications to be echoed to the log or STDOUT

           If 'true', <notification> messages will be output
            to the log, if log-level is set to the value
            specified by the echo-notif-loglevel or higher.

           If 'false', <notifications> messages will not be
           output to the log.

           The $$echo-notifs system variable is derived from
           this parameter.";
      }

      leaf echo-replies {
        type boolean;
        default 'true';
        description
          "Allow RPC replies to be echoed to the log or STDOUT

           If 'true', <rpc-reply> messages containing data
           will be output to the log, if log-level is
           'info' or higher.

           If 'false', <rpc-reply> messages containing data
           will not be output to the log, regardless of
           the value of log-level.

           The $$echo-replies system variable is derived from
           this parameter.";
      }

      leaf fixorder {
        type boolean;
        default 'true';
        description
          "Controls whether PDU parameters will be
           automatically sent to the server in the
           correct order.  If false, the specified order
           will be used. If true, then canonical order will
	   be used";
      }

      leaf force-target {
        type enumeration {
          enum "candidate" {
            value 0;
            description
              "Force default edit target to be candidate.";
          }
          enum "running" {
            value 1;
            description
              "Force default edit target to be running.";
          }
        }
        default 'candidate';
        description
          "Controls whether the candidate or running
           configuration datastore will be used as
           the default edit target, when both are supported
           by the server.";
      }

      leaf keepalive-interval {
        type uint32 {
          range "1 .. 3600";
        }
        units "seconds";
        default '4';
        description
          "Specifies the time interval, in seconds, between keepalive
           messages sent from a session. This value is only used
           if 'auto-keepalive' is true.";
      }

      leaf no-aliases {
        type empty;
        description
          "Disables the alias substitution feature.
           The alias file will not be read.
           The aliases and alias commands will be disabled.";
      }

      leaf prompt-name {
        type string {
          length "1 .. 512";
        }
        description
          "Customize a prompt name for yp-shell.";
      }

      leaf prompt-type {
        type ywt:show-mode;
        default 'normal';
        description
          "Selects the type of prompt string that will be used
           in interactive mode.";
      }

      choice run-startup-mode {
        leaf run-command {
          type string {
            length "1 .. 4095";
          }
          description
            "The specified command will be invoked upon startup.
             If the auto-connect parameters are provided, then
             a session will be established before running the
             command.";
        }
        leaf run-script {
          type string {
            length "1 .. 4095";
          }
          description
            "The specified script will be invoked upon startup.
             If the auto-connect parameters are provided, then
             a session will be established before running the
             script.  If a quoted string is used, then any parameters
             after the script name will be passed to the script.";
        }
      }  // choice run-startup-mode

      leaf script-input {
        type boolean;
        default 'true';
        description
          "Specifies whether scripts run in interactive mode should
           attempt to fill in missing command parameters from the
           CLI command line or not.
           If not, then script commands will be attempted with
           whatever parameters are present in the script.";
      }

      leaf server-commands {
        type boolean;
        default 'true';
        description
          "Specifies whether RPC operations learned from server
           YANG modules will be added as a command available to
           the user.

           The module ietf-netconf is exempt from this parameter.
           Use the disable-command parameter to disable individual
           NETCONF operations.";
      }

      leaf term-length {
        type uint16 {
          range "0 .. 511";
        }
        default '0';
        description
          "Specifies the length of the terminal to use for page
           mode output with the -More- prompt. This parameter
           is ignored in batch mode. It is only used if the
           output session is operating in interactive mode.

           If the value 0 is used then the 'More' prompt will
           be disabled. Otherwise this value represents the
           number of lines to output for each screen in pagination
           output mode.";
      }

      leaf test-suite-file {
        type string;
        default
          "~/.yumapro/yangcli_pro_tests.conf";
        description
          "Specifies the yangcli-pro test suite config
           file to use.";
      }

      leaf time-rpcs {
        type boolean;
        default 'false';
        description
          "Measure the round-trip time of each <rpc> request and
          <rpc-reply> at the session level.
          Echo the elapsed time value to screen if in
          interactive mode, as well as the log if the
          log is a file instead of stdout.
          The $$time-rpcs system variable is derived from this
          parameter.";
      }

      leaf time-rpcs-stats {
        type boolean;
        default 'false';
        description
          "Save rpc statistics to the default statistics file
          if the time-rpcs variable is also true.
          The $$time-rpcs-stats system variable is derived
          from this parameter.";
      }

      leaf time-rpcs-stats-file {
        type string {
          length "1 .. max";
        }
        default
          "~/yangcli_pro_rpc_stats.txt";
        description
          "The default filename to use for saving RPC timing statistics.
          if the time-rpcs and time-rpc-stats variables are true.
          The $$time-rpcs-stats-file system variable is derived
          from this parameter.";
      }

      leaf use-rawxml {
        type boolean;
        default 'false';
        description
          "Specifies how file result variables will be read
           for XML files.  Controls whether the XML will be
           parsed against the target YANG object (the default)
           or injected into a variable or request message from
           the raw XML text in the file.";
      }

      leaf use-traceid {
        type boolean;
        default 'false';
        description
          "Controls whether the 'trace-id' attribute will
           be set in the RPC requests or not.
           By default, 'trace-id' will be disabled.";
      }

      leaf use-xmlheader {
        type boolean;
        default 'true';
        description
          "Specifies how file result variables will be written
           for XML files.  Controls whether the XML preamble
           header will be written or not.";
      }

      leaf uservars-file {
        type string;
        default
          "~/.yumapro/yangcli_pro_uservars.xml";
        description
          "Specifies the yangcli-pro user variables file to use.";
      }

      uses ncxapp:NcxAppCommon;

      uses ncxapp:NewConfigParm;

      uses ywapp:LoggingCommonParms;

      uses ywapp:MessageIndentParm;

      uses ywapp:YumaproHomeParm;

      uses ywapp:DataTemplateParms;

      uses ywapp:UseSessionVarsParm;

      uses ywapp:SaveSessionVarsParm;

      uses ncxapp:CommonFeatureParms;

      uses ncxapp:SubdirsParm;

      uses ncxapp:HomeParm;

      uses ConnectParms;

      uses ywapp:OcPatternParm;

      uses ywapp:MatchParms {
        refine match-names {
          default 'one-nocase';
        }

        refine alt-names {
          default 'true';
        }

        refine wildcard-keys {
          default 'false';
        }
      }

      uses ncxapp:ModuleParm;

      uses ncxapp:DeviationParm;

      uses ncxapp:DatapathParm;

      uses ncxapp:RunpathParm;
    }  // container yangcli-pro

    rpc action {
      description
        "Invoke a YANG action.
         The target of the action must identify a YANG action
         statement, which is not a real node in the server data
         tree.";
      input {
        ncx:default-parm "target";
        uses CommonPduParms;

        leaf timeout {
          type nt:Timeout;
          description "Timeout to use";
        }
      }
    }  // rpc action

    rpc alias {
      description
        "Show or set a specific yangcli-pro command alias.

         * Show all aliases in memory (same as aliases):

           yangcli-pro>  alias

         * Show one alias 'foo':

           yangcli-pro>  alias foo

         * Set one alias; make sure there is no whitespace
           between the '=' char and either string.  If the value
           has whitespace, it must be quoted. If the equals sign
           is present, then a valid value string must be present.

           Quotes will be preserved if used:
             * Single quotes can appear within doubled-quoted
               strings but not any double quotes.
             * Double quotes can appear within single-quoted strings
               but not any single quotes.

           The first token in a plain command or the first token
           in the right-hand-side expression in an assignment
           statement can be an alias.

           The alias name must exact match the token.
           A new command line will be constructed replacing
           the alias name with its value.  The new command
           line will then be parsed as usual.

           yangcli-pro>  alias s=show
           yangcli-pro>  alias getfoo='sget-config source=running /top/foo'

        * Aliases can override real commands, so be careful
          not to unintentionally alter real commands.

           yangcli-pro>  alias get-config='get-config source=running'
       ";
      input {
        ncx:default-parm "var";
        ncx:default-parm-equals-ok;
        leaf var {
          type string {
            length "1 .. max";
          }
          description
            "The alias command string.";
        }
      }
    }  // rpc alias

    rpc aliases {
      description
        "Manage the yangcli-pro command aliases";
      input {
        choice alias-action {
          default 'show';
          leaf show {
            type empty;
            description
              "Show all the yangcli-pro command aliases.";
          }
          leaf clear {
            type empty;
            description
              "Delete all the yangcli-pro aliases from memory.";
          }
          leaf load {
            type string;
            default
              "~/.yumapro/.yangcli_pro_aliases";
            description
              "Load the yangcli-pro command aliases from the
               specified file spec.  The default aliases
               file will be loaded automatically at startup
               if the '--autoaliases' parameter is present.";
          }
          leaf save {
            type string;
            default
              "~/.yumapro/.yangcli_pro_aliases";
            description
              "Save the yangcli-pro command aliases to the
               specified filespec. The default aliases
               file will be saved automatically at shutdown
               if the '--autoaliases' parameter is present.";
          }
        }  // choice alias-action
      }
    }  // rpc aliases

    rpc auto-test {
      description
        "Run automatic edit testing on the specified object";
      input {
        ncx:default-parm "target";
        leaf target {
          ncx:schema-instance;
          type string;
          mandatory true;
          description
            "Schema-instance identifier string indicating the
              node which is going to be tested.";
        }

        leaf session-name {
          type nt:NcxIdentifier;
          description
            "Named session to use for the testing.  If missing the
             current session will be used.";
        }

        leaf iterations {
          type uint32 {
            range "1..max";
          }
          default '1';
          description
            "Number of commits to make.";
        }
      }
    }  // rpc auto-test

    rpc cache {
      description
        "Clear 1 or all entries from the YANG module cache.
         There are 3 forms of this command:
           cache clear
           cache delete foo
           cache delete=foo revision=2014-05-22";
      input {
        choice cache-input {
          mandatory true;
          leaf clear {
            type empty;
            description
              "Clear the YANG module cache on disk.";
          }

          case delete-cache {
            leaf delete {
              type nt:NcxIdentifier;
              mandatory true;
              description
                "Name of the module to delete from the YANG
                 module cache.";
            }

            leaf revision {
              type nt:Date;
              description
                "Revision date of the module to delete from the
                 YANG module cache. OIf missing then all revisions
                 will be deleted from the cache.";
            }
          }  // case delete-cache
        }  // choice cache-input
      }
    }  // rpc cache

    rpc cd {
      description
        "Change the current working directory.";
      input {
        ncx:default-parm "dir";
        leaf dir {
          type string;
          mandatory true;
          description
            "Directory path to use.";
        }
      }
    }  // rpc cd

    rpc clear {
      description
        "Clear the screen in interactive mode.";
    }  // rpc clear

    rpc config {
      description
        "Enter the configuration mode for the current session.
         There must be a current active session or this command
         will fail.";
      input {
        choice config-source {
          default 'term';
          leaf term {
            type empty;
            description
              "Use the terminal for configuration input.";
          }
        }  // choice config-source
      }
    }  // rpc config

    rpc connect {
      description
        "Connect to a NETCONF server.";
      input {
        ncx:default-parm "server";
        uses ConnectParms {
          refine user {
            mandatory true;
          }

          refine server {
            mandatory true;
          }

          refine pass {
            mandatory true;
          }
        }

        leaf session-name {
          type nt:NcxIdentifier;
          description
            "Create a new session configuration record
             using this new session name.";
        }
      }
    }  // rpc connect

    rpc create {
      description
        "Create some NETCONF config data with the edit-config operation";
      input {
        ncx:default-parm "target";
        uses EditParms;
      }
    }  // rpc create

    rpc delete {
      description
        "Delete some NETCONF config data with the edit-config operation";
      input {
        ncx:default-parm "target";
        choice delete-target {
          mandatory true;
          leaf target {
            type string;
            description
              "Xpath expression indicating the node which is going
              to be deleted.";
          }
          leaf urltarget {
            type ywt:UrlPath;
            description
              "The URL path expression to use in the delete
               operation.";
          }
        }  // choice delete-target

        anyxml value {
          description
            "Contains a string representing the content
            to use for the variable.  Only applies if the
            delete-target is a leaf-list node.";
        }
      }
    }  // rpc delete

    rpc delete-all {
      description
        "Delete some NETCONF config data with the edit-config operation.
        Delete all instances of a leaf-list or list object.  At least
        one instance must exist or the server will return an error.";
      input {
        ncx:default-parm "target";
        choice delete-target {
          mandatory true;
          leaf target {
            type string;
            description
              "Xpath expression indicating the list or leaf-list nodes
              which are going to be deleted.";
          }
          leaf urltarget {
            type ywt:UrlPath;
            description
              "The URL path expression to use in the delete
               operation.";
          }
        }  // choice delete-target
      }
    }  // rpc delete-all

    rpc elif {
      ywx:help "Start an intermediate block in a conditional statement";
      description
        "Evaluate an XPath expression locally on the manager.
         and execute the block of commands that follow
         if the expression is true.  The block ends
         when a matching 'elif', 'else', or 'end' command is reached.
         This may only be used after an 'if' or 'elif' command
         or an error (no matching if command) will occur.
        ";
      input {
        ncx:default-parm "expr";
        uses XPathParms;
      }
    }  // rpc elif

    rpc else {
      ywx:help "Start the last block in a conditional statement";
      description
        "End an 'if' or 'elif' command block, and start a new
         command block that must end with an 'end' command.
         If no 'if' or 'elif' block is in progress then an error
         will occur.
        ";
    }  // rpc else

    rpc end {
      description
        "End an 'if' command block or a 'while' command block.
         If no block is in progress then an error will occur.
        ";
    }  // rpc end

    rpc eval {
      description
        "Evaluate an XPath expression locally on the manager.
         All local variables will be available to the session
         context, in the following precedence:
            1) current script run level
            2) global variable

         When the result of an eval command is saved
         to a user variable, it may be altered as follows:

           Convert to string:
            - <data> is a simple type
            - <data> contains 1 node that is a simple type

           Remove the <data> container:
            - <data> contains a single complex element

           Retain the <data> container:
            - <data> contains multiple elements

         Usage Examples:

         > $x = 5
             x = '5'
         > $x = eval '$x + 10'
             x = '15'
         > $y = xget /system
             y = data {
                   system { ... }
                 }
         > $z = eval '//sysname' docroot=$y
             z = 'Linux'
         > $w = eval '/system/uname' docroot=$y
             w = uname {
                   sysname 'Linux'
                   ...
                 }
        ";
      input {
        ncx:default-parm "expr";
        uses XPathParms;
      }

      output {
        anyxml data {
          mandatory true;
          description
            "The XPath result, returned in a data element.

             The content will be a simple string for boolean, string,
             and number result types.

             The content will be zero or more child elements,
             in their proper namespaces, if the result is a node-set.
             Only the requested node(s) will be returned,
             not their entire path to the document root,
             like the get and get-config operations.

             An empty 'data' element will be returned if the result
             is an empty node-set.";
        }
      }
    }  // rpc eval

    rpc eventlog {
      description
        "Access the notification event log";
      input {
        ncx:default-parm "show";
        choice eventlog-action {
          default 'show-case';
          case show-case {
            leaf show {
              type LogCount;
              default '-1';
              description
                "Show the specified number of event log
                 buffer entries. -1 means show all entries.
                 If the --full or --brief help-mode parameters
                 are entered, then the output will be altered.";
            }

            leaf start {
              type LogIndex;
              description
                "Start at the specified event index number instead of
                 the beginning of the event log.";
            }

            uses ncxapp:HelpMode;
          }  // case show-case
          leaf clear {
            type LogCount;
            default '25';
            description
              "Clear the specified number of notification
               event log entries.  The value -1 means
               clear all the entries.";
          }
        }  // choice eventlog-action
      }
    }  // rpc eventlog

    rpc exit {
      description
        "Exit the currrent configuration level for the current session.
         There must be a current active session or this command
         will fail. The current session must also be in the
         configuration mode. Any pending edits will be applied
         if the edit-config-mode is set to 'level'.";
    }  // rpc exit

    rpc fill {
      description
        "Fill a value for reuse in a NETCONF PDU or other operation.

        Used in an assignment statement to create a variable
        for later use:

            $foo = fill --target=/t:foo-con/bar-list";
      input {
        ncx:default-parm "target";
        uses FillParms;
      }

      output {
        anyxml data {
          description
            "The result of the fill operation.

              The name of the value node may not really
              be 'data'. If the 'target' or 'current-value'
              input parameters are used, then the name
              of the result node will be copied instead.

              The data type will be inherited from the 'target'
              or 'current_value' parameters, and not really be
              an 'anyxml' structure.  YANG does have a data
              type that supports this feature.";
        }
      }
    }  // rpc fill

    rpc get-locks {
      description
        "Get a lock for the running configuration
           and the candidate and startup configurations,
           if needed.  If all the locks cannot be obtained,
           then release all of them (all-or-nothing).
           The entire operation must be completed within
           the lock timeout interval, if it is set.";
      input {
        leaf lock-timeout {
          type nt:Timeout;
          default '120';
          description
            "Total time to wait to retrieve all the locks needed
              to complete the get-locks command.  A value of zero
              means to wait forever and not use a timeout value.";
        }

        leaf retry-interval {
          type uint32 {
            range "1 .. 300";
          }
          units "seconds";
          default '2';
          description
            "Retry interval to use if a lock is temporarily
              unavailable.  The client will wait this number of
              seconds before attempting to get the current lock.";
        }

        leaf cleanup {
          type boolean;
          default 'true';
          description
            "Indicates whether the locks obtained should be
              automatically released if an RPC operation
              fails (after the get-locks succeeds).";
        }
      }
    }  // rpc get-locks

    rpc group {
      description
        "Manage the yangcli-pro session groups.
       A group name is not allowed to have the same name as any
       session name.  This allows the 'session set-current' command
       to select a group or an individual session.";
      input {
        ncx:default-parm "session";
        choice groupcmd {
          mandatory true;
          case connect {
            leaf connect {
              type nt:NcxIdentifier;
              description
                "Connect to all sessions in the specified group.";
            }

            uses SessionGroupParms;
          }  // case connect
          leaf create {
            type nt:NcxIdentifier;
            description
              "Name of the group to create.  The 'session' parameter
                 must also be present";
          }
          leaf delete {
            type nt:NcxIdentifier;
            description
              "Name of the group to delete";
          }
          leaf add {
            type nt:NcxIdentifier;
            description
              "Name of the group to add some sessions.  The 'session'
                 parameter must also be present.";
          }
          leaf remove {
            type nt:NcxIdentifier;
            description
              "Name of the group to remove some sessions.  The
                 'session' parameer must also be present.";
          }
          leaf show {
            type nt:NcxIdentifier;
            description
              "Name of the group to show";
          }
          leaf list {
            type empty;
            description
              "List the names of all the groups";
          }
        }  // choice groupcmd

        leaf-list session {
          when
            "../create or ../add or ../remove";
          type nt:NcxIdentifier;
          min-elements 1;
          description
            "Name of a session that is being added to the group.";
        }
      }
    }  // rpc group

    rpc help {
      description
        "Print the yangcli-pro help text";
      input {
        ncx:default-parm "command";
        choice helptype {
          leaf command {
            type nt:NcxIdentifier;
            description
              "Show help for the specified command,
                         also called an RPC method";
          }
          leaf commands {
            type empty;
            description
              "Show info for all local commands";
          }
          leaf notification {
            type nt:NcxIdentifier;
            description
              "Show help for the specified notification";
          }
          leaf object {
            type union {
              type nt:NcxIdentifier;
              type ywt:UrlPath;
            }
            description
              "Show help for the specified object";
          }
          leaf type {
            type nt:NcxIdentifier;
            description
              "Show help for the specified type";
          }
        }  // choice helptype

        uses ncxapp:HelpMode;
      }
    }  // rpc help

    rpc history {
      description
        "Access the command line history buffer";
      input {
        ncx:default-parm "show";
        choice history-action {
          default 'show-case';
          case show-case {
            leaf show {
              type LogCount;
              default '25';
              description
                "Show the specified number of history
                 buffer entries. -1 means show all entries.";
            }

            uses ncxapp:HelpMode;
          }  // case show-case
          leaf clear {
            type empty;
            description
              "Clear all the history buffer entries.";
          }
          leaf load {
            type string;
            default
              "~/.yumapro/.yangcli_pro_history";
            description
              "Load the command history buffer from the
               specified file spec.";
          }
          leaf save {
            type string;
            default
              "~/.yumapro/.yangcli_pro_history";
            description
              "Save the command history buffer in the
               specified filespec.";
          }
        }  // choice history-action
      }
    }  // rpc history

    rpc if {
      description
        "Evaluate an XPath expression locally on the manager.
         and execute the block of commands that follow
         if the expression is true.  The block ends
         when a matching 'elif', 'else', or 'end' command is reached.
        ";
      input {
        ncx:default-parm "expr";
        uses XPathParms;
      }
    }  // rpc if

    rpc insert {
      description
        "Insert some NETCONF config data with the edit-config operation";
      input {
        ncx:default-parm "target";
        uses EditParms;

        leaf order {
          type enumeration {
            enum "first" {
              value 0;
            }
            enum "last" {
              value 1;
            }
            enum "before" {
              value 2;
            }
            enum "after" {
              value 3;
            }
          }
          default 'last';
          description
            "The insert order that should be used.
             If the values 'before' or 'after' are selected,
             then the edit-target parameter must also be present.";
        }

        leaf operation {
          type enumeration {
            enum "create" {
              value 0;
            }
            enum "merge" {
              value 1;
            }
            enum "replace" {
              value 2;
            }
          }
          default 'merge';
          description
            "The edit-config operation that should be used.";
        }

        leaf edit-target {
          type string;
          description
            "The value or key clause that should be used.
             This parameter should only be present if the
             order selected is 'before' or 'after'.

             For a leaf-list, the edit-target contains the
             value of the target leaf-list node within the
             configuration being edited.  The new config
             will be inserted before or after this leaf-list
             node, depending on the order selected.
             E.g., edit-target='some leaf content'.

             For a list, the edit-target contains the
             key values of the target list node within the
             configuration being edited.  The new config
             will be inserted before or after this list
             node, depending on the order selected.
             E.g., edit-target=[name='fred'][zipcode=90210].";
        }
      }
    }  // rpc insert

    rpc list {
      description "List some NETCONF info.";
      input {
        choice listtype {
          mandatory true;
          leaf commands {
            type empty;
            description
              "List all local and remote commands";
          }
          leaf files {
            type empty;
            description
              "List all available data files.";
          }
          leaf objects {
            type empty;
            description
              "List all available top-level object names.";
          }
          leaf oids {
            type empty;
            description
              "List all available object identifiers.";
          }
          leaf modules {
            type empty;
            description
              "List all available local YANG files.";
          }
          leaf scripts {
            type empty;
            description
              "List all available script files.";
          }
        }  // choice listtype

        leaf module {
          type nt:NcxIdentifier;
          description
            "List only from this module, if specified.";
        }

        uses ncxapp:HelpMode;
      }
    }  // rpc list

    rpc log-debug {
      description
        "Write a message to the output log if the log-level
        is greater or equal to 'debug'.";
      input {
        ncx:default-parm "msg";
        leaf msg {
          type string;
          mandatory true;
          description
            "The formatted text string to write to the log.";
        }
      }
    }  // rpc log-debug

    rpc log-info {
      description
        "Write a message to the output log if the log-level
        is greater or equal to 'info'.";
      input {
        ncx:default-parm "msg";
        leaf msg {
          type string;
          mandatory true;
          description
            "The formatted text string to write to the log.";
        }
      }
    }  // rpc log-info

    rpc log-error {
      description
        "Write a message to the output log if the log-level
        is greater or equal to 'error'.";
      input {
        ncx:default-parm "msg";
        leaf msg {
          type string;
          mandatory true;
          description
            "The formatted text string to write to the log.";
        }
      }
    }  // rpc log-error

    rpc log-warn {
      description
        "Write a message to the output log if the log-level
        is greater or equal to 'warn'.";
      input {
        ncx:default-parm "msg";
        leaf msg {
          type string;
          mandatory true;
          description
            "The formatted text string to write to the log.";
        }
      }
    }  // rpc log-warn

    rpc merge {
      description
        "Merge some NETCONF config data with the edit-config operation";
      input {
        ncx:default-parm "target";
        uses EditParms;
      }
    }  // rpc merge

    rpc mgrload {
      description
        "Load a module or other file into the client.
         Use the 'load' command to load a module into
         the server.";
      input {
        ncx:default-parm "module";
        leaf module {
          type nt:NcxName;
          mandatory true;
          description "Module name to load";
        }

        leaf revision {
          type nt:Date;
          description
            "Module revision to load.";
        }

        uses ncxapp:DeviationParm;
      }
    }  // rpc mgrload

    rpc pwd {
      description
        "Print the current working directory.";
    }  // rpc pwd

    rpc nvsave {
      description
        "Save the running datastore to the startup datastore.";
    }  // rpc nvsave

    rpc quit {
      description
        "Quit the yangcli-pro application";
    }  // rpc quit

    rpc recall {
      description
        "Recall the specified command line history
          buffer entry into the current command line.";
      input {
        ncx:default-parm "index";
        leaf index {
          type LogIndex;
          mandatory true;
          description
            "Index [0..N] of the command line
              history entry to recall.";
        }
      }
    }  // rpc recall

    rpc release-locks {
      description
        "Unlock all the server databases that were
          previously locked with the get-locks command.";
    }  // rpc release-locks

    rpc replace {
      description
        "Create some NETCONF config data with the edit-config operation";
      input {
        ncx:default-parm "target";
        uses EditParms;
      }
    }  // rpc replace

    rpc remove {
      description
        "Remove some NETCONF config data with the edit-config operation";
      input {
        ncx:default-parm "target";
        leaf target {
          type string;
          mandatory true;
          description
            "Xpath expression indicating the node which is going
            to be deleted.";
        }

        anyxml value {
          description
            "Contains a string representing the content
            to use for the variable.  Only applies if the
            target is a leaf-list node.";
        }
      }
    }  // rpc remove

    rpc remove-all {
      description
        "Remove some NETCONF config data with the edit-config operation.
        Remove all instances of a leaf-list or list object.";
      input {
        ncx:default-parm "target";
        choice delete-target {
          mandatory true;
          leaf target {
            type string;
            description
              "Xpath expression indicating the list or leaf-list nodes
              which are going to be removed.";
          }
          leaf urltarget {
            type ywt:UrlPath;
            description
              "The URL path expression to use in the remove
               operation.";
          }
        }  // choice delete-target
      }
    }  // rpc remove-all

    rpc run {
      description
        "Internal command to run a script.";
      input {
        ncx:default-parm "script";
        leaf script {
          type string;
          mandatory true;
          description
            "script filespec to run";
        }

        leaf P1 {
          type string;
          description "script parameter $1";
        }

        leaf P2 {
          type string;
          description "script parameter $2";
        }

        leaf P3 {
          type string;
          description "script parameter $3";
        }

        leaf P4 {
          type string;
          description "script parameter $4";
        }

        leaf P5 {
          type string;
          description "script parameter $5";
        }

        leaf P6 {
          type string;
          description "script parameter $6";
        }

        leaf P7 {
          type string;
          description "script parameter $7";
        }

        leaf P8 {
          type string;
          description "script parameter $8";
        }

        leaf P9 {
          type string;
          description "script parameter $9";
        }
      }
    }  // rpc run

    rpc save {
      description
        "Meta command to save configuration edits.";
    }  // rpc save

    rpc device-cfg {
      description
        "Access a device configuration";
      input {
        choice device-action {
          default 'show-case';
          case show-case {
            leaf show {
              type IdentifierOrZero;
              default "";
              description
                "Show the specified device or the current device
                 if an empty string is entered.";
            }

            uses ncxapp:HelpMode;
          }  // case show-case
          leaf delete {
            type nt:NcxIdentifier;
            description
              "Delete the specified device from the saved
               devices in memory.";
          }
          leaf save {
            type nt:NcxIdentifier;
            description
              "Save the specified device to the
               saved devices in memory.";
          }
        }  // choice device-action
      }
    }  // rpc device-cfg

    rpc devices-cfg {
      description
        "Controls access to the saved devices file";
      input {
        choice devices-action {
          default 'show-case';
          case show-case {
            leaf show {
              type empty;
              description
                "Show all saved devices in memory";
            }

            uses ncxapp:HelpMode;
          }  // case show-case
          leaf clear {
            type empty;
            description
              "Clear all the saved sessions in memory.
               Use 'sessions load' to restore the saved sessions.
               Use 'sessions save' to clear the saved sessions
               file.";
          }
          leaf load {
            type string;
            default
              "~/.yumapro/.yangcli_pro_devices.conf";
            description
              "Load the saved sessions in memory from the
               specified file spec.";
          }
          leaf save {
            type string;
            default
              "~/.yumapro/.yangcli_pro_devices.conf";
            description
              "Save the current saved devices in memory to the
               specified saved users filespec.";
          }
        }  // choice devices-action
      }
    }  // rpc devices-cfg

    rpc session {
      description "Access an active session";
      input {
        leaf set-current {
          type nt:NcxIdentifier;
          mandatory true;
          description
            "Set the specified session or group as the current session.
             The named session or group must already be loaded in memory.";
        }
      }
    }  // rpc session

    rpc session-cfg {
      description
        "Access a session configuration";
      input {
        choice session-action {
          default 'show-case';
          case show-case {
            leaf show {
              type IdentifierOrZero;
              default "";
              description
                "Show the specified session or the current session
                 if an empty string is entered.";
            }

            uses ncxapp:HelpMode;
          }  // case show-case
          leaf delete {
            type nt:NcxIdentifier;
            description
              "Delete the specified session from the saved
               sessions in memory.";
          }
          leaf save {
            type nt:NcxIdentifier;
            description
              "Save the specified session to the
               saved sessions in memory.";
          }
        }  // choice session-action
      }
    }  // rpc session-cfg

    rpc user-cfg {
      description
        "Access a user configuration";
      input {
        choice user-action {
          default 'show-case';
          case show-case {
            leaf show {
              type IdentifierOrZero;
              default "";
              description
                "Show the specified user or the current user
                 if an empty string is entered.";
            }

            uses ncxapp:HelpMode;
          }  // case show-case
          leaf delete {
            type nt:NcxIdentifier;
            description
              "Delete the specified user from the saved
               users in memory.";
          }
          leaf save {
            type nt:NcxIdentifier;
            description
              "Save the specified user to the
               saved users in memory.";
          }

          case create {
            leaf create {
              type nt:NcxName;
              mandatory true;
              description
                "An user id to use to create a new user.";
            }

            leaf user-name {
              type nt:NcxName;
              mandatory true;
              description
                "An user name to use to create a new user.";
            }

            leaf password {
              ncx:password;
              type string;
              mandatory true;
              description
                "An user password to use to create a new user.";
            }
          }  // case create
        }  // choice user-action
      }
    }  // rpc user-cfg

    rpc users-cfg {
      description
        "Controls access to the saved users file";
      input {
        choice users-action {
          default 'show-case';
          case show-case {
            leaf show {
              type empty;
              description
                "Show all saved users in memory";
            }

            uses ncxapp:HelpMode;
          }  // case show-case
          leaf clear {
            type empty;
            description
              "Clear all the saved users in memory.
               Use 'users load' to restore the saved users.
               Use 'users save' to clear the saved users
               file.";
          }
          leaf load {
            type string;
            default
              "~/.yumapro/.yangcli_pro_users.conf";
            description
              "Load the saved users in memory from the
               specified file spec.";
          }
          leaf save {
            type string;
            default
              "~/.yumapro/.yangcli_pro_users.conf";
            description
              "Save the current saved users in memory to the
               specified saved users filespec.";
          }
        }  // choice users-action
      }
    }  // rpc users-cfg

    rpc sessions-cfg {
      description
        "Controls access to the saved sessions file";
      input {
        choice sessions-action {
          default 'show-case';
          case show-case {
            leaf show {
              type empty;
              description
                "Show all saved sessions in memory";
            }

            uses ncxapp:HelpMode;
          }  // case show-case
          leaf clear {
            type empty;
            description
              "Clear all the saved sessions in memory.
               Use 'sessions load' to restore the saved sessions.
               Use 'sessions save' to clear the saved sessions
               file.";
          }
          leaf load {
            type string;
            default
              "~/.yumapro/.yangcli_pro_sessions.conf";
            description
              "Load the saved sessions in memory from the
               specified file spec.";
          }
          leaf save {
            type string;
            default
              "~/.yumapro/.yangcli_pro_sessions.conf";
            description
              "Save the current saved sessions in memory to the
               specified saved sessions filespec.";
          }
        }  // choice sessions-action
      }
    }  // rpc sessions-cfg

    rpc sget {
      description
        "Get some NETCONF running config or state data with the get
        operation, using an optional subtree filter.";
      input {
        ncx:default-parm "target";
        uses CommonPduParms;

        uses SGetParms;
      }

      output {
        anyxml data {
          description
            "The data resulting from the retrieval operation.";
        }
      }
    }  // rpc sget

    rpc sget-config {
      description
        "Get some NETCONF config data with the get-config
        operation, using an optional subtree filter.";
      input {
        ncx:default-parm "target";
        uses CommonPduParms;

        uses SGetParms;

        container source {
          description
            "Particular configuration to retrieve.";
          choice config-source {
            mandatory true;
            leaf candidate {
              if-feature nc:candidate;
              type empty;
              description
                "Only available if 'candidate' capability supported.";
            }
            leaf running {
              type empty;
            }
            leaf startup {
              if-feature nc:startup;
              type empty;
              description
                "Only available if 'startup' capability supported.";
            }
            leaf url {
              if-feature nc:url;
              type nc:ConfigURIType;
              description
                "URL pointing to config data. Only available
                 if 'url' capability supported.";
            }
          }  // choice config-source
        }  // container source
      }

      output {
        anyxml data {
          description
            "The data resulting from the retrieval operation.";
        }
      }
    }  // rpc sget-config

    rpc show {
      description
        "Local show command for yangcli-pro session info.";
      input {
        choice showtype {
          mandatory true;
          leaf cache {
            type empty;
            description
              "Show the yangcli-pro YANG module cache.";
          }
          leaf cli {
            type empty;
            description
              "Show the yangcli-pro CLI parameters.";
          }
          leaf diff {
            type empty;
            description
              "Show the differences between current config
               and the edits that have not been applied yet.";
          }
          leaf edit {
            type empty;
            description
              "Show the subtree that is the current node which
               is from the current edit, not the stored config.";
          }
          leaf connected {
            type empty;
            description
              "Show all connected sessions.";
          }
          leaf module {
            type nt:NcxIdentifier;
            description
              "Show full info for one module loaded
               within the current session.";
          }
          leaf modules {
            type empty;
            description
              "Show info for all modules loaded within the
               current session.";
          }
          leaf modules-state {
            type empty;
            description
              "Show info for cached modules-state for each server.";
          }
          leaf local {
            type nt:NcxName;
            description
              "Show info for one local user variable.";
          }
          leaf locals {
            type empty;
            description
              "Show info for all local user variables.";
          }
          leaf global {
            type nt:NcxName;
            description
              "Show full info for one global user variable.";
          }
          leaf globals {
            type empty;
            description
              "Show info for all global user variables.";
          }
          leaf group-vars {
            type IdentifierOrZero;
            description
              "Show the group-specific user variables for the
               named group. A zero-length string means show
               the variables for the group of the current session.";
          }
          leaf objects {
            type empty;
            description
              "Show config database objects loaded within the
               current session.";
          }

          case running {
            leaf running {
              type empty;
              mandatory true;
              description
                "Show entire config for the current session
                 error if there is no current session.";
            }

            uses SelectParm;
          }  // case running
          leaf session {
            type empty;
            description
              "Show the current session info, including the initial
               server capabilities for the session.";
          }
          leaf session-vars {
            type IdentifierOrZero;
            description
              "Show the session-specific user variables for the
               named session. An empty string means show the
               variables for the current session.";
          }
          leaf system {
            type empty;
            description
              "Show the read-only system environment variables
               and the read-write yangcli-pro program variables.";
          }
          leaf terminal {
            type empty;
            description
              "Show the terminal settings.";
          }
          leaf var {
            type nt:NcxName;
            description
              "Show info for one local or global variable.";
          }
          leaf vars {
            type empty;
            description
              "Show truncated info for all program variables";
          }
          leaf version {
            type empty;
            description
              "Show yangcli-pro version info.";
          }
        }  // choice showtype

        uses ncxapp:HelpMode;
      }
    }  // rpc show

    rpc start-rpc-timing {
      description
        "Start collecting RPC timing statistics for the current session.
         Will set $$echo-replies to false and $$time-rpcs to true
         WIll record stats to output file if specified.";
      input {
        ncx:default-parm "statfile";
        leaf statfile {
          type string {
            length "1 .. max";
          }
          description
            "The file specification for the timing statistics.";
        }
      }
    }  // rpc start-rpc-timing

    rpc start-session {
      description
        "Start an active session from the specified configured
         session.";
      input {
        ncx:default-parm "name";
        leaf name {
          type nt:NcxIdentifier;
          description
            "The name of the session to start.";
        }
      }
    }  // rpc start-session

    rpc start-timer {
      description
        "Start a timer to do simple performance measurements.";
      input {
        ncx:default-parm "id";
        leaf id {
          type TimerId;
          default '0';
          description "The timer ID to use.";
        }

        leaf restart-ok {
          type boolean;
          default 'true';
          description
            "Indicates whether the timer will be used if
             it is already running.  If 'true', the timer
             will be restarted if it is already running.
             If 'false', an error will occur if the timer
             is already running.";
        }
      }
    }  // rpc start-timer

    rpc stop-rpc-timing {
      description
        "Stop collecting RPC timing statistics for the current session.
         Will set session $$echo-replies to true and
         $$time-rpcs-state to false. Will close the stats file,
         if opened.";
    }  // rpc stop-rpc-timing

    rpc stop-session {
      description
        "Terminate an active session.";
      input {
        ncx:default-parm "name";
        leaf name {
          type nt:NcxIdentifier;
          mandatory true;
          description
            "The name of the session to stop.";
        }
      }
    }  // rpc stop-session

    rpc stop-timer {
      description
        "Stop a timer and output the delta value.";
      input {
        ncx:default-parm "id";
        leaf id {
          type TimerId;
          default '0';
          description "The timer ID to use.";
        }

        leaf echo {
          type boolean;
          default 'true';
          description
            "Echo the elapsed time value to screen if in
             interactive mode, as well as the log if the
             log is a file instead of stdout.";
        }
      }

      output {
        leaf delta {
          type decimal64 {
            fraction-digits 6;
          }
          units "seconds";
          description
            "The elapsed time since the timer started.";
        }
      }
    }  // rpc stop-timer

    rpc record-test {
      description
        "Use the unit test-suite automatic test recording feature.
         Only one test can be recorded at a time. Either cancel
         or finish a test in progress in order to start recording
         a new test.";
      input {
        choice record-test-action {
          mandatory true;
          description
            "The recording action to perform.";
          leaf cancel {
            type empty;
            description
              "Stop recording for the specified test in progress,
               and discard the recorded results.";
          }

          case start-case {
            leaf start {
              type empty;
              mandatory true;
              description
                "Start recording for the specified test.";
            }

            leaf suite-name {
              type nt:NcxIdentifier;
              mandatory true;
              description
                "The name of the test-suite that contains the test
                being recorded.";
            }

            leaf test-name {
              type nt:NcxIdentifier;
              mandatory true;
              description
                "The name of the test being recorded.";
            }
          }  // case start-case
          leaf finish {
            type empty;
            description
              "Finish recording for the specified test in progress
               and save the recorded results in the test-suite.";
          }
          leaf pause {
            type empty;
            description
              "Pause recording for the specified test in progress.";
          }
          leaf resume {
            type empty;
            description
              "Resume recording for the specified test in progress.";
          }
        }  // choice record-test-action
      }
    }  // rpc record-test

    rpc terminal {
      description
        "Configure the terminal settings";
      input {
        leaf length {
          type uint16 {
            range "0 .. 511";
          }
          mandatory true;
          description
            "Specifies the length of the terminal to use for page
             mode output with the -More- prompt. This parameter
             is ignored in batch mode. It is only used if the
             output session is operating in interactive mode.

             If the value 0 is used then the 'More' prompt will
             be disabled. Otherwise this value represents the
             number of lines to output for each screen in pagination
             output mode.";
        }
      }
    }  // rpc terminal

    rpc test-suite {
      description
        "Use the unit test-suite feature.";
      input {
        leaf suite-name {
          type nt:NcxIdentifier;
          must "../delete or ../delete-test";
          description
            "The name of the test-suite that contains the test
             being recorded. Used for start, delete, and
             delete-test sub-commands only.";
        }

        leaf log {
          type string;
          must "../start or ../run-all";
          description
            "The file pathspec of the test suite result file
             to use, or an empty string to use STDOUT.";
        }

        choice test-suite-action {
          default 'show-case';
          leaf delete {
            type empty;
            must "../suite-name";
            description
              "Delete the specified test-suite.  The suite-name
               parameter must also be present.";
          }

          case delete-test-case {
            leaf delete-test {
              type empty;
              must "../suite-name";
              description
                "Delete the specified test.  The suite-name
                 and test-name parameters must also be present.";
            }

            leaf test-name {
              type nt:NcxIdentifier;
              mandatory true;
              description
                "The name of the test being recorded.";
            }
          }  // case delete-test-case

          case show-case {
            leaf show {
              type IdentifierOrZero;
              default "";
              description
                "Show the specified test-suite or the current
                 test-suite if an empty string is entered.";
            }

            uses ncxapp:HelpMode;
          }  // case show-case
          leaf load {
            type string;
            default
              "~/.yumapro/yangcli_pro_tests.conf";
            description
              "The file pathspec of the test suite config file
               to load.";
          }
          leaf run-all {
            type empty;
            description
              "Run all the test-suites defined in the test suite
               config file.";
          }
          leaf start {
            type nt:NcxIdentifier;
            description
              "Start running the specified test-suite";
          }
          leaf save {
            type string;
            default
              "~/.yumapro/yangcli_pro_tests.conf";
            description
              "Save the current test-suite configuration to the
               specified (or default) config file.";
          }
        }  // choice test-suite-action
      }
    }  // rpc test-suite

    rpc update-config {
      description
        "Update the configuration cache for the current session.
         The current session must be connected and the
         $$autoconfig system variable must be 'true',
         or an error will be returned.";
    }  // rpc update-config

    rpc unset {
      description
        "Delete a specific yangcli-pro command alias.

         * Delete one alias 'foo':
           yangcli-pro>  unset foo
       ";
      input {
        leaf name {
          type nt:NcxName;
          mandatory true;
          description
            "Name of the yangcli-pro command alias to delete.";
        }
      }
    }  // rpc unset

    rpc uservars {
      description
        "Manage the yangcli-pro user variables";
      input {
        choice uservars-action {
          mandatory true;
          leaf clear {
            type empty;
            description
              "Delete all the yangcli-pro user variables from memory.";
          }
          leaf load {
            type string;
            default
              "~/.yumapro/yangcli_pro_uservars.xml";
            description
              "Load the yangcli-pro user variables from the
               specified XML file spec.  The default user variables
               file will be loaded automatically at startup
               if the '--autouservars' parameter is present.
               The container 'vars' data structure represents
               the format of the XML file expected.";
          }
          leaf save {
            type string;
            default
              "~/.yumapro/yangcli_pro_uservars.xml";
            description
              "Save the yangcli-pro user variables to the
               specified filespec. The default user variables
               file will be saved automatically at shutdown
               if the '--autouservars' parameter is present.
               The container 'vars' data structure represents
               the format of the XML file that will be written.";
          }
        }  // choice uservars-action
      }
    }  // rpc uservars

    rpc while {
      description
        "Evaluate an XPath expression locally on the manager.
         and execute the block of commands that follow
         while the expression is true.  The block ends
         when a matching 'end' command is reached.
        ";
      input {
        ncx:default-parm "expr";
        uses XPathParms;

        leaf maxloops {
          type uint32;
          default '65535';
          description
            "Set a maximum number of loops that can be
             iterated for this while command.
             The value zero means that no maximum will be
             enforced.  Use this mode with caution.";
        }
      }
    }  // rpc while

    rpc xget {
      description
        "Get some NETCONF running config or state data with the get
        operation, using an optional XPath filter.";
      input {
        ncx:default-parm "select";
        uses XGetParms;
      }

      output {
        anyxml data {
          description
            "The data resulting from the retrieval operation.";
        }
      }
    }  // rpc xget

    rpc xget-config {
      description
        "Get some NETCONF config data with the get-config
        operation, using an optional XPath filter.";
      input {
        ncx:default-parm "select";
        uses XGetParms;

        container source {
          description
            "Particular configuration to retrieve.";
          choice config-source {
            mandatory true;
            leaf candidate {
              if-feature nc:candidate;
              type empty;
              description
                "Only available if 'candidate' capability supported.";
            }
            leaf running {
              type empty;
            }
            leaf startup {
              if-feature nc:startup;
              type empty;
              description
                "Only available if 'startup' capability supported.";
            }
            leaf url {
              if-feature nc:url;
              type nc:ConfigURIType;
              description
                "URL pointing to config data. Only available
                 if 'url' capability supported.";
            }
          }  // choice config-source
        }  // container source
      }

      output {
        anyxml data {
          description
            "The data resulting from the retrieval operation.";
        }
      }
    }  // rpc xget-config

    grouping VarsContainer {
    }  // grouping VarsContainer

    uses VarsContainer;

    container saved-devices {
      ncx:abstract;
      description
        "Represents all the saved devices in
         the ~/.yumapro/yangcli_pro_devices file.
         Use the 'devices' command to access this file.
         Edit by hand only if you follow this YANG definition.";
      list device {
        key "name";
        description
          "The list of devices to use during this test-suite.";
        leaf name {
          type nt:NcxName;
          description
            "The name of the saved device.
            The 'device save' command will use the
            string <user>@<server-address> as the default.";
        }

        leaf devicetype {
          type string;
          description
            "Device type for NETCONF devices.";
        }

        leaf server {
          type inet:host;
          mandatory true;
          description
            "IP address or DNS name of the NETCONF server target.";
        }

        leaf ncport {
          type uint16 {
            range "1..max";
          }
          default '830';
          description
            "NETCONF port number to use.  If not present, then
             port 830, followed by port 22, will be tried.";
        }

        uses EntryPointParm;

        uses ncxapp:ProtocolsParm;
      }  // list device
    }  // container saved-devices

    container saved-sessions {
      ncx:abstract;
      description
        "Represents all the saved sessions in
         the ~/.yumapro/yangcli_pro_sessions file.
         Use the 'sessions' command to access this file.
         Edit by hand only if you follow this YANG definition.";
      list session {
        key "name";
        description
          "The list of sessions to use during this test-suite.";
        leaf name {
          type nt:NcxName;
          description
            "The name of the saved session.
            The 'session save' command will use the
            string <user>@<server-address> as the default.";
        }

        leaf device {
          type nt:NcxDeviceName;
          mandatory true;
          description
            "Device name of the NETCONF server target.";
        }

        leaf userid {
          type nt:NcxName;
          mandatory true;
          description
            "User Id of the NETCONF user.";
        }

        leaf user {
          type nt:NcxName;
          mandatory true;
          description
            "The user name of the session.";
        }

        choice pass {
          mandatory true;
          leaf password {
            ncx:password;
            type string;
            description
              "User password to use for NETCONF sessions.
               If none, then user will be prompted before connecting.";
          }
          leaf no-password {
            type empty;
          }
        }  // choice pass

        uses SshKeyParms;

        uses SslKeyParms;

        leaf server {
          type inet:host;
          mandatory true;
          description
            "IP address or DNS name of the NETCONF server target.";
        }

        leaf ncport {
          type uint16 {
            range "1..max";
          }
          default '830';
          description
            "NETCONF port number to use.  If not present, then
             port 830, followed by port 22, will be tried.";
        }

        uses EntryPointParm;

        uses ncxapp:ProtocolsParm;

        container start-commands {
          ywx:cli-text-block;
          description
            "An optional block of yangcli commands to run
             after the session is successfully started.";
        }  // container start-commands

        uses VarsContainer;
      }  // list session

      list group {
        key "name";
        description
          "A list of groups of sessions to manage at once.";
        leaf name {
          type nt:NcxName;
          description
            "The name of the saved group. This name must not conflict
            with any session name.";
        }

        leaf-list session {
          type nt:NcxName;
          description
            "The name of a session that belongs to this group.";
        }

        uses SessionGroupParms;

        uses VarsContainer;
      }  // list group
    }  // container saved-sessions

    container saved-users {
      ncx:abstract;
      description
        "Represents all the saved users in
        the ~/.yumapro/yangcli_pro_users file.
        Use the 'users' command to access this file.
        Edit by hand only if you follow this YANG definition.";
      list userid {
        key "name";
        description
          "The list of users to use.";
        leaf name {
          type nt:NcxName;
          description
            "The id of the saved user.";
        }

        leaf user {
          type nt:NcxName;
          mandatory true;
          description
            "The user name of the session.";
        }

        choice pass {
          mandatory true;
          leaf password {
            ncx:password;
            type string;
            description
              "User password to use for NETCONF users.
               If none, then user will be prompted before connecting.";
          }
          leaf no-password {
            type empty;
          }
        }  // choice pass

        uses SshKeyParms;

        uses SslKeyParms;
      }  // list userid
    }  // container saved-users

    leaf do {
      ncx:abstract;
      ncx:hidden;
      type string;
      description
        "Do <command>, Execute a normal mode command in config mode";
    }

    leaf no {
      ncx:abstract;
      ncx:hidden;
      type string;
      description
        "No <command>, Delete or negate a command in config mode";
    }

    leaf apply {
      ncx:abstract;
      ncx:hidden;
      type empty;
      description
        "Apply the pending edits in config mode";
    }

    leaf return {
      ncx:abstract;
      ncx:hidden;
      type empty;
      description
        "Exit all config sub-modes and discard any pending edits";
    }

    container pipe {
      ncx:abstract;
      ncx:hidden;
      description
        "Pipe command sub-commands.
         The 'begin', 'include', and 'exclude' parameters are used
         to filter command output. If these parameters contain
         any pattern meta-characters, then they will be treated
         as a YANG pattern string.  If a plain string is found
         instead, then this string must be found in the line
         to be considered a match.

         Each output line is processed in the following manner:
           1) if begin set and not triggered yet, then test
              the line. If a match then disable this step
              for future lines and continue testing output,
              else skip this line.
           2) check each exclude parameter. If any match then
              skip this line.
           3) check each include parameter. If any match then
              include this line, else skip this line.
           4) include the line in the output.

         If the 'redirect' parameter is present then the filtered
         output will be sent to a file instead of the session.

         If the 'display'parameter is present then the specifed
         display format will be used for the output and the
         filtering format. By default, the current display-mode
         is used for both filtering and output formats.";
      leaf begin {
        type string;
        description
          "Specifies the pipe begin line pattern.";
      }

      leaf-list include {
        type string;
        description
          "Specifies a pipe include line pattern.
           Multiple parameters are treated as a logical-OR
           expression.";
      }

      leaf-list exclude {
        type string;
        description
          "Specifies a pipe exclude line pattern.
           Multiple parameters are treated as a logical-OR
           expression.";
      }

      leaf redirect {
        type string;
        description
          "Specifies the pipe output redirect filespec.
           If this filespec already exists then output
           will be appended to the file.";
      }

      leaf display {
        type enumeration {
          enum "xml" {
            value 0;
            description
              "Display output in XML";
          }
          enum "json" {
            value 1;
            description
              "Display output in JSON";
          }
          enum "curmode" {
            value 2;
            description
              "Display output is the current $$display-mode";
          }
        }
        default "curmode";
        description
          "Specifies the pipe output display format.";
      }
    }  // container pipe
  }  // module yangcli-pro