blob: 145beb10c7570aa9f4abcf807bfc298bf32523d8 [file] [log] [blame]
.\" Manpage for yanglint.
.\" Process this file with
.\" groff -man -Tascii yanglint.1
.\"
.TH YANGLINT 1 "2016-10-27" "libyang"
.SH NAME
yanglint \- YANG lint tool
.
.SH SYNOPSIS
.B yanglint
.br
.B yanglint
[\fIOPTIONS\fP]
[\-f { \fByang\fP | \fByin\fP | \fBtree\fP } ]
.I FILE ...
.br
.B yanglint
[\fIOPTIONS\fP]
[\-f { \fBxml\fP | \fBjson\fP } ]
\fISCHEMA\fP...
\fIFILE\fP...
.
.SH DESCRIPTION
\fByanglint\fP is a command-line tool for validating and converting YANG
schemas and the YANG modeled data. For a simple use, it validates the provided
file and if the output format specified, it converts input data into the output
format. If started with no argument, \fByanglint\fP opens interactive
environment where the user is allowed to work with schemas and data in a more
complex way.
.
.SH OPTIONS
.TP
.BR \-h "\fR,\fP " \-\^\-help
Outputs usage help and exits.
.TP
.BR \-v "\fR,\fP " \-\^\-version
Outputs the version number and exits.
.TP
.BR \-V "\fR,\fP " \-\^\-verbose
Increases the verbosity level. If not specified, only errors are printed, with
each appearance it adds: warnings, verbose messages, debug messages (if compiled
with debug information).
.TP
.BR \-p " \fIPATH\fP" "\fR,\fP \-\^\-path=\fIPATH\fP"
Specifies search path for getting imported modules or included submodules. It
is not possible to specify multiple search paths.
.TP
.BR \-f " \fIFORMAT\fP" "\fR,\fP \-\^\-format=\fIFORMAT\fP"
Converts the content of the input \fIFILE\fPs into the specified \fIFORMAT\fP. If no
\fIOUTFILE\fP is specified, the data are printed on the standard output. Only the
compatible formats for the input \fIFILE\fPs are allowed, see the section \fBFORMATS\fP.
.TP
.BR \-o " \fIOUTFILE\fP" "\fR,\fP \-\^\-output=\fIOUTFILE\fP"
Writes the output data into the specified \fIOUTFILE\fP. The option can be used
only in combination with \fB--format\fR option. In case of converting schema, only
a single input schema \fIFILE\fP is allowed. In case of data input \fIFILE\fPs,
input is merged and printed into a single \fIOUTFILE\fP.
.TP
.BR \-F " \fIFEATURES\fP" "\fR,\fP \-\^\-features=\fIFEATURES\fP"
Specifies the list of enabled features in the format
\fIMODULE\fP:[\fIFEATURE\fP,...]. In case of processing multiple modules, the
option can be used repeatedly. To disable all the features, use an empty list
specified for the particular module.
.TP
.BR \-d " \fIMODE\fP" "\fR,\fP" \-\^\-default=\fIMODE\fP"
Print data with default values, according to the \fIMODE\fP (to print attributes,
the ietf-netconf-with-defaults model must be loaded). The \fIMODE\fP is one of the following:
\[bu] \fBall\fP - add missing default nodes
\[bu] \fBall-tagged\fP - add missing default nodes and mark all the default nodes with the attribute
\[bu] \fBtrim\fP - remove all nodes with a default value
\[bu] \fBimplicit-tagged\fP - add missing nodes and mark them with the attribute
.TP
.BR \-t " \fITYPE\fP" "\fR,\fP" \-\^\-type=\fITYPE\fP"
Specify data tree type in the input data \fIFILE\fPs. The \fITYPE\fP is one of the following:
\[bu] \fBauto\fP - Resolve data type (one of the following) automatically (as pyang does). Applicable only on XML input data.
\[bu] \fBdata\fP - Complete datastore with status data (default type).
\[bu] \fBconfig\fP - Configuration datastore (without status data).
\[bu] \fBget\fP - Result of the NETCONF <get> operation.
\[bu] \fBgetconfig\fP - Result of the NETCONF <get-config> operation.
\[bu] \fBedit\fP - Content of the NETCONF <edit-config> operation.
.
.SH FORMATS
There are two types of formats to use.
.TP
.I Schemas
In case of schemas, the content can be converted into the '\fByang\fP', '\fByin\fP'
and '\fBtree\fP' formats. As input, only YANG and YIN files are
accepted. Note, that the corresponding file extension is required.
.TP
.I Data\ \ \
In case of YANG modeled data, the content can be converted between '\fBxml\fP'
and '\fBjson\fP' formats. Remember that the corresponding file extension of the
input file is required.
.
.SH EXAMPLES
.IP \[bu] 2
Open interactive environment:
yanglint
.IP \[bu]
Convert YANG model into YIN and print it to the stdout:
yanglint --format=yin ./ietf-system.yang
.IP \[bu]
Convert ietf-system configuration data from XML to JSON:
yanglint --format=json --type=config --output=data.json ./ietf-system.yang ./data.xml
.SH SEE ALSO
https://github.com/CESNET/libyang (libyang homepage and Git repository)
.
.SH AUTHORS
Radek Krejci <rkrejci@cesnet.cz>, Michal Vasko <mvasko@cesnet.cz>
.
.SH COPYRIGHT
Copyright \(co 2015-2016 CESNET, a.l.e.