rfc7950v3.txt | rfc7950.txt | |||
---|---|---|---|---|
skipping to change at page 2, line 25 | skipping to change at page 2, line 25 | |||
than English. | than English. | |||
Table of Contents | Table of Contents | |||
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 8 | 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 8 | |||
1.1. Summary of Changes from RFC 6020 . . . . . . . . . . . . 8 | 1.1. Summary of Changes from RFC 6020 . . . . . . . . . . . . 8 | |||
2. Key Words . . . . . . . . . . . . . . . . . . . . . . . . . . 11 | 2. Key Words . . . . . . . . . . . . . . . . . . . . . . . . . . 11 | |||
3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 11 | 3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 11 | |||
3.1. A Note on Examples . . . . . . . . . . . . . . . . . . . 14 | 3.1. A Note on Examples . . . . . . . . . . . . . . . . . . . 14 | |||
4. YANG Overview . . . . . . . . . . . . . . . . . . . . . . . . 14 | 4. YANG Overview . . . . . . . . . . . . . . . . . . . . . . . . 14 | |||
4.1. Functional Overview . . . . . . . . . . . . . . . . . . . 14 | 4.1. Functional Overview . . . . . . . . . . . . . . . . . . . 15 | |||
4.2. Language Overview . . . . . . . . . . . . . . . . . . . . 16 | 4.2. Language Overview . . . . . . . . . . . . . . . . . . . . 16 | |||
4.2.1. Modules and Submodules . . . . . . . . . . . . . . . 16 | 4.2.1. Modules and Submodules . . . . . . . . . . . . . . . 16 | |||
4.2.2. Data Modeling Basics . . . . . . . . . . . . . . . . 17 | 4.2.2. Data Modeling Basics . . . . . . . . . . . . . . . . 17 | |||
4.2.3. Configuration and State Data . . . . . . . . . . . . 20 | 4.2.3. Configuration and State Data . . . . . . . . . . . . 20 | |||
4.2.4. Built-In Types . . . . . . . . . . . . . . . . . . . 21 | 4.2.4. Built-In Types . . . . . . . . . . . . . . . . . . . 21 | |||
4.2.5. Derived Types (typedef) . . . . . . . . . . . . . . . 22 | 4.2.5. Derived Types (typedef) . . . . . . . . . . . . . . . 22 | |||
4.2.6. Reusable Node Groups (grouping) . . . . . . . . . . . 23 | 4.2.6. Reusable Node Groups (grouping) . . . . . . . . . . . 23 | |||
4.2.7. Choices . . . . . . . . . . . . . . . . . . . . . . . 24 | 4.2.7. Choices . . . . . . . . . . . . . . . . . . . . . . . 24 | |||
4.2.8. Extending Data Models (augment) . . . . . . . . . . . 25 | 4.2.8. Extending Data Models (augment) . . . . . . . . . . . 25 | |||
4.2.9. Operation Definitions . . . . . . . . . . . . . . . . 26 | 4.2.9. Operation Definitions . . . . . . . . . . . . . . . . 26 | |||
skipping to change at page 8, line 17 | skipping to change at page 8, line 17 | |||
instance" Statement . . . . . . . . . . . . . . . . . . 202 | instance" Statement . . . . . . . . . . . . . . . . . . 202 | |||
15.6. Error Message for Data That Violates a Mandatory | 15.6. Error Message for Data That Violates a Mandatory | |||
"choice" Statement . . . . . . . . . . . . . . . . . . . 202 | "choice" Statement . . . . . . . . . . . . . . . . . . . 202 | |||
15.7. Error Message for the "insert" Operation . . . . . . . . 202 | 15.7. Error Message for the "insert" Operation . . . . . . . . 202 | |||
16. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 202 | 16. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 202 | |||
17. Security Considerations . . . . . . . . . . . . . . . . . . . 203 | 17. Security Considerations . . . . . . . . . . . . . . . . . . . 203 | |||
18. References . . . . . . . . . . . . . . . . . . . . . . . . . 203 | 18. References . . . . . . . . . . . . . . . . . . . . . . . . . 203 | |||
18.1. Normative References . . . . . . . . . . . . . . . . . . 203 | 18.1. Normative References . . . . . . . . . . . . . . . . . . 203 | |||
18.2. Informative References . . . . . . . . . . . . . . . . . 205 | 18.2. Informative References . . . . . . . . . . . . . . . . . 205 | |||
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 206 | Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 206 | |||
Contributors . . . . . . . . . . . . . . . . . . . . . . . . . . 206 | Contributors . . . . . . . . . . . . . . . . . . . . . . . . . . 207 | |||
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 207 | Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 207 | |||
1. Introduction | 1. Introduction | |||
YANG is a data modeling language originally designed to model | YANG is a data modeling language originally designed to model | |||
configuration and state data manipulated by the Network Configuration | configuration and state data manipulated by the Network Configuration | |||
Protocol (NETCONF), NETCONF Remote Procedure Calls, and NETCONF | Protocol (NETCONF), NETCONF Remote Procedure Calls, and NETCONF | |||
notifications [RFC6241]. Since the publication of YANG version 1 | notifications [RFC6241]. Since the publication of YANG version 1 | |||
[RFC6020], YANG has been used or proposed to be used for other | [RFC6020], YANG has been used or proposed to be used for other | |||
protocols (e.g., RESTCONF [RESTCONF] and the Constrained Application | protocols (e.g., RESTCONF [RESTCONF] and the Constrained Application | |||
Protocol (CoAP) Management Interface (CoMI) [CoMI]). Further, | Protocol (CoAP) Management Interface (CoMI) [CoMI]). Further, | |||
encodings other than XML have been proposed (e.g., JSON [RFC7951]). | encodings other than XML have been proposed (e.g., JSON [RFC7951]). | |||
This document describes the syntax and semantics of version 1.1 of | This document describes the syntax and semantics of version 1.1 of | |||
the YANG language. It also describes how a data model defined in a | the YANG language. It also describes how a data model defined in a | |||
YANG module is encoded in the Extensible Markup Language (XML) and | YANG module is encoded in the Extensible Markup Language (XML) [XML] | |||
how NETCONF operations are used to manipulate the data. Other | and how NETCONF operations are used to manipulate the data. Other | |||
protocols and encodings are possible but are out of scope for this | protocols and encodings are possible but are out of scope for this | |||
specification. | specification. | |||
In terms of developing YANG data models, [YANG-Guidelines] provides | In terms of developing YANG data models, [YANG-Guidelines] provides | |||
some guidelines and recommendations. | some guidelines and recommendations. | |||
Note that this document does not obsolete RFC 6020 [RFC6020]. | Note that this document does not obsolete RFC 6020 [RFC6020]. | |||
1.1. Summary of Changes from RFC 6020 | 1.1. Summary of Changes from RFC 6020 | |||
skipping to change at page 11, line 7 | skipping to change at page 11, line 7 | |||
o Allow notifications to be tied to data nodes. | o Allow notifications to be tied to data nodes. | |||
o Added a new data definition statement "anydata" (see | o Added a new data definition statement "anydata" (see | |||
Section 7.10), which is RECOMMENDED to be used instead of "anyxml" | Section 7.10), which is RECOMMENDED to be used instead of "anyxml" | |||
when the data can be modeled in YANG. | when the data can be modeled in YANG. | |||
o Allow types "empty" and "leafref" in unions. | o Allow types "empty" and "leafref" in unions. | |||
o Allow type "empty" in a key. | o Allow type "empty" in a key. | |||
o Removed the restriction that identifiers could not start with the | ||||
characters "xml". | ||||
The following changes have been done to the NETCONF mapping: | The following changes have been done to the NETCONF mapping: | |||
o A server advertises support for YANG 1.1 modules by using | o A server advertises support for YANG 1.1 modules by using | |||
ietf-yang-library [RFC7895] instead of listing them as | ietf-yang-library [RFC7895] instead of listing them as | |||
capabilities in the <hello> message. | capabilities in the <hello> message. | |||
2. Key Words | 2. Key Words | |||
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", | The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", | |||
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and | "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and | |||
skipping to change at page 48, line 50 | skipping to change at page 48, line 50 | |||
Additionally, for an RPC, the root node also has the node | Additionally, for an RPC, the root node also has the node | |||
representing the RPC operation being defined as a child. The node | representing the RPC operation being defined as a child. The node | |||
representing the operation being defined has the operation's | representing the operation being defined has the operation's | |||
output parameters as children. | output parameters as children. | |||
In the accessible tree, all leafs and leaf-lists with default values | In the accessible tree, all leafs and leaf-lists with default values | |||
in use exist (see Sections 7.6.1 and 7.7.2). | in use exist (see Sections 7.6.1 and 7.7.2). | |||
If a node that exists in the accessible tree has a non-presence | If a node that exists in the accessible tree has a non-presence | |||
container as a child, then the non-presence container also exists in | container as a child, then the non-presence container also exists in | |||
the tree. | the accessible tree. | |||
The context node varies with the YANG XPath expression and is | The context node varies with the YANG XPath expression and is | |||
specified where the YANG statement with the XPath expression is | specified where the YANG statement with the XPath expression is | |||
defined. | defined. | |||
6.4.1.1. Examples | 6.4.1.1. Examples | |||
Given the following module: | Given the following module: | |||
module example-a { | module example-a { | |||
skipping to change at page 143, line 36 | skipping to change at page 143, line 36 | |||
AB // legal | AB // legal | |||
9A00 // legal | 9A00 // legal | |||
and the following strings do not match: | and the following strings do not match: | |||
00ABAB // illegal, too long | 00ABAB // illegal, too long | |||
xx00 // illegal, bad characters | xx00 // illegal, bad characters | |||
With the following type: | With the following type: | |||
typedef yang-identifier { | type string { | |||
type string { | length "1..max"; | |||
length "1..max"; | pattern '[a-zA-Z_][a-zA-Z0-9\-_.]*'; | |||
pattern '[a-zA-Z_][a-zA-Z0-9\-_.]*'; | pattern '[xX][mM][lL].*' { | |||
pattern '[xX][mM][lL].*' { | modifier invert-match; | |||
modifier invert-match; | ||||
} | ||||
} | } | |||
} | } | |||
the following string matches: | the following string matches: | |||
enabled // legal | enabled // legal | |||
and the following strings do not match: | and the following strings do not match: | |||
10-mbit // illegal, starts with a number | 10-mbit // illegal, starts with a number | |||
skipping to change at page 198, line 38 | skipping to change at page 198, line 38 | |||
prefix-arg = prefix | prefix-arg = prefix | |||
prefix = identifier | prefix = identifier | |||
identifier-arg-str = < a string that matches the rule > | identifier-arg-str = < a string that matches the rule > | |||
< identifier-arg > | < identifier-arg > | |||
identifier-arg = identifier | identifier-arg = identifier | |||
;; An identifier MUST NOT start with (('X'|'x') ('M'|'m') ('L'|'l')) | ||||
identifier = (ALPHA / "_") | identifier = (ALPHA / "_") | |||
*(ALPHA / DIGIT / "_" / "-" / ".") | *(ALPHA / DIGIT / "_" / "-" / ".") | |||
identifier-ref-arg-str = < a string that matches the rule > | identifier-ref-arg-str = < a string that matches the rule > | |||
< identifier-ref-arg > | < identifier-ref-arg > | |||
identifier-ref-arg = identifier-ref | identifier-ref-arg = identifier-ref | |||
identifier-ref = [prefix ":"] identifier | identifier-ref = [prefix ":"] identifier | |||
skipping to change at page 204, line 40 | skipping to change at page 204, line 40 | |||
<http://www.rfc-editor.org/info/rfc6241>. | <http://www.rfc-editor.org/info/rfc6241>. | |||
[RFC7405] Kyzivat, P., "Case-Sensitive String Support in ABNF", | [RFC7405] Kyzivat, P., "Case-Sensitive String Support in ABNF", | |||
RFC 7405, DOI 10.17487/RFC7405, December 2014, | RFC 7405, DOI 10.17487/RFC7405, December 2014, | |||
<http://www.rfc-editor.org/info/rfc7405>. | <http://www.rfc-editor.org/info/rfc7405>. | |||
[RFC7895] Bierman, A., Bjorklund, M., and K. Watsen, "YANG Module | [RFC7895] Bierman, A., Bjorklund, M., and K. Watsen, "YANG Module | |||
Library", RFC 7895, DOI 10.17487/RFC7895, June 2016, | Library", RFC 7895, DOI 10.17487/RFC7895, June 2016, | |||
<http://www.rfc-editor.org/info/rfc7895>. | <http://www.rfc-editor.org/info/rfc7895>. | |||
[XML] Bray, T., Paoli, J., Sperberg-McQueen, C., Maler, E., and | ||||
F. Yergeau, "Extensible Markup Language (XML) 1.0 (Fifth | ||||
Edition)", W3C Recommendation REC-xml-20081126, November | ||||
2008, <https://www.w3.org/TR/2008/REC-xml-20081126/>. | ||||
[XML-NAMES] | [XML-NAMES] | |||
Bray, T., Hollander, D., Layman, A., Tobin, R., and H. | Bray, T., Hollander, D., Layman, A., Tobin, R., and H. | |||
Thompson, "Namespaces in XML 1.0 (Third Edition)", World | Thompson, "Namespaces in XML 1.0 (Third Edition)", World | |||
Wide Web Consortium Recommendation REC-xml-names-20091208, | Wide Web Consortium Recommendation REC-xml-names-20091208, | |||
December 2009, | December 2009, | |||
<http://www.w3.org/TR/2009/REC-xml-names-20091208>. | <http://www.w3.org/TR/2009/REC-xml-names-20091208>. | |||
[XPATH] Clark, J. and S. DeRose, "XML Path Language (XPath) | [XPATH] Clark, J. and S. DeRose, "XML Path Language (XPath) | |||
Version 1.0", World Wide Web Consortium Recommendation | Version 1.0", World Wide Web Consortium Recommendation | |||
REC-xpath-19991116, November 1999, | REC-xpath-19991116, November 1999, | |||
End of changes. 8 change blocks. | ||||
13 lines changed or deleted | 18 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |