Skip to content
Snippets Groups Projects
Commit 414b7033 authored by Ladislav Lhotka's avatar Ladislav Lhotka
Browse files

Minor documentation fixes.

parent 9eae9df2
No related branches found
No related tags found
No related merge requests found
......@@ -16,15 +16,13 @@ Data Model Context
os.chdir("../..")
del DataModel._instances[DataModel]
Essential data model structures and methods.
This module implements the following classes:
The *context* module implements the following classes:
* :class:`ModuleData`: Data related to a YANG module or submodule.
* :class:`Context`: Repository of data model structures and methods.
* :class:`FeatureExprParser`: Parser for **if-feature** expressions.
The module defines the following exceptions:
This module also defines the following exceptions:
* :exc:`BadPath`: Invalid :term:`schema path` or :term:`data path`.
* :exc:`BadYangLibraryData`: Broken YANG library data.
......@@ -413,19 +411,23 @@ The module defines the following exceptions:
False
.. autoexception:: BadPath(path: str)
:show-inheritance:
The *path* argument contains the invalid path.
.. autoexception:: BadYangLibraryData(reason: str)
:show-inheritance:
The *reason* argument is a text describing the problem.
.. autoexception:: CyclicImports
:show-inheritance:
See sec. `5.1`_ of [RFC7950]_ for further explanation.
.. autoexception:: FeaturePrerequisiteError(name: YangIdentifier, ns: \
YangIdentifier)
:show-inheritance:
The *name* and *ns* arguments contain the name and namespace of the
feature for which a pre-requisite feature is not supported by the
......@@ -433,27 +435,32 @@ The module defines the following exceptions:
.. autoexception:: MissingImport(imported: YangIdentifier, mid: \
ModuleId)
:show-inheritance:
Module *imported* is expected to be imported from a module or
submodule whose :term:`module identifier` is *mid*.
.. autoexception:: ModuleNotFound(name: YangIdentifier, rev: str = "")
:show-inheritance:
The *name* and *rev* arguments give the name and revision of the
non-existent (sub)module.
.. autoexception:: ModuleNotRegistered(name: YangIdentifier, rev: str \
= "")
:show-inheritance:
The *name* and *rev* arguments give the name and revision of the
module that is missing in YANG library.
.. autoexception:: MultipleImplementedRevisions(module: YangIdentifier)
:show-inheritance:
See sec. `5.6.5`_ of [RFC7950]_ for further explanation. The *module*
argument contains the name of the module with multiple implemented revisions.
.. autoexception:: UnknownPrefix(prefix: str)
:show-inheritance:
The *prefix* argument contains the unknown prefix.
......
......@@ -16,7 +16,7 @@ Data Model
os.chdir("../..")
del DataModel._instances[DataModel]
This module implements the following classes:
The *datamodel* module implements the following class:
* :class:`DataModel`: basic user-level entry point to YANG data model
information.
......
************************
Common Exception Classes
************************
********************
Base Exception Class
********************
.. module:: yangson.exceptions
:synopsis: Common exception classes
:synopsis: Base exception class
.. autoexception:: YangsonException
.. autoexception:: NonexistentSchemaNode
The constructor arguments *name* and *ns* give the name and namespace (module) of the
non-existent schema node.
:show-inheritance:
......@@ -4,6 +4,9 @@
Glossary
========
Many important terms are also defined in the YANG
specification, see section `3`_ of [RFC7950]_.
.. glossary::
:sorted:
......@@ -143,7 +146,26 @@ Glossary
is identical to the module name whereas for submodules it is
the name of the main module to which the submodule belongs.
schema error
The value of instance node violates a schema constraint, i.e.
one of the following: grammar defined by the hierarchy of schema
nodes (also taking into account conditions specified by **when**
and **if-feature** statements), type of the value, presence and
uniqueness of list keys.
semantic error
The value of an instance node violates a semantic rule, i.e. one
of the following: **must** expression, referential integrity
constraint (for **leaf** nodes with *leafref* or
*instance-identifier* type), number of list entries prescribed
by **min-elements** and **max-elements** statements, **unique**
constraint specified for a **list** node, non-unique values of a
**leaf-list** node that represents configuration.
.. _2.2: https://tools.ietf.org/html/rfc7895#section-2.2
.. _3: https://tools.ietf.org/html/rfc7950#section-3
.. _3.5.1: https://tools.ietf.org/html/draft-ietf-netconf-restconf#section-3.5.1
.. _4: https://tools.ietf.org/html/rfc7951#section-4
.. _6.2: https://tools.ietf.org/html/rfc7950#section-6.2
......
......@@ -19,7 +19,7 @@
os.chdir("../..")
del DataModel._instances[DataModel]
This module implements the following classes:
The *instance* module implements the following classes:
* :class:`InstanceNode`: Abstract class for instance nodes.
* :class:`RootNode`: Root of the data tree.
......@@ -30,7 +30,7 @@ This module implements the following classes:
identifier`\ s.
* :class:`InstanceIdParser`: Parser for :term:`instance identifier`\ s.
The module defines the following exceptions:
This module also defines the following exceptions:
* :exc:`InstanceException`: Base class for exceptions related to
operations on instance nodes.
......@@ -373,9 +373,11 @@ The module defines the following exceptions:
.. method:: validate(content: ContentType = ContentType.config) -> None
Perform schema validation on the receiver's value. The *content*
argument specifies whether the value is configuration
(``Content.config``) or both configuration and state data
Perform schema validation on the receiver's value. The value of
the *content* argument belongs to the
:data:`~.enumerations.ContentType` enumeration and specifies
whether the receiver's value is to be validated as configuration
(``Content.config``) or as both configuration and state data
(``Content.all``).
The method returns ``None`` if the validation succeeds,
......
......@@ -10,7 +10,7 @@ Structured Values of Instance Nodes
import time
from yangson.instvalue import ArrayValue, ObjectValue
This module implements the following classes:
The *instvalue* module implements the following classes:
* :class:`StructuredValue`: Abstract class for “cooked” structured
values of an instance node.
......
......@@ -10,13 +10,11 @@ Parser
import re
from yangson.parser import Parser
Simple recursive descent-parser with support for common YANG syntactic elements.
This module implements the following class:
The *parser* module implements the following class:
* :class:`Parser`: Recursive-descent parser.
This module defines the following exceptions:
This module also defines the following exceptions:
* :exc:`EndOfInput`: Unexpected end of input.
* :exc:`ParserException`: Base class for parser exceptions.
......@@ -282,6 +280,7 @@ This module defines the following exceptions:
'foo-bar'
.. autoexception:: ParserException(p: Parser)
:show-inheritance:
The argument *p* is the parser instance that caused the exception.
......
......@@ -2,15 +2,14 @@
References
**********
.. [BBW16] Bierman, A.; Bjorklund, M.; Watsen, K. *RESTCONF
Protocol.* `draft-ietf-netconf-restconf`__, Internet
Engineering Task Force, 2016.
.. [BBW16] Bierman, A.; Bjorklund, M.; Watsen, K. *RESTCONF Protocol.*
`draft-ietf-netconf-restconf`__, IETF, 2016.
__ https://tools.ietf.org/html/draft-ietf-netconf-restconf
.. [Bie16] Bierman, A. *Guidelines for Authors and Reviewers of YANG
Data Model Documents*. `draft-ietf-netmod-rfc6087bis`__,
Internet Engineering Task Force, 2016.
IETF, 2016.
__ https://tools.ietf.org/html/draft-ietf-netmod-rfc6087bis
......@@ -26,10 +25,16 @@ __ https://www.python.org/dev/peps/pep-0484
.. [RFC3986] Berners-Lee, T.; Fielding, R.; Masinter, L. *Uniform
Resource Identifier (URI): Generic Syntax*. `RFC 3986`__,
Internet Engineering Task Force, 2005.
IETF, 2005. 61 p.
__ https://tools.ietf.org/html/rfc3986
.. [RFC6536] Bierman, A.; Bjorklund, M. *Network Configuration
Protocol (NETCONF) Access Control Model.* `RFC 6536`__,
IETF, 2012, 49 p. ISSN 2070-1721.
__ https://tools.ietf.org/html/rfc6536
.. [RFC6901] Bryan, P. (ed.); Zyp, K.; Nottingham, M. *JavaScript
Object Notation (JSON) Pointer*. `RFC 6901`__,
IETF, 2013. 8 p. ISSN 2070-1721.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment