module yangcli-pro { 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 ."; 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-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= parameter to FillParms grouping to allow URL encoded requests to be converted to XPath before use. Added --use-xmlheader= 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 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 { description "Number of log entries. -1 means all entries"; type int32 { range "-1 | 1 .. max"; } } typedef LogIndex { description "Index into a log buffer."; type uint32; } typedef TimerId { description "Identifier for a local timer to use with the start-timer and stop-timer commands."; type uint8 { range "0 .. 15"; } } typedef YangcliVariableType { description "yangcli-pro user and system variable types"; type enumeration { enum session { description "Session variable (for future use)"; } enum local { description "Local user variable"; } enum config { description "User configuration variable"; } enum global { description "Global user variable"; } enum system { description "System variable"; } enum queue { description "System internal Queue variable"; } } } typedef test-result-type { type enumeration { enum skipped { description "Test was skipped."; } enum pass { description "Test passed."; } enum fail { 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 { description "Specifies how edits will be applied in config mode."; type enumeration { enum line { description "Automatically apply a config mode edit after each line"; } enum level { description "Automatically apply a config mode edit when the current level is exited."; } enum manual { description "Only apply a config mode edit manually with the 'apply' command."; } } } /************************************************************* * * Groupings for parameters used in multiple commands * *************************************************************/ 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 FillParms { choice target-parm { leaf target { 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."; type yang:xpath1.0 { length "1..max"; } mandatory true; } case urltarget-case { leaf urltarget { description "URL encoded target object to fill. Encoding Rules: TBD."; type ywt:UrlPath; mandatory true; } uses ywapp:MatchParms { description "These parameters are only supported for the 'urltarget' parameter."; } } } leaf optional { description "If present, then prompt for leafs that are optional. If not, skip these objects."; type empty; } 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 CommonPduParms { description "Common parms for some local commands that generate NETCONF PDUs"; choice from { mandatory true; leaf varref { description "Use the contents of the specified variable as the content"; type string; } case from-cli { uses FillParms; } } } grouping EditParms { description "Common parms for create, merge, replace commands"; uses CommonPduParms; leaf timeout { description "Timeout to use"; type nt:Timeout; } } grouping SGetParms { description "Common parms for sget and sget-config operations."; leaf nofill { 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."; type empty; } uses ncxapp:CliWithDefaultsParm; uses yrc:depth-parameter; } grouping XGetParms { description "Common parms for xget and xget-config operations."; choice from { mandatory true; leaf varref { description "Use the contents of the specified variable as the content"; type string; } case select { uses SelectParm; } leaf urltarget { description "The URL path expression to use in the retrieval operation."; type ywt:UrlPath; } } leaf timeout { description "Timeout to use"; type nt:Timeout; } uses ncxapp:CliWithDefaultsParm; uses yrc:depth-parameter; uses ywapp:MatchParms { description "These parameters are ignored unless the 'urltarget' parameter is also present."; } } 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 SshKeyParms { leaf public-key { type string { length "1 .. max"; } 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."; default "$HOME/.ssh/id_rsa.pub"; } leaf private-key { type string { length "1 .. max"; } 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."; default "$HOME/.ssh/id_rsa"; } } 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"; } 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."; default "$HOME/.ssl/yangapi-client.crt"; } leaf ssl-key { type string { length "1 .. max"; } 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."; default "$HOME/.ssl/yangapi-client.key"; } leaf ssl-trust-store { type string { length "1 .. max"; } 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."; default "$HOME/.ssl/trust-store.pem"; } } 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 { description "User name to use for NETCONF sessions."; type nt:NcxUserName; } leaf server { description "IP address or DNS name of the NETCONF server target."; type inet:host; } choice pass { leaf password { description "User password to use for NETCONF sessions. If none, then user will be prompted before connecting."; type string; ncx:password; } leaf no-password { description "Indicates that no user password is needed for the connection."; type empty; } } leaf ncport { description "NETCONF port number to use. If not present, then port 830, followed by port 22, will be tried."; type uint16 { range "1..max"; } default 830; } leaf timeout { description "Number of seconds to wait for a response from the server before declaring a timeout. Zero means do not timeout at all."; type nt:Timeout; } uses SshKeyParms; uses SslKeyParms; uses ncxapp:ProtocolsParm; uses EntryPointParm; leaf transport { description "Identifies the transport protocol that should be used."; type enumeration { enum ssh { description "NETCONF over SSH."; reference "RFC 4742; RFC 6242"; } enum tcp { 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 { 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 "; } enum tls { description "If this enum is selected the restconf client will try to communicate with web server using https protocol."; reference "RFC 2818"; } enum coap { 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 "; } } default ssh; } leaf encoding { description "Identifies the desired encoding format. Only supported for RESTCONF and YANG-API at this time."; type ywt:encoding-type; default xml; } } grouping XPathParms { description "Common parameters used for XPath script constructs"; leaf expr { description "XPath expression string to evaluate. Use quotes if there are any whitespace or special characters in the expression."; type yang:xpath1.0 { length "1..max"; } mandatory true; } 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 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; default 10; units seconds; 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."; } } /************************************************************* * * CLI parameter set for yangcli-pro program * *************************************************************/ container yangcli-pro { ncx:cli; description "CLI Parameter Set for the NETCONF Client Application."; 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; } } leaf ask-password { 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."; type boolean; default true; } leaf aliases-file { description "Specifies the yangcli-pro command aliases file to use."; type string; default "~/.yumapro/.yangcli_pro_aliases"; } leaf autocomp { 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."; type boolean; default true; } leaf autoconfig { 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."; type boolean; default false; } leaf autoconfig-conf-mode { 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."; type boolean; default true; } leaf autoaliases { 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."; type boolean; default true; } leaf autoload { 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."; type boolean; default true; } leaf autoload-get { description "Controls whether the operation will be used to retrieve the /netconf-state/schemas sub-tree. If 'true', then the schema list will be used instead of the message module capabilities, if the server supports the 'ietf-netconf-monitoring' module. If 'false', then just the message module list will be used to retrieve YANG modules with the operation. This option is needed to autoload sub-modules that are not available to yangcli-pro, since YANG submodules are not advertised in the message."; type boolean; default true; } leaf autoload-cache { description "Controls whether the modules retrieved with the operation are cached for use by the running instance of yangcli-pro. If true, then the YANG modules that are retrieved with the operation will be cached. A cached module will be used by yangcli-pro instead of calling , if that module revision is requested again. If false, then the YANG modules that are retrieved with the operation will not be cached."; type boolean; default true; } leaf autoload-save-cache { description "Controls whether the modules held in the YANG module cache (retrieved with the 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."; type boolean; default true; } leaf auto-keepalive { 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."; type boolean; default false; } leaf auto-reconnect { 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."; type boolean; default true; } leaf auto-reconnect-interval { description "Number of seconds to wait after first retry. The first retry will be done right away."; type uint16 { range "1 .. 3600"; } units seconds; default 10; } leaf auto-reconnect-max { description "Number of times to retry the connection. Zero means no limit, otherwise re-connect attempts will stop after this number of failures."; type uint16; default 5; } leaf autodevices { 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."; type boolean; default true; } leaf autohistory { 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."; type boolean; default true; } leaf autonotif { description "Controls whether notifications will automatically be enabled when a session starts. By default, notifications will not be enabled. If enabled, a operation will be performed when the session starts, and notification events for the sesion will be monitored."; type boolean; default false; } leaf autonvsave { 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."; type boolean; default true; } leaf autosessions { 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."; type boolean; default true; } leaf autotest { 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."; type boolean; default true; } leaf autousers { 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."; type boolean; default true; } leaf autouservars { 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."; type boolean; default true; } leaf bad-data { description "Specifies how invalid user input from the CLI will be handled when filling PDUs for remote operations."; type enumeration { enum ignore { description "Silently accept invalid PDU and data model parameters. Intended for advanced server testing mode only."; } enum warn { description "Warn, but accept invalid PDU and data model parameters."; } enum check { description "Prompt the user to keep the invalid value or re-enter the value."; } enum error { description "Prompt the user to re-enter the invalid value."; } } default "check"; } leaf batch-mode { 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."; type empty; } leaf callhome-address { description "Identifies the IP address that should be used to listen for callhome connections. Ignored if callhome-enabled is false."; type inet:ip-address; default "0.0.0.0"; } leaf callhome-enabled { description "If true, then yangcli-pro will listen for SSH CallHome connections on the socket identified by the callhome-address and callhome-port parameters."; type boolean; default false; } 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 { 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."; type nt:NcxUserName; } leaf check-output { 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 element are not done. Also the $$check-output global parameter."; type boolean; default true; } leaf check-output-error { description "If 'true', then errors found during the check-output validation tests will be treated as errors, causing the 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."; type boolean; default false; } leaf check-replies { 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 sent from a server session. If the 'output' section is missing or empty, then the will be checked to make sure it contains either or 1 or more elements. Also the $$check-replies global parm."; type boolean; default true; } leaf check-replies-error { 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 about to be processed to be rejected."; type boolean; default false; } leaf config-edit-mode { description "Controls how edits are applied during config mode."; type config-edit-mode-type; default level; } leaf config-autosave { 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."; type boolean; default true; } leaf default-module { 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."; type nt:NcxName; } leaf-list disable-command { 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 operation: disable-command ietf-netconf:delete-config "; type nt:NcxIdentifier; } leaf display-mode { description "Controls how values are displayed during output to STDOUT or a log file."; type enumeration { enum plain { description "Plain identifier without any prefix format."; } enum prefix { description "Plain text with XML prefix added format."; } enum module { description "Plain text with module name as prefix added format."; } enum xml { description "XML format."; } enum xml-nons { description "XML format, but no namespace (xmlns) attributes will be generated."; } enum json { description "JSON format."; } } default plain; } leaf echo-notif-loglevel { 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."; type nt:NcDebugType; default debug; } leaf echo-notifs { description "Allow notifications to be echoed to the log or STDOUT If 'true', 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', messages will not be output to the log. The $$echo-notifs system variable is derived from this parameter."; type boolean; default true; } leaf echo-replies { description "Allow RPC replies to be echoed to the log or STDOUT If 'true', messages containing data will be output to the log, if log-level is 'info' or higher. If 'false', 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."; type boolean; default true; } leaf fixorder { 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"; type boolean; default true; } leaf force-target { description "Controls whether the candidate or running configuration datastore will be used as the default edit target, when both are supported by the server."; type enumeration { enum candidate { description "Force default edit target to be candidate."; } enum running { description "Force default edit target to be running."; } } default candidate; } uses ncxapp:ModuleParm; uses ncxapp:DeviationParm; uses ncxapp:DatapathParm; uses ncxapp:RunpathParm; 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 { description "Disables the alias substitution feature. The alias file will not be read. The aliases and alias commands will be disabled."; type empty; } leaf prompt-name { description "Customize a prompt name for yp-shell."; type string { length "1 .. 512"; } } leaf prompt-type { description "Selects the type of prompt string that will be used in interactive mode."; type ywt:show-mode; default normal; } choice run-startup-mode { leaf run-script { 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."; type string { length "1 .. 4095"; } } leaf run-command { 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."; type string { length "1 .. 4095"; } } } leaf script-input { 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."; type boolean; default true; } leaf server-commands { 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."; type boolean; default true; } leaf test-suite-file { description "Specifies the yangcli-pro test suite config file to use."; type string; default "~/.yumapro/yangcli_pro_tests.conf"; } leaf time-rpcs { description "Measure the round-trip time of each request and 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."; type boolean; default false; } leaf time-rpcs-stats { 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."; type boolean; default false; } leaf time-rpcs-stats-file { 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."; type string { length "1 .. max"; } default "~/yangcli_pro_rpc_stats.txt"; } leaf uservars-file { description "Specifies the yangcli-pro user variables file to use."; type string; default "~/.yumapro/yangcli_pro_uservars.xml"; } leaf use-rawxml { 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."; type boolean; default false; } leaf use-traceid { description "Controls whether the 'trace-id' attribute will be set in the RPC requests or not. By default, 'trace-id' will be disabled."; type boolean; default false; } leaf use-xmlheader { description "Specifies how file result variables will be written for XML files. Controls whether the XML preamble header will be written or not."; type boolean; default true; } } /************************************************************* * * RPC methods for local commands within yangcli-pro * * NOTE TO DEVELOPERS: * When adding a global command that can be used even if there * is no connected session, then you MUST add the command name * to the yangcli_util:is_top_command function * * When adding a command that can be used with the config mode * 'do' command, then you MUST add the command name * to the yangcli_util:is_do_command function *************************************************************/ 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 { description "Timeout to use"; type nt:Timeout; } } } 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 { description "The alias command string."; type string { length "1 .. max"; } } } } rpc aliases { description "Manage the yangcli-pro command aliases"; input { choice alias-action { default show; leaf show { description "Show all the yangcli-pro command aliases."; type empty; } leaf clear { description "Delete all the yangcli-pro aliases from memory."; type empty; } leaf load { 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."; type string; default "~/.yumapro/.yangcli_pro_aliases"; } leaf save { 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."; type string; default "~/.yumapro/.yangcli_pro_aliases"; } } } } rpc auto-test { description "Run automatic edit testing on the specified object"; input { ncx:default-parm target; leaf target { type string; ncx:schema-instance; 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."; } /* TBD: not implemented yet leaf count { type uint32 { range "1..max"; } default 1; description "Number of instances to create in each commit"; } */ leaf iterations { type uint32 { range "1..max"; } default 1; description "Number of commits to make."; } } } 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 { description "Clear the YANG module cache on disk."; type empty; } case delete-cache { leaf delete { mandatory true; description "Name of the module to delete from the YANG module cache."; type nt:NcxIdentifier; } leaf revision { description "Revision date of the module to delete from the YANG module cache. OIf missing then all revisions will be deleted from the cache."; type nt:Date; } } // case delete-cache } // choice cache-input } } rpc cd { description "Change the current working directory."; input { ncx:default-parm dir; leaf dir { description "Directory path to use."; type string; mandatory true; } } } 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 { description "Use the terminal for configuration input."; type empty; } } } } 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 create { description "Create some NETCONF config data with the edit-config operation"; input { ncx:default-parm target; uses EditParms; } } 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 { description "Xpath expression indicating the node which is going to be deleted."; type string; } leaf urltarget { description "The URL path expression to use in the delete operation."; type ywt:UrlPath; } } 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-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 { description "Xpath expression indicating the list or leaf-list nodes which are going to be deleted."; type string; } leaf urltarget { description "The URL path expression to use in the delete operation."; type ywt:UrlPath; } } } } 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 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 end { description "End an 'if' command block or a 'while' command block. If no block is in progress then an error will occur. "; } 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: - is a simple type - contains 1 node that is a simple type Remove the container: - contains a single complex element Retain the container: - 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 { 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."; mandatory true; } } } rpc eventlog { description "Access the notification event log"; input { ncx:default-parm show; choice eventlog-action { default show-case; case show-case { leaf show { 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."; type LogCount; default -1; } leaf start { description "Start at the specified event index number instead of the beginning of the event log."; type LogIndex; } uses ncxapp:HelpMode; } leaf clear { description "Clear the specified number of notification event log entries. The value -1 means clear all the entries."; type LogCount; default 25; } } } } 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 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 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 { 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."; type nt:Timeout; default 120; } leaf retry-interval { 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."; units seconds; type uint32 { range "1 .. 300"; } default 2; } leaf cleanup { description "Indicates whether the locks obtained should be automatically released if an RPC operation fails (after the get-locks succeeds)."; type boolean; default true; } } } 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 create-case { leaf create { type nt:NcxIdentifier; description "Name of the group to create. The 'session' parameter must also be present"; } } case delete-case { leaf delete { type nt:NcxIdentifier; description "Name of the group to delete"; } } case add-case { leaf add { type nt:NcxIdentifier; description "Name of the group to add some sessions. The 'session' parameter must also be present."; } } case remove-case { leaf remove { type nt:NcxIdentifier; description "Name of the group to remove some sessions. The 'session' parameer must also be present."; } } case show-case { leaf show { type nt:NcxIdentifier; description "Name of the group to show"; } } case list-case { leaf list { type empty; description "List the names of all the groups"; } } } leaf-list session { when "../create or ../add or ../remove"; min-elements 1; type nt:NcxIdentifier; description "Name of a session that is being added to the group."; } } } rpc help { description "Print the yangcli-pro help text"; input { ncx:default-parm command; choice helptype { leaf command { description "Show help for the specified command, also called an RPC method"; type nt:NcxIdentifier; } leaf commands { description "Show info for all local commands"; type empty; } leaf notification { description "Show help for the specified notification"; type nt:NcxIdentifier; } leaf object { description "Show help for the specified object"; type union { type nt:NcxIdentifier; type ywt:UrlPath; } } leaf type { description "Show help for the specified type"; type nt:NcxIdentifier; } } uses ncxapp:HelpMode; } } 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 { description "Show the specified number of history buffer entries. -1 means show all entries."; type LogCount; default 25; } uses ncxapp:HelpMode; } leaf clear { description "Clear all the history buffer entries."; type empty; } leaf load { description "Load the command history buffer from the specified file spec."; type string; default "~/.yumapro/.yangcli_pro_history"; } leaf save { description "Save the command history buffer in the specified filespec."; type string; default "~/.yumapro/.yangcli_pro_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 insert { description "Insert some NETCONF config data with the edit-config operation"; input { ncx:default-parm target; uses EditParms; leaf order { 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."; type enumeration { enum first; enum last; enum before; enum after; } default last; } leaf operation { description "The edit-config operation that should be used."; type enumeration { enum create; enum merge; enum replace; } default merge; } leaf edit-target { 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]."; type string; } } } rpc list { description "List some NETCONF info."; input { choice listtype { mandatory true; leaf commands { description "List all local and remote commands"; type empty; } leaf files { description "List all available data files."; type empty; } leaf objects { description "List all available top-level object names."; type empty; } leaf oids { description "List all available object identifiers."; type empty; } leaf modules { description "List all available local YANG files."; type empty; } leaf scripts { description "List all available script files."; type empty; } } leaf module { description "List only from this module, if specified."; type nt:NcxIdentifier; } uses ncxapp:HelpMode; } } 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 { description "The formatted text string to write to the log."; type string; mandatory true; } } } 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 { description "The formatted text string to write to the log."; type string; mandatory true; } } } 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 { description "The formatted text string to write to the log."; type string; mandatory true; } } } 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 { description "The formatted text string to write to the log."; type string; mandatory true; } } } rpc merge { description "Merge some NETCONF config data with the edit-config operation"; input { ncx:default-parm target; uses EditParms; } } 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 { description "Module name to load"; type nt:NcxName; mandatory true; } leaf revision { description "Module revision to load."; type nt:Date; } uses ncxapp:DeviationParm; } } rpc pwd { description "Print the current working directory."; } rpc nvsave { description "Save the running datastore to the startup datastore."; } rpc quit { description "Quit the yangcli-pro application"; } rpc recall { description "Recall the specified command line history buffer entry into the current command line."; input { ncx:default-parm index; leaf index { description "Index [0..N] of the command line history entry to recall."; type LogIndex; mandatory true; } } } rpc release-locks { description "Unlock all the server databases that were previously locked with the get-locks command."; } rpc replace { description "Create some NETCONF config data with the edit-config operation"; input { ncx:default-parm target; uses EditParms; } } rpc remove { description "Remove some NETCONF config data with the edit-config operation"; input { ncx:default-parm target; leaf target { description "Xpath expression indicating the node which is going to be deleted."; type string; mandatory true; } 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-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 { description "Xpath expression indicating the list or leaf-list nodes which are going to be removed."; type string; } leaf urltarget { description "The URL path expression to use in the remove operation."; type ywt:UrlPath; } } } } rpc run { description "Internal command to run a script."; input { ncx:default-parm script; leaf script { description "script filespec to run"; type string; mandatory true; } // hardwired parameter names required at this time // just allow 9 parameter/value pairs // P0 is reserved for the name of the called script leaf P1 { description "script parameter $1"; type string; } leaf P2 { description "script parameter $2"; type string; } leaf P3 { description "script parameter $3"; type string; } leaf P4 { description "script parameter $4"; type string; } leaf P5 { description "script parameter $5"; type string; } leaf P6 { description "script parameter $6"; type string; } leaf P7 { description "script parameter $7"; type string; } leaf P8 { description "script parameter $8"; type string; } leaf P9 { description "script parameter $9"; type string; } } } rpc save { description "Meta command to save configuration edits."; } 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; } 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."; } } } } 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; } 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 { description "Load the saved sessions in memory from the specified file spec."; type string; default "~/.yumapro/.yangcli_pro_devices.conf"; } leaf save { description "Save the current saved devices in memory to the specified saved users filespec."; type string; default "~/.yumapro/.yangcli_pro_devices.conf"; } } } } rpc session { description "Access an active session"; input { leaf set-current { mandatory true; type nt:NcxIdentifier; description "Set the specified session or group as the current session. The named session or group must already be loaded in memory."; } } } 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; } 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."; } } } } 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; } 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 { type string; ncx:password; mandatory true; description "An user password to use to create a new user."; } } // case create } } } 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; } 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 { description "Load the saved users in memory from the specified file spec."; type string; default "~/.yumapro/.yangcli_pro_users.conf"; } leaf save { description "Save the current saved users in memory to the specified saved users filespec."; type string; default "~/.yumapro/.yangcli_pro_users.conf"; } } } } 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; } 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 { description "Load the saved sessions in memory from the specified file spec."; type string; default "~/.yumapro/.yangcli_pro_sessions.conf"; } leaf save { description "Save the current saved sessions in memory to the specified saved sessions filespec."; type string; default "~/.yumapro/.yangcli_pro_sessions.conf"; } } } } 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-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; description "Only available if 'candidate' capability supported."; type empty; } leaf running { type empty; } leaf startup { if-feature nc:startup; description "Only available if 'startup' capability supported."; type empty; } leaf url { if-feature nc:url; description "URL pointing to config data. Only available if 'url' capability supported."; type nc:ConfigURIType; } } } } output { anyxml data { description "The data resulting from the retrieval operation."; } } } rpc show { description "Local show command for yangcli-pro session info."; input { choice showtype { mandatory true; leaf cache { description "Show the yangcli-pro YANG module cache."; type empty; } leaf cli { description "Show the yangcli-pro CLI parameters."; type empty; } leaf diff { description "Show the differences between current config and the edits that have not been applied yet."; type empty; } leaf edit { description "Show the subtree that is the current node which is from the current edit, not the stored config."; type empty; } leaf connected { description "Show all connected sessions."; type empty; } leaf module { description "Show full info for one module loaded within the current session."; type nt:NcxIdentifier; } leaf modules { description "Show info for all modules loaded within the current session."; type empty; } leaf modules-state { description "Show info for cached modules-state for each server."; type empty; } leaf local { description "Show info for one local user variable."; type nt:NcxName; } leaf locals { description "Show info for all local user variables."; type empty; } leaf global { description "Show full info for one global user variable."; type nt:NcxName; } leaf globals { description "Show info for all global user variables."; type empty; } leaf group-vars { 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."; type IdentifierOrZero; } leaf objects { description "Show config database objects loaded within the current session."; type empty; } case running { leaf running { description "Show entire config for the current session error if there is no current session."; type empty; mandatory true; } uses SelectParm; } leaf session { description "Show the current session info, including the initial server capabilities for the session."; type empty; } leaf session-vars { description "Show the session-specific user variables for the named session. An empty string means show the variables for the current session."; type IdentifierOrZero; } leaf system { description "Show the read-only system environment variables and the read-write yangcli-pro program variables."; type empty; } leaf var { description "Show info for one local or global variable."; type nt:NcxName; } leaf vars { description "Show truncated info for all program variables"; type empty; } leaf version { description "Show yangcli-pro version info."; type empty; } } // end choice uses ncxapp:HelpMode; } } 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-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-timer { description "Start a timer to do simple performance measurements."; input { ncx:default-parm id; leaf id { description "The timer ID to use."; type TimerId; default 0; } leaf restart-ok { 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."; type boolean; default true; } } } 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-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-timer { description "Stop a timer and output the delta value."; input { ncx:default-parm id; leaf id { description "The timer ID to use."; type TimerId; default 0; } leaf echo { 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."; type boolean; default true; } } output { // yangcli-pro local RPC commands can return 1 value of any type // as an output parameter. No extra parameters will be // processed in assignment statements leaf delta { description "The elapsed time since the timer started."; type decimal64 { fraction-digits 6; // microseconds } units seconds; } } } 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."; } } 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."; } } } } 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 { must "../suite-name"; type empty; description "Delete the specified test-suite. The suite-name parameter must also be present."; } case delete-test-case { leaf delete-test { must "../suite-name"; type empty; 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 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; } 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 { description "Run all the test-suites defined in the test suite config file."; type empty; } 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."; } } } } 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 unset { description "Delete a specific yangcli-pro command alias. * Delete one alias 'foo': yangcli-pro> unset foo "; input { leaf name { description "Name of the yangcli-pro command alias to delete."; type nt:NcxName; mandatory true; } } } rpc uservars { description "Manage the yangcli-pro user variables"; input { choice uservars-action { mandatory true; leaf clear { description "Delete all the yangcli-pro user variables from memory."; type empty; } leaf load { 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."; type string; default "~/.yumapro/yangcli_pro_uservars.xml"; } leaf save { 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."; type string; default "~/.yumapro/yangcli_pro_uservars.xml"; } } } } 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 { 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."; type uint32; default 65535; } } } 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-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; description "Only available if 'candidate' capability supported."; type empty; } leaf running { type empty; } leaf startup { if-feature nc:startup; description "Only available if 'startup' capability supported."; type empty; } leaf url { if-feature nc:url; description "URL pointing to config data. Only available if 'url' capability supported."; type nc:ConfigURIType; } } } } output { anyxml data { description "The data resulting from the retrieval operation."; } } } /************************************************************* * * Config file templates for uservars and sessions-cfg commands * *************************************************************/ grouping VarsContainer { container vars { //ncx:abstract; ncx:hidden; description "Represents all saved yangcli-pro user variables"; list var { description "Data structure to save one yangcli-pro user variable"; key name; leaf name { type nt:NcxName; description "Name of the user variable"; } leaf target { //need to treat as string in case referenced modules //are not loaded when yangcli-pro starts //ncx:schema-instance; type string; description "Target variable if variable represents a node from a datastore."; } leaf vartype { type YangcliVariableType; description "User variable type; only 'global' variables can be saved in the yangcli-pro uservars file."; default global; } anyxml value { description "Node value renamed to 'value' since YANG requires each node to have a consistent name."; } } } } 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 { description "The list of devices to use during this test-suite."; key name; leaf name { type nt:NcxName; description "The name of the saved device. The 'device save' command will use the string @ 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; } } 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 { description "The list of sessions to use during this test-suite."; key name; leaf name { type nt:NcxName; description "The name of the saved session. The 'session save' command will use the string @ 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 { type string; ncx:password; description "User password to use for NETCONF sessions. If none, then user will be prompted before connecting."; } leaf no-password { type empty; } } 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."; } uses VarsContainer; } list group { description "A list of groups of sessions to manage at once."; key name; 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; } } 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 { description "The list of users to use."; key name; 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 { type string; ncx:password; description "User password to use for NETCONF users. If none, then user will be prompted before connecting."; } leaf no-password { type empty; } } uses SshKeyParms; uses SslKeyParms; } } /*** Abstract Objects For Internal Use Only ***/ leaf do { ncx:abstract; ncx:hidden; type string; description "Do , Execute a normal mode command in config mode"; } leaf no { ncx:abstract; ncx:hidden; type string; description "No , 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"; } }