< draft-verdt-netmod-yang-module-versioning-00.txt   draft-verdt-netmod-yang-module-versioning-01.txt >
Network Working Group B. Claise Network Working Group B. Claise
Internet-Draft J. Clarke Internet-Draft J. Clarke
Updates: 7950 (if approved) R. Rahman Updates: 7950 (if approved) R. Rahman
Intended status: Standards Track R. Wilton, Ed. Intended status: Standards Track R. Wilton, Ed.
Expires: January 4, 2020 Cisco Systems, Inc. Expires: April 17, 2020 Cisco Systems, Inc.
B. Lengyel B. Lengyel
Ericsson Ericsson
J. Sterne J. Sterne
Nokia Nokia
K. D'Souza K. D'Souza
AT&T AT&T
July 3, 2019 October 15, 2019
Updated YANG Module Revision Handling Updated YANG Module Revision Handling
draft-verdt-netmod-yang-module-versioning-00 draft-verdt-netmod-yang-module-versioning-01
Abstract Abstract
This document specifies a new YANG module update procedure that can This document specifies a new YANG module update procedure that can
document when non-backwards-compatible changes have occurred during document when non-backwards-compatible changes have occurred during
the evolution of a YANG module. It extends the YANG import statement the evolution of a YANG module. It extends the YANG import statement
with an earliest revision filter to better represent inter-module with an earliest revision filter to better represent inter-module
dependencies. It provides help and guidelines for managing the dependencies. It provides help and guidelines for managing the
lifecycle of YANG modules and individual schema nodes. This document lifecycle of YANG modules and individual schema nodes. This document
updates RFC 7950, RFC 8407 and RFC 8525. updates RFC 7950, RFC 8407 and RFC 8525.
skipping to change at page 1, line 44 skipping to change at page 1, line 44
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on January 4, 2020. This Internet-Draft will expire on April 17, 2020.
Copyright Notice Copyright Notice
Copyright (c) 2019 IETF Trust and the persons identified as the Copyright (c) 2019 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info) in effect on the date of (https://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
skipping to change at page 2, line 25 skipping to change at page 2, line 25
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1. Updates to YANG RFCs . . . . . . . . . . . . . . . . . . 4 1.1. Updates to YANG RFCs . . . . . . . . . . . . . . . . . . 4
2. Terminology and Conventions . . . . . . . . . . . . . . . . . 4 2. Terminology and Conventions . . . . . . . . . . . . . . . . . 4
3. Refinements to YANG revision handling . . . . . . . . . . . . 4 3. Refinements to YANG revision handling . . . . . . . . . . . . 5
3.1. Updating a YANG module with a new revision . . . . . . . 5 3.1. Updating a YANG module with a new revision . . . . . . . 5
3.1.1. Backwards-compatible changes . . . . . . . . . . . . 5 3.1.1. Backwards-compatible changes . . . . . . . . . . . . 5
3.1.2. Non-backwards-compatible changes . . . . . . . . . . 6 3.1.2. Non-backwards-compatible changes . . . . . . . . . . 6
3.2. nbc-changes revision extension statement . . . . . . . . 6 3.2. nbc-changes revision extension statement . . . . . . . . 6
3.3. Revision label . . . . . . . . . . . . . . . . . . . . . 6 3.3. Revision label . . . . . . . . . . . . . . . . . . . . . 6
3.4. YANG status description extension statement . . . . . . . 7 3.4. YANG status description extension statement . . . . . . . 7
3.5. Examples for updating the YANG module revision history . 7 3.5. Examples for updating the YANG module revision history . 7
4. Import by derived revision . . . . . . . . . . . . . . . . . 9 4. Import by derived revision . . . . . . . . . . . . . . . . . 10
4.1. Module import examples . . . . . . . . . . . . . . . . . 10 4.1. Module import examples . . . . . . . . . . . . . . . . . 11
5. Updates to ietf-yang-library . . . . . . . . . . . . . . . . 12 5. Updates to ietf-yang-library . . . . . . . . . . . . . . . . 13
5.1. Advertising revision-label . . . . . . . . . . . . . . . 12 5.1. Resolving ambiguous module imports . . . . . . . . . . . 13
5.2. Resolving ambiguous module imports . . . . . . . . . . . 12 5.2. YANG library versioning augmentations . . . . . . . . . . 14
5.3. Reporting how deprecated and obsolete nodes are handled . 13 5.2.1. Advertising revision-label . . . . . . . . . . . . . 14
6. Versioning of YANG instance data . . . . . . . . . . . . . . 13 5.2.2. Reporting how deprecated and obsolete nodes are
7. Guidelines for using the YANG module update rules . . . . . . 14 handled . . . . . . . . . . . . . . . . . . . . . . . 14
7.1. Guidelines for YANG module authors . . . . . . . . . . . 14 6. Versioning of YANG instance data . . . . . . . . . . . . . . 15
7. Guidelines for using the YANG module update rules . . . . . . 15
7.1. Guidelines for YANG module authors . . . . . . . . . . . 15
7.1.1. Making non-backwards-compatible changes to a YANG 7.1.1. Making non-backwards-compatible changes to a YANG
module . . . . . . . . . . . . . . . . . . . . . . . 14 module . . . . . . . . . . . . . . . . . . . . . . . 16
7.2. Versioning Considerations for Clients . . . . . . . . . . 16 7.2. Versioning Considerations for Clients . . . . . . . . . . 17
8. Module Versioning Extension YANG Modules . . . . . . . . . . 16 8. Module Versioning Extension YANG Modules . . . . . . . . . . 18
9. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 22 9. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 25
10. Security Considerations . . . . . . . . . . . . . . . . . . . 23 10. Security Considerations . . . . . . . . . . . . . . . . . . . 26
11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 23 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 26
11.1. YANG Module Registrations . . . . . . . . . . . . . . . 23 11.1. YANG Module Registrations . . . . . . . . . . . . . . . 26
12. References . . . . . . . . . . . . . . . . . . . . . . . . . 23 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 26
12.1. Normative References . . . . . . . . . . . . . . . . . . 23 12.1. Normative References . . . . . . . . . . . . . . . . . . 26
12.2. Informative References . . . . . . . . . . . . . . . . . 24 12.2. Informative References . . . . . . . . . . . . . . . . . 27
Appendix A. Appendix . . . . . . . . . . . . . . . . . . . . . . 28
Appendix A. Appendix . . . . . . . . . . . . . . . . . . . . . . 25
A.1. Examples of guidelines for making NBC changes to a YANG A.1. Examples of guidelines for making NBC changes to a YANG
module . . . . . . . . . . . . . . . . . . . . . . . . . 25 module . . . . . . . . . . . . . . . . . . . . . . . . . 28
A.1.1. Removing a data node . . . . . . . . . . . . . . . . 25 A.1.1. Removing a data node . . . . . . . . . . . . . . . . 28
A.1.2. Changing the type of a leaf node . . . . . . . . . . 26 A.1.2. Changing the type of a leaf node . . . . . . . . . . 29
A.1.3. Reducing the range of a leaf node . . . . . . . . . . 27 A.1.3. Reducing the range of a leaf node . . . . . . . . . . 30
A.1.4. Changing the key of a list . . . . . . . . . . . . . 27 A.1.4. Changing the key of a list . . . . . . . . . . . . . 30
A.1.5. Renaming a node . . . . . . . . . . . . . . . . . . . 28 A.1.5. Renaming a node . . . . . . . . . . . . . . . . . . . 31
A.1.6. Changing a default value . . . . . . . . . . . . . . 29 A.1.6. Changing a default value . . . . . . . . . . . . . . 32
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 29 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 32
1. Introduction 1. Introduction
This document defines a solution to the YANG module lifecycle This document defines a solution to the YANG module lifecycle
problems described in [I-D.verdt-netmod-yang-versioning-reqs]. problems described in [I-D.verdt-netmod-yang-versioning-reqs].
Complementary documents provide a complete solution to the YANG Complementary documents provide a complete solution to the YANG
versioning requirements, with the overall relationship of the versioning requirements, with the overall relationship of the
solution drafts described in [I-D.verdt-netmod-yang-solutions]. solution drafts described in [I-D.verdt-netmod-yang-solutions].
Specifically, this document recognises a need (within standards Specifically, this document recognises a need (within standards
skipping to change at page 6, line 41 skipping to change at page 6, line 49
Conversely, if a revision does not contain an "rev:nbc-changes" Conversely, if a revision does not contain an "rev:nbc-changes"
extension substatement then all changes, relative to the preceding extension substatement then all changes, relative to the preceding
revision in the revision history, MUST be backwards-compatible. revision in the revision history, MUST be backwards-compatible.
3.3. Revision label 3.3. Revision label
Each revision entry in a module or submodule MAY have a revision Each revision entry in a module or submodule MAY have a revision
label associated with it, providing an alternative alias to identify label associated with it, providing an alternative alias to identify
a particular revision of a module or submodule. The revision label a particular revision of a module or submodule. The revision label
could be used to provide an additional versioning identifier could be used to provide an additional versioning identifier
associated with the revision. E.g., one option for a versioning associated with the revision.
scheme that could be used is [TODO - Reference semver draft].
YANG Semver [I-D.verdt-netmod-yang-semver] defines a versioning
scheme based on Semver 2.0.0 [semver] that can be used as a revision
label. All revision labels that match the pattern for the "version"
typedef in the ietf-yang-semver YANG module MUST be interpreted as
YANG semantic version numbers.
The revision date and revision label within a submodule's revision The revision date and revision label within a submodule's revision
history have no effect on the including module's revision. history have no effect on the including module's revision.
Submodules MUST NOT use revision label schemes that could be confused Submodules MUST NOT use revision label schemes that could be confused
with the including module's revision label scheme. with the including module's revision label scheme.
If a revision has an associated revision label, then it may be used If a revision has an associated revision label, then it may be used
instead of the revision date in two places: instead of the revision date in two places:
In an "rev:revision-or-derived" extension statement argument. In an "rev:revision-or-derived" extension statement argument.
skipping to change at page 8, line 23 skipping to change at page 9, line 18
namespace "name-space"; namespace "name-space";
prefix "prefix-name"; prefix "prefix-name";
import ietf-yang-revisions { prefix "rev"; } import ietf-yang-revisions { prefix "rev"; }
description description
"to be completed"; "to be completed";
revision 2019-06-01 { revision 2019-06-01 {
rev:revision-label "3.1.0"; rev:revision-label 3.1.0;
rev:nbc-changes;
description "Add new functionality."; description "Add new functionality.";
} }
revision 2019-04-01 { revision 2019-04-01 {
rev:revision-label "3.0.0"; rev:revision-label 3.0.0;
rev:nbc-changes;
description description
"Add new functionality. Remove some deprecated nodes."; "Add new functionality. Remove some deprecated nodes.";
} }
revision 2019-02-01 { revision 2019-02-01 {
rev:revision-label "2.0.0"; rev:revision-label 2.0.0;
rev:nbc-changes; rev:nbc-changes;
description "Apply bugfix to pattern statement"; description "Apply bugfix to pattern statement";
} }
revision 2019-01-01 { revision 2019-01-01 {
rev:revision-label "1.0.0"; rev:revision-label 1.0.0;
description "Initial revision"; description "Initial revision";
} }
//YANG module definition starts here //YANG module definition starts here
Example module, revision 2019-05-01: Example module, revision 2019-05-01:
module example-module { module example-module {
namespace "name-space"; namespace "name-space";
prefix "prefix-name"; prefix "prefix-name";
import ietf-yang-revisions { prefix "semver"; } import ietf-yang-revisions { prefix "rev"; }
description description
"to be completed"; "to be completed";
revision 2019-05-01 { revision 2019-05-01 {
rev:revision-label "2.2.0"; rev:revision-label 2.2.0;
description "Backwards-compatible bugfix to enhancement."; description "Backwards-compatible bugfix to enhancement.";
} }
revision 2019-03-01 { revision 2019-03-01 {
rev:revision-label "2.1.0"; rev:revision-label 2.1.0;
description "Apply enhancement to older release train."; description "Apply enhancement to older release train.";
} }
revision 2019-02-01 { revision 2019-02-01 {
rev:revision-label "2.0.0"; rev:revision-label 2.0.0;
rev:nbc-changes; rev:nbc-changes;
description "Apply bugfix to pattern statement"; description "Apply bugfix to pattern statement";
} }
revision 2019-01-01 { revision 2019-01-01 {
rev:revision-label "1.0.0"; rev:revision-label 1.0.0;
description "Initial revision"; description "Initial revision";
} }
//YANG module definition starts here //YANG module definition starts here
4. Import by derived revision 4. Import by derived revision
RFC 7950 allows YANG module "import" statements to optionally require RFC 7950 allows YANG module "import" statements to optionally require
the imported module to have a particular revision date. In practice, the imported module to have a particular revision date. In practice,
importing a module with an exact revision date is often too importing a module with an exact revision date is often too
skipping to change at page 11, line 28 skipping to change at page 12, line 28
4.1.1. Example 1 4.1.1. Example 1
This example selects module revisions that match, or are derived from This example selects module revisions that match, or are derived from
the revision 2019-02-01. E.g., this dependency might be used if the revision 2019-02-01. E.g., this dependency might be used if
there was a new container added in revision 2019-02-01 that is there was a new container added in revision 2019-02-01 that is
augmented by the importing module.It includes revisions/labels: augmented by the importing module.It includes revisions/labels:
2019-02-01/2.0.0, 2019-03-01/3.0.0, 2019-04-01/2.1.0, 2019-02-01/2.0.0, 2019-03-01/3.0.0, 2019-04-01/2.1.0,
2019-05-01/2.2.0 and 2019-06-01/3.1.0. 2019-05-01/2.2.0 and 2019-06-01/3.1.0.
import example-module { import example-module {
ver:revision-or-derived 2019-02-01; rev:revision-or-derived 2019-02-01;
} }
Alternatively, the first example could have used the revision label Alternatively, the first example could have used the revision label
"1.0.0" instead, which selects the same set of revisions/versions. "1.0.0" instead, which selects the same set of revisions/versions.
import example-module { import example-module {
ver:revision-or-derived 1.0.0; rev:revision-or-derived 1.0.0;
} }
4.1.2. Example 2 4.1.2. Example 2
This example selects module revisions that are derived from This example selects module revisions that are derived from
2019-04-01 by using the revision label 2.1.0. It includes revisions/ 2019-04-01 by using the revision label 2.1.0. It includes revisions/
labels: 2019-04-01/2.1.0 and 2019-05-01/2.2.0. Even though labels: 2019-04-01/2.1.0 and 2019-05-01/2.2.0. Even though
2019-06-01/3.1.0 has a higher revision label version number than 2019-06-01/3.1.0 has a higher revision label version number than
2019-04-01/2.1.0 it is not a derived revision, and hence it is not a 2019-04-01/2.1.0 it is not a derived revision, and hence it is not a
valid revision for import. valid revision for import.
import example-module { import example-module {
ver:revision-or-derived 2.1.0; rev:revision-or-derived 2.1.0;
} }
4.1.3. Example 3 4.1.3. Example 3
This example selects revisions derived from either 2019-04-01 or This example selects revisions derived from either 2019-04-01 or
2019-06-01. It includes revisions/labels: 2019-04-01/2.1.0, 2019-06-01. It includes revisions/labels: 2019-04-01/2.1.0,
2019-05-01/2.2.0, and 2019-06-01/3.1.0. 2019-05-01/2.2.0, and 2019-06-01/3.1.0.
import example-module { import example-module {
ver:revision-or-derived 2019-04-01; rev:revision-or-derived 2019-04-01;
ver:revision-or-derived 2019-06-01; rev:revision-or-derived 2019-06-01;
} }
5. Updates to ietf-yang-library 5. Updates to ietf-yang-library
YANG library [RFC7895] [RFC8525] is modified to support the new This document updates YANG library [RFC7895] [RFC8525] to clarify how
module update rules in three ways. ambiguous module imports are resolved. It also defines the YANG
module, ietf-yl-revisions that augments YANG library with new
5.1. Advertising revision-label versioning related meta-data.
The ietf-yang-revisions YANG module augments the "module" list in
ietf-yang-library with a "revision-label" leaf to optionally declare
the revision label associated wth the particular revision of each
module.
5.2. Resolving ambiguous module imports 5.1. Resolving ambiguous module imports
A YANG datastore schema, defined in [RFC8525], can specify multiple A YANG datastore schema, defined in [RFC8525], can specify multiple
revisions of a YANG module in the schema using the "import-only" revisions of a YANG module in the schema using the "import-only"
list, with the requirement from [RFC7950] that only a single revision list, with the requirement from [RFC7950] that only a single revision
of a YANG module may be implemented. of a YANG module may be implemented.
If a YANG module import statement does not specify a specific If a YANG module import statement does not specify a specific
revision within the datastore schema then it could be ambiguous as to revision within the datastore schema then it could be ambiguous as to
which module revision the import statement should resolve to. Hence, which module revision the import statement should resolve to. Hence,
a datastore schema constructed by a client using the information a datastore schema constructed by a client using the information
skipping to change at page 13, line 7 skipping to change at page 14, line 5
revision defined in the datastore schema, and one of those revisions revision defined in the datastore schema, and one of those revisions
is implemented (i.e., not an "import-only" module), then the import is implemented (i.e., not an "import-only" module), then the import
statement MUST resolve to the revision of the module that is defined statement MUST resolve to the revision of the module that is defined
as being implemented by the datastore schema. as being implemented by the datastore schema.
If a module import statement could resolve to more than one module If a module import statement could resolve to more than one module
revision defined in the datastore schema, and none of those revisions revision defined in the datastore schema, and none of those revisions
are implemented, then the import MUST resolve to the module revision are implemented, then the import MUST resolve to the module revision
with the latest revision date. with the latest revision date.
5.3. Reporting how deprecated and obsolete nodes are handled 5.2. YANG library versioning augmentations
The ietf-yang-revisions YANG module augments YANG library with two The "ietf-yl-revisions" YANG module has the following structure
(using the notation defined in [RFC8340]):
module: ietf-yl-revisions
augment /yanglib:yang-library/yanglib:module-set/yanglib:module:
+--ro revision-label? rev:revision-label
augment /yanglib:yang-library/yanglib:schema:
+--ro deprecated-nodes-implemented? empty
+--ro obsolete-nodes-absent? empty
5.2.1. Advertising revision-label
The ietf-yl-revisions YANG module augments the "module" list in ietf-
yang-library with a "revision-label" leaf to optionally declare the
revision label associated wth the particular revision of each module.
5.2.2. Reporting how deprecated and obsolete nodes are handled
The ietf-yl-revisions YANG module augments YANG library with two
leaves to allow a server to report how it handles status "deprecated" leaves to allow a server to report how it handles status "deprecated"
and status "obsolete" nodes. The leaves are: and status "obsolete" nodes. The leaves are:
deprecated-nodes-implemented: If present, this leaf indicates that deprecated-nodes-implemented: If present, this leaf indicates that
all schema nodes with a status "deprecated" child statement are all schema nodes with a status "deprecated" child statement are
implemented equivalently as if they had status "current", or implemented equivalently as if they had status "current", or
otherwise deviations MUST be used to explicitly remove otherwise deviations MUST be used to explicitly remove
"deprecated" nodes from the schema. If this leaf is absent then "deprecated" nodes from the schema. If this leaf is absent then
the behavior is unspecified. the behavior is unspecified.
skipping to change at page 14, line 12 skipping to change at page 15, line 30
YANG schema, or other revisions of the modules that define the YANG schema, or other revisions of the modules that define the
schema. schema.
7. Guidelines for using the YANG module update rules 7. Guidelines for using the YANG module update rules
The following text updates section 4.7 of [RFC8407] to revise the The following text updates section 4.7 of [RFC8407] to revise the
guidelines for updating YANG modules. guidelines for updating YANG modules.
7.1. Guidelines for YANG module authors 7.1. Guidelines for YANG module authors
All IETF YANG modules MUST include revision-label statements for all
newly published YANG modules, and all newly published revisions of
existing YANG modules. The revision-label MUST take the form of a
YANG semantic version number [I-D.verdt-netmod-yang-semver].
NBC changes to YANG modules may cause problems to clients, who are NBC changes to YANG modules may cause problems to clients, who are
consumers of YANG models, and hence YANG module authors are consumers of YANG models, and hence YANG module authors are
RECOMMENDED to minimize NBC changes and keep changes BC whenever RECOMMENDED to minimize NBC changes and keep changes BC whenever
possible. possible.
When NBC changes are introduced, consideration should be given to the When NBC changes are introduced, consideration should be given to the
impact on clients and YANG module authors SHOULD try to mitigate that impact on clients and YANG module authors SHOULD try to mitigate that
impact. impact.
A "rev:nbc-changes" statement SHOULD be added only if there are NBC A "rev:nbc-changes" statement SHOULD be added only if there are NBC
changes relative to the previous revision. changes relative to the previous revision.
Removing old revision statements from a module's revision history Removing old revision statements from a module's revision history
could break import by revision, and hence it is RECOMMENDED to retain could break import by revision, and hence it is RECOMMENDED to retain
them. If all depencencies have been updated to not import specific them. If all depencencies have been updated to not import specific
revisions of a module, then the corresponding revision statements can revisions of a module, then the corresponding revision statements can
be removed from that module. An alternative solution, if the be removed from that module. An alternative solution, if the
revision section is too long, would be remove, or curtail, the older revision section is too long, would be remove, or curtail, the older
description statements associated with the previous revisions. description statements associated with the previous revisions.
The "ver:revision-or-derived" extension should be used in YANG module The "rev:revision-or-derived" extension should be used in YANG module
imports to indicate revision dependencies between modules in imports to indicate revision dependencies between modules in
preference to the "revision-date" statement, which causes overly preference to the "revision-date" statement, which causes overly
strict import dependencies and SHOULD NOT be used. strict import dependencies and SHOULD NOT be used.
A module that includes submodules MUST use the "revision-date" A module that includes submodules MUST use the "revision-date"
statement to include specific submodule revisions. Changing a statement to include specific submodule revisions. Changing a
module's include statements to include different submodule revisions module's include statements to include different submodule revisions
requires a new revision of the module. requires a new revision of the module.
7.1.1. Making non-backwards-compatible changes to a YANG module 7.1.1. Making non-backwards-compatible changes to a YANG module
skipping to change at page 16, line 34 skipping to change at page 18, line 10
changes. When a node's status changes from "current" to changes. When a node's status changes from "current" to
"deprecated", clients SHOULD plan to stop using that node in a "deprecated", clients SHOULD plan to stop using that node in a
timely fashion. When a node's status changes to "obsolete", timely fashion. When a node's status changes to "obsolete",
clients MUST stop using that node. clients MUST stop using that node.
8. Module Versioning Extension YANG Modules 8. Module Versioning Extension YANG Modules
YANG module with extension statements for annotating NBC changes, YANG module with extension statements for annotating NBC changes,
revision label, status description, and importing by version. revision label, status description, and importing by version.
<CODE BEGINS> file "ietf-yang-revisions@2019-05-02.yang" <CODE BEGINS> file "ietf-yang-revisions@2019-09-18.yang"
module ietf-yang-revisions { module ietf-yang-revisions {
yang-version 1.1; yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-yang-revisions"; namespace "urn:ietf:params:xml:ns:yang:ietf-yang-revisions";
prefix rev; prefix rev;
import ietf-yang-types {
prefix yang;
reference
"XXXX [ietf-netmod-rfc6991-bis]: Common YANG Data Types";
}
organization organization
"IETF NETMOD (Network Modeling) Working Group"; "IETF NETMOD (Network Modeling) Working Group";
contact contact
"WG Web: <https://datatracker.ietf.org/wg/netmod/> "WG Web: <https://datatracker.ietf.org/wg/netmod/>
WG List: <mailto:netmod@ietf.org> WG List: <mailto:netmod@ietf.org>
Author: Benoit Claise Author: Benoit Claise
<mailto:bclaise@cisco.com> <mailto:bclaise@cisco.com>
Author: Joe Clarke Author: Joe Clarke
skipping to change at page 17, line 19 skipping to change at page 18, line 50
Author: Kevin D'Souza Author: Kevin D'Souza
<mailto:kd6913@att.com> <mailto:kd6913@att.com>
Author: Balazs Lengyel Author: Balazs Lengyel
<mailto:balazs.lengyel@ericsson.com> <mailto:balazs.lengyel@ericsson.com>
Author: Jason Sterne Author: Jason Sterne
<mailto:jason.sterne@nokia.com>"; <mailto:jason.sterne@nokia.com>";
description description
"This YANG 1.1 module contains definitions and extensions to "This YANG 1.1 module contains definitions and extensions to
support updated YANG revision handling."; support updated YANG revision handling.
revision 2019-05-02 { Copyright (c) 2019 IETF Trust and the persons identified as
description authors of the code. All rights reserved.
"Initial version. Derived from ietf-semver.yang@2019-02-17.";
reference
"draft-verdt-netmod-module-versioning: Updated YANG Module
Revision Handling";
}
typedef revision-identifier { Redistribution and use in source and binary forms, with or
type string { without modification, is permitted pursuant to, and subject
pattern '\d{4}-\d{2}-\d{2}'; to the license terms contained in, the Simplified BSD License
} set forth in Section 4.c of the IETF Trust's Legal Provisions
Relating to IETF Documents
(http://trustee.ietf.org/license-info).
This version of this YANG module is part of RFC XXXX; see
the RFC itself for full legal notices.
The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL
NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED',
'MAY', and 'OPTIONAL' in this document are to be interpreted as
described in BCP 14 (RFC 2119) (RFC 8174) when, and only when,
they appear in all capitals, as shown here.";
// RFC Ed.: update the date below with the date of RFC publication
// and remove this note.
// RFC Ed.: replace XXXX (inc above) with actual RFC number and
// remove this note.
revision 2019-09-18 {
description description
"Represents a specific date in YYYY-MM-DD format. "Initial version.";
TODO - Import and reuse type from 6991-bis"; reference
"XXXX: Updated YANG Module Revision Handling";
} }
typedef label-string { typedef revision-label {
type string { type string {
length "1..255"; length "1..255";
pattern '[^\s@]+'; pattern '[^\s@]+';
pattern '\d{4}-\d{2}-\d{2}' { pattern '\d{4}-\d{2}-\d{2}' {
modifier invert-match; modifier invert-match;
} }
} }
description description
"A label associated with a YANG revision. "A label associated with a YANG revision.
Excludes spaces and '@'. Cannot match revision-date."; Excludes spaces and '@'. MUST NOT match revision-date.
reference
"draft-verdt-netmod-yang-module-versioning: Revision label";
Revision labels that classify as YANG semantic versions,
as defined by the ietf-yang-semver:version typedef,
MUST conform to the versioning behaviour defined in
XXXX [verdt]: YANG Semantic Versioning.";
reference
"XXXX: Updated YANG Module Revision Handling;
Section 3.3, Revision label";
} }
typedef revision-date-or-label { typedef revision-date-or-label {
type union { type union {
type revision-identifier; type yang:revision-identifier;
type label-string; type revision-label;
} }
description description
"Represents either a YANG revision date or a revision label"; "Represents either a YANG revision date or a revision label";
} }
extension nbc-changes { extension nbc-changes {
description description
"This statement is used to indicate YANG module revisions that "This statement is used to indicate YANG module revisions that
contain non-backwards-compatible changes. contain non-backwards-compatible changes.
skipping to change at page 18, line 35 skipping to change at page 20, line 36
the preceding revision in the revision history, that do not the preceding revision in the revision history, that do not
conform to the module update rules defined in RFC-XXX, then conform to the module update rules defined in RFC-XXX, then
the 'nbc-changes' statement MUST be added as a substatement to the 'nbc-changes' statement MUST be added as a substatement to
the revision statement. the revision statement.
Conversely, if a revision of a YANG module only contains Conversely, if a revision of a YANG module only contains
changes, relative to the preceding revision in the revision changes, relative to the preceding revision in the revision
history, that are classified as 'backwards-compatible' then history, that are classified as 'backwards-compatible' then
the revision statement MUST NOT contain any 'nbc-changes' the revision statement MUST NOT contain any 'nbc-changes'
substatement."; substatement.";
reference reference
"draft-verdt-netmod-module-versioning: nbc-changes revision "XXXX: Updated YANG Module Revision Handling;
extension statement"; Section 3.2, nbc-changes revision extension statement";
} }
extension revision-label { extension revision-label {
argument label-string; argument revision-label;
description description
"The revision label can be used to provide an additional "The revision label can be used to provide an additional
versioning identifier associated with the revision. E.g., one versioning identifier associated with the revision. E.g., one
option for a versioning scheme that could be used is [TODO - option for a versioning scheme that could be used is [TODO -
Reference semver draft]. Reference semver draft].
The format of the revision-label argument MUST conform to the
pattern defined for the revision-label typedef.
Each 'revision' statement MAY have a single 'revision-label' Each 'revision' statement MAY have a single 'revision-label'
substatement. substatement.
Revision labels MUST be unique amongst all revisions of a Revision labels MUST be unique amongst all revisions of a
module."; module.";
reference reference
"draft-verdt-netmod-module-versioning: Revision label"; "XXXX: Updated YANG Module Revision Handling;
Section 3.3, Revision label";
} }
extension revision-or-derived { extension revision-or-derived {
argument revision-date-or-label; argument revision-date-or-label;
description description
"Restricts the revision of the module that may be imported to "Restricts the revision of the module that may be imported to
one that matches or is derived from the specified one that matches or is derived from the specified
revision-date or revision-nlabel. revision-date or revision-nlabel.
The argument value MUST conform to the The argument value MUST conform to the
skipping to change at page 19, line 41 skipping to change at page 21, line 48
imported module's revision history contains a revision imported module's revision history contains a revision
statement with a matching revision date or revision label. statement with a matching revision date or revision label.
The 'revision-or-derived' extension statement does not The 'revision-or-derived' extension statement does not
gaurantee that all module revisions that satisfy an import gaurantee that all module revisions that satisfy an import
statement are necessarily compatible, it only gives an statement are necessarily compatible, it only gives an
indication that the revisions are more likely to be indication that the revisions are more likely to be
compatible."; compatible.";
reference reference
"draft-verdt-netmod-yang-module-versioning: Import by derived "XXXX: Updated YANG Module Revision Handling;
revision"; Section 4, Import by derived revision";
} }
extension status-description { extension status-description {
argument description; argument description;
description description
"Freeform text that describes why a given node has been "Freeform text that describes why a given node has been
deprecated or made obsolete. E.g., the description could be deprecated or made obsolete. E.g., the description could be
used to give the reason for removal, or it could point to an used to give the reason for removal, or it could point to an
alternative schema elements that can be used in lieu of the alternative schema elements that can be used in lieu of the
given node. given node.
Each 'status' statement MAY have a single 'status-description' Each 'status' statement MAY have a single 'status-description'
substatement."; substatement.";
reference reference
"draft-verdt-netmod-yang-module-versioning: YANG status "XXXX: Updated YANG Module Revision Handling;
description extension"; Section 3.4, YANG status description extension statement";
} }
} }
<CODE ENDS> <CODE ENDS>
YANG module with augmentations to YANG Library to revision labels YANG module with augmentations to YANG Library to revision labels
<CODE BEGINS> file "ietf-yl-revisions@2019-05-02.yang" <CODE BEGINS> file "ietf-yl-revisions@2019-09-18.yang"
module ietf-yl-revisions { module ietf-yl-revisions {
yang-version 1.1; yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-yl-revisions"; namespace "urn:ietf:params:xml:ns:yang:ietf-yl-revisions";
prefix yl-rev; prefix yl-rev;
import ietf-revisions { import ietf-yang-revisions {
prefix rev; prefix rev;
reference
"XXXX: Updated YANG Module Revision Handling";
} }
import ietf-yang-library { import ietf-yang-library {
prefix yanglib; prefix yanglib;
reference "RFC 8525: YANG Libary";
} }
organization organization
"IETF NETMOD (Network Modeling) Working Group"; "IETF NETMOD (Network Modeling) Working Group";
contact contact
"WG Web: <https://datatracker.ietf.org/wg/netmod/> "WG Web: <https://datatracker.ietf.org/wg/netmod/>
WG List: <mailto:netmod@ietf.org> WG List: <mailto:netmod@ietf.org>
Author: Benoit Claise Author: Benoit Claise
<mailto:bclaise@cisco.com> <mailto:bclaise@cisco.com>
skipping to change at page 21, line 13 skipping to change at page 23, line 23
<mailto:kd6913@att.com> <mailto:kd6913@att.com>
Author: Balazs Lengyel Author: Balazs Lengyel
<mailto:balazs.lengyel@ericsson.com> <mailto:balazs.lengyel@ericsson.com>
Author: Jason Sterne Author: Jason Sterne
<mailto:jason.sterne@nokia.com>"; <mailto:jason.sterne@nokia.com>";
description description
"This module contains augmentations to YANG Library to add module "This module contains augmentations to YANG Library to add module
level revision label and to provide an indication of how level revision label and to provide an indication of how
deprecated and obsolete nodes are handled by the server."; deprecated and obsolete nodes are handled by the server.
revision 2019-05-02 { Copyright (c) 2019 IETF Trust and the persons identified as
authors of the code. 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 Simplified BSD License
set forth in Section 4.c of the IETF Trust's Legal Provisions
Relating to IETF Documents
(http://trustee.ietf.org/license-info).
This version of this YANG module is part of RFC XXXX; see
the RFC itself for full legal notices.
The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL
NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED',
'MAY', and 'OPTIONAL' in this document are to be interpreted as
described in BCP 14 (RFC 2119) (RFC 8174) when, and only when,
they appear in all capitals, as shown here.";
// RFC Ed.: update the date below with the date of RFC publication
// and remove this note.
// RFC Ed.: replace XXXX (including in the imports above) with
// actual RFC number and remove this note.
// RFC Ed.: please replace revision-label version with 1.0.0 and
// remove this note.
revision 2019-09-18 {
rev:revision-label 0.1.0;
description description
"Initial revision, derived from ietf-yl-semver~2019-02-17"; "Initial revision";
reference reference
"draft-verdt-netmod-module-versioning: Updated YANG Module "XXXX: Updated YANG Module Revision Handling";
Revision Handling";
} }
augment "/yanglib:yang-library/yanglib:module-set/yanglib:module" { augment "/yanglib:yang-library/yanglib:module-set/yanglib:module" {
description description
"Augmentation modules with a revision label"; "Augmentation modules with a revision label";
leaf revision-label { leaf revision-label {
type rev:label-string; type rev:revision-label;
description description
"The revision label associated with this module revision. "The revision label associated with this module revision.
The label MUST match the rev:label value in the specific The label MUST match the rev:label value in the specific
revision of the module loaded in this module-set."; revision of the module loaded in this module-set.";
reference reference
"draft-verdt-netmod-module-versioning: Updated YANG Module "XXXX: Updated YANG Module Revision Handling;
Revision Handling"; Section 5.2.1, Advertising revision-label";
} }
} }
augment "/yanglib:yang-library/yanglib:schema" { augment "/yanglib:yang-library/yanglib:schema" {
description description
"Augmentations to the ietf-yang-library module to indicate how "Augmentations to the ietf-yang-library module to indicate how
deprecated and obsoleted nodes are handled for each datastore deprecated and obsoleted nodes are handled for each datastore
schema supported by the server."; schema supported by the server.";
leaf deprecated-nodes-implemented { leaf deprecated-nodes-implemented {
type empty; type empty;
description description
"If present, this leaf indicates that all schema nodes with a "If present, this leaf indicates that all schema nodes with a
status 'deprecated' child statement are implemented status 'deprecated' child statement are implemented
equivalently as if they had status 'current', or otherwise equivalently as if they had status 'current', or otherwise
deviations MUST be used to explicitly remove 'deprecated' deviations MUST be used to explicitly remove 'deprecated'
nodes from the schema. If this leaf is absent then the nodes from the schema. If this leaf is absent then the
behavior is unspecified."; behavior is unspecified.";
reference reference
"draft-verdt-netmod-yang-semver: Reporting how deprecated and "XXXX: Updated YANG Module Revision Handling;
obsolete nodes are handled"; Section 5.2.2, Reporting how deprecated and obsolete nodes
are handled";
} }
leaf obsolete-nodes-absent { leaf obsolete-nodes-absent {
type empty; type empty;
description description
"If present, this leaf indicates that the server does not "If present, this leaf indicates that the server does not
implement any status 'obsolete' nodes. If this leaf is implement any status 'obsolete' nodes. If this leaf is
absent then the behaviour is unspecified."; absent then the behaviour is unspecified.";
reference reference
"draft-verdt-netmod-yang-semver: Reporting how deprecated and "XXXX: Updated YANG Module Revision Handling;
obsolete nodes are handled"; Section 5.2.2, Reporting how deprecated and obsolete nodes
are handled";
} }
} }
} }
<CODE ENDS> CODE ENDS>
9. Contributors 9. Contributors
This document grew out of the YANG module versioning design team that This document grew out of the YANG module versioning design team that
started after IETF 101. The following individuals are (or have been) started after IETF 101. The following individuals are (or have been)
members of the design team and have worked on the YANG versioning members of the design team and have worked on the YANG versioning
project: project:
o Balazs Lengyel o Balazs Lengyel
skipping to change at page 23, line 47 skipping to change at page 26, line 41
XML Namespace: urn:ietf:params:xml:ns:yang:ietf-yl-revisions XML Namespace: urn:ietf:params:xml:ns:yang:ietf-yl-revisions
Prefix: yl-rev Prefix: yl-rev
Reference: [RFCXXXX] Reference: [RFCXXXX]
12. References 12. References
12.1. Normative References 12.1. Normative References
[I-D.ietf-netmod-rfc6991-bis]
Schoenwaelder, J., "Common YANG Data Types", draft-ietf-
netmod-rfc6991-bis-01 (work in progress), July 2019.
[I-D.verdt-netmod-yang-semver]
Claise, B., Clarke, J., Rahman, R., Wilton, R., Lengyel,
B., Sterne, J., and K. D'Souza, "YANG Semantic
Versioning", draft-verdt-netmod-yang-semver-01 (work in
progress), October 2019.
[I-D.verdt-netmod-yang-versioning-reqs] [I-D.verdt-netmod-yang-versioning-reqs]
Clarke, J., "YANG Module Versioning Requirements", draft- Clarke, J., "YANG Module Versioning Requirements", draft-
verdt-netmod-yang-versioning-reqs-02 (work in progress), verdt-netmod-yang-versioning-reqs-02 (work in progress),
November 2018. November 2018.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997, DOI 10.17487/RFC2119, March 1997,
<https://www.rfc-editor.org/info/rfc2119>. <https://www.rfc-editor.org/info/rfc2119>.
skipping to change at page 24, line 41 skipping to change at page 27, line 46
12.2. Informative References 12.2. Informative References
[I-D.clacla-netmod-yang-model-update] [I-D.clacla-netmod-yang-model-update]
Claise, B., Clarke, J., Lengyel, B., and K. D'Souza, "New Claise, B., Clarke, J., Lengyel, B., and K. D'Souza, "New
YANG Module Update Procedure", draft-clacla-netmod-yang- YANG Module Update Procedure", draft-clacla-netmod-yang-
model-update-06 (work in progress), July 2018. model-update-06 (work in progress), July 2018.
[I-D.ietf-netmod-yang-instance-file-format] [I-D.ietf-netmod-yang-instance-file-format]
Lengyel, B. and B. Claise, "YANG Instance Data File Lengyel, B. and B. Claise, "YANG Instance Data File
Format", draft-ietf-netmod-yang-instance-file-format-02 Format", draft-ietf-netmod-yang-instance-file-format-04
(work in progress), February 2019. (work in progress), August 2019.
[I-D.rwilton-netmod-yang-packages] [I-D.rwilton-netmod-yang-packages]
Wilton, R., "YANG Packages", draft-rwilton-netmod-yang- Wilton, R., "YANG Packages", draft-rwilton-netmod-yang-
packages-01 (work in progress), March 2019. packages-01 (work in progress), March 2019.
[I-D.verdt-netmod-yang-solutions] [I-D.verdt-netmod-yang-solutions]
Wilton, R., "YANG Versioning Potential Solutions", draft- Wilton, R., "YANG Versioning Solution Overview", draft-
verdt-netmod-yang-solutions-00 (work in progress), October verdt-netmod-yang-solutions-01 (work in progress), July
2018. 2019.
[I-D.wilton-netmod-yang-ver-selection] [I-D.wilton-netmod-yang-ver-selection]
Wilton, R. and R. Rahman, "YANG Schema Version Selection", Wilton, R. and R. Rahman, "YANG Schema Version Selection",
draft-wilton-netmod-yang-ver-selection-00 (work in draft-wilton-netmod-yang-ver-selection-00 (work in
progress), March 2019. progress), March 2019.
[RFC8340] Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams",
BCP 215, RFC 8340, DOI 10.17487/RFC8340, March 2018,
<https://www.rfc-editor.org/info/rfc8340>.
[semver] "Semantic Versioning 2.0.0", <https://www.semver.org>.
Appendix A. Appendix Appendix A. Appendix
A.1. Examples of guidelines for making NBC changes to a YANG module A.1. Examples of guidelines for making NBC changes to a YANG module
Examples of NBC changes include: Examples of NBC changes include:
o Deleting a data node, or changing it to status obsolete. o Deleting a data node, or changing it to status obsolete.
o Changing the name, type, or units of a data node. o Changing the name, type, or units of a data node.
 End of changes. 65 change blocks. 
113 lines changed or deleted 216 lines changed or added

This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/