| yangcli(1) | yangcli 2.13 | yangcli(1) |
yangcli - YANG-based NETCONF-over-SSH client application
yangcli [parameter=value...] yangcli --help [brief | normal | full] yangcli --version
yangcli is a Command Line Interface for the NETCONF protocol. It uses the YANG data modeling language to manage the NETCONF content layer. This version of yangcli supports the YANG data modeling language defined in RFC 6020.
Normal Mode:
An interactive CLI shell with command line history.
Autostart-mode:
If the 'server' parameter is present, then yangcli 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.
Parameters can be entered in any order, and have the form:
[start] name [separator [value]]
where:
start == 0, 1, or 2 dashes (foo, -foo, --foo)
name == parameter name
Parameter name completion will be attempted
if a partial name is entered.
value == string value for the parameter.
Strings with whitespace need to be double quoted
(--foo="some string")
Some examples of valid command line parameters:
foo=3 -foo=3 --foo=3 foo 3 foo=fred --foo "fred flintstone"
Partial parameter names can be entered if they are unique.
enum values:
ignore
Silently accept invalid PDU and data model
parameters. Intended for advanced server
testing mode only.
warn
Warn, but accept invalid PDU and data model
parameters.
check
Prompt the user to keep the invalid value
or re-enter the value.
error
Prompt the user to re-enter the invalid value.
Deviations are applied as patches to the target module. Since they are not identified in the target module at all (ala imports), they have to be specified explicitly, so they will be correctly processed. Zero or more instances of this parameter are allowed.
enum values:
plain
Plain identifier without any prefix format.
prefix
Plain text with XML prefix added format.
module
Plain text with module name as prefix added format.
xml
XML format.
xml-nons
XML format, but without any namespace (xmlns) attributes.
json
JSON format.
--dump-session=/tmp/ses- The following files are created:
* /tmp/ses-out - session data sent to server
* /tmp/ses-in - session data received from server
* /tmp/ses-out.ts - size and timestamp for data transmitted
* /tmp/ses-in.ts - size and timestamp for data received
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.
If true, <rpc> messages will be output to the log, if log-level is 'info' or higher. If false, <rpc> messages will not be output to the log, regardless of the value of log-level.
enum values:
candidate
Force default edit target to be candidate.
running
Force default edit target to be running.
enum values:
off
error
warn
info
debug
debug2
debug3
debug4
enum values:
exact
The name must exactly match the node name
for all characters in both name strings.
exact-nocase
The name must match the node name
for all characters in both name strings.
Strings are not case-sensitive.
one
The name must exactly match the first N
characters of just one node name, which
must be the only partial name match found.
one-nocase
The name must exactly match the first N
characters of just one node name, which
must be the only partial name match found.
Strings are not case-sensitive.
first
The name must exactly match the first N
characters of any node name. The first one
found will be used.
first-nocase
The name must exactly match the first N
characters of any node name. The first one
found will be used. Strings are not
case-sensitive.
If this string represents a module name, then the module search path will be checked for a file the .yang or .yin extension.
If this string begins with a '~' character, then a username is expected to follow or a directory separator character. If it begins with a '$' character, then an environment variable name is expected to follow.
~/some/path ==> <my-home-dir>/some/path
~fred/some/path ==> <fred-home-dir>/some/path
$workdir/some/path ==> <workdir-env-var>/some/path
bit values:
netconf1.0
RFC 4741 base:1.0
netconf1.1
RFC xxxx base:1.1
If true, then these file search paths will include sub-directories, if present. Any directory name beginning with a dot (.) character, or named CVS, will be ignored. This is the default mode.
enum values:
ssh
NETCONF over SSH.
RFC 4742; RFC 6242
tcp
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.
When a module name is entered as input, or when a module or submodule name is specified in an import or include statement within the file, the following search algorithm is used to find the file:
1) file is in the current directory
2) YUMA_MODPATH environment var (or set by modpath parameter)
3) $HOME/modules directory
4) $YUMA_HOME/modules directory
5) $YUMA_INSTALL/modules directory OR
default install module location, '/usr/share/yuma/modules'
By default, the entire directory tree for all locations (except step 1) will be searched, not just the specified directory. The subdirs parameter can be used to prevent sub-directories from being searched.
Any directory name beginning with a dot character (.) will be skipped. Also, any directory named CVS will be skipped in directory searches.
By default, warnings and errors are sent to STDOUT.
A log file can be specified instead with the log' parameter.
Existing log files can be reused with the 'logappend' parameter, otherwise log files are overwritten.
The logging level can be controlled with the log-level parameter.
The default log level is 'info'. The log-levels are additive:
off: suppress all errors (not recommended!)
A program return code of '1' indicates some error.
error: print errors
warn: print warnings
info: print generally interesting trace info
debug: print general debugging trace info
debug2: print verbose debugging trace info
debug3: print very verbose debugging trace info
debug4: print maximum debugging trace info
The following optional environment variables can be used to control module search behavior:
An ASCII configuration file format is supported to store command line parameters.
The config parameter is used to specify a specific config file, otherwise the default config file will be checked.
- A hash mark until EOLN is treated as a comment
- All text is case-sensitive
- Whitespace within a line is not significant
- Whitespace to end a line is significant/
Unless the line starts a multi-line string,
an escaped EOLN (backslash EOLN) is needed
to enter a leaf on multiple lines.
- For parameters that define lists, the key components
are listed just after the parameter name, without
any name, e.g.,
interface eth0 {
# name = eth0 is not listed inside the braces
ifMtu 1500
ifName mySystem
}
A config file can contain any number of parameter sets for different
programs.
Each program must have its own section, identifies by its name:
# this is a comment
yangcli {
log-level debug
default-module yuma-interfaces
}
The following data files must be present in the module search path in order for this program to function:
* YANG module library
default: /usr/share/yuma/modules/
* yangcli command aliases
default: ~/.yuma/.yangcli_aliases
CLI parameters: --autoaliases, --aliases-file
See the 'aliases' and 'alias' command for details.
The format of the aliases file is text.
A comment is a line that begins with a '#' character,
and will be ignored. Comments are not saved if the
--autoaliases=true parameter value is used.
Single or double quotes can be used.
Example aliases file:
---------------------
g=get
gc=get-config
gcnacm='sget-config --source=running /nacm'
geteth0="xget /interfaces/interface[name='eth0']"
Internal diagnostics may generate the following type of message if any bugs are detected at runtime:
[E0]
filename.c:linenum error-number (error-msg)
Andy Bierman, <andy at netconfcentral dot org>
Vladimir Vassilev, <vladimir at lightside-instruments dot com>
netconf-subsystem(1) netconfd(1)
| November 30, 2022 | Linux |