-
Notifications
You must be signed in to change notification settings - Fork 3
/
ietf-semver.yang
179 lines (153 loc) · 7.27 KB
/
ietf-semver.yang
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
module ietf-semver {
yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-semver";
prefix semver;
import ietf-yang-library {
prefix yanglib;
}
organization
"IETF NETMOD (Network Modeling) Working Group";
contact
"WG Web: <https://datatracker.ietf.org/wg/netmod/>
WG List: <mailto:netmod@ietf.org>
Author: Benoit Claise
<mailto:bclaise@cisco.com>
Author: Joe Clarke
<mailto:jclarke@cisco.com>
Author: Kevin D'Souza
<mailto:kd6913@att.com>
Author: Balazs Lengyel
<mailto:balazs.lengyel@ericsson.com>";
description
"This module contains a definition for a YANG 1.1 extension to
express the semantic version of YANG modules.";
revision 2018-04-05 {
description
"* Properly import ietf-yang-library.
* Fix the name of module-semver => module-version.
* Fix regular expression syntax.
* Augment yang-library with booleans as to whether or not
deprecated and obsolete nodes are present.
* Add an extension to enable import by semantic version.
* Add an extension status-description to track deprecated
and obsolete reasons.
* Fix yang-library augments to use 7895bis.";
reference
"draft-clacla-netmod-yang-model-update:
New YANG Module Update Procedure";
semver:module-version "0.2.1";
}
revision 2017-12-15 {
description
"Initial revision.";
reference
"draft-clacla-netmod-yang-model-update:
New YANG Module Update Procedure";
semver:module-version "0.1.1";
}
extension module-version {
argument semver;
description
"The version number for the module revision it is used in.
This is expressed as a semantic version string in the form:
x.y.z
where:
* x corresponds to the major version,
* y corresponds to a minor version,
* z corresponds to a patch version.
A major version number of 0 indicates that this model is still
in development, and is potentially subject to change.
Following a release of major version 1, all modules will
increment major revision number where backwards incompatible
changes to the model are made.
The minor version is changed when features are added to the
model that do not impact current clients use of the model.
When major version is stepped, the minor version is reset to 0.
The patch-level version is incremented when non-feature changes
(such as bugfixes or clarifications to human-readable
descriptions that do not impact model functionality) are made
that maintain backwards compatibility.
When major or minor version is stepped, the patch-level is
reset to 0.
By comparing the module-version between two revisions of a
given module, one can know if different revisions are backwards
compatible or not, as well as
whether or not new features have been added to a newer revision.
If a module contains this extension it indicates that for this
module the updated status and update rules as this described in
RFC XXXX are used.
The statement MUST only be a substatement of the revision statement.
Zero or one module-version statement is allowed per parent
statement. NO substatements are allowed.
";
reference "http://semver.org/ : Semantic Versioning 2.0.0";
}
extension import-versions {
argument version-clause;
description
"This extension specifies an acceptable set of semantic versions of a given module
that may be imported. The version-clause argument is specified in the following
format
[\\[(]X[.Y[.Z]][-[X[.Y[.X]]][\\])]][,...]
Where the first character MAY be a '[' or '(' to indicate at least inclusive and at least
exclusive (respectively). If this is omitted, a full semantic version must be specified
and the import will only support this one version.
The following version, if specified with a '[' or '(' indicates the lower bound. This can
be a full semantic version or a MAJOR only or MAJOR.MINOR only.
The '-', if specified, is a literal hyphen indicating a range will be specified. If the second portion
of the import-versions clause is omitted, then there is no upper bound on what will be considered
an acceptable imported version.
After the '-' the upper bound semantic version (or part thereof) follows.
After the upper bound version, one of ']' or ')' MUST follow to indicate whether this limit is inclusive
or exclusive of the upper bound respectively.
Finally, a literal comma (',') MAY be specified with additional ranges. Each range is taken as a logical
OR.
The statement MUST only be a substatement of the import statement. Zero or one
import-versions statement is allowed per import statement. NO substatements are allowed.";
reference "I-D.clacla-netmod-yang-model-update : Import By Semantic Version";
}
extension status-description {
argument description;
description
"Freeform text that describes why a given node has been deprecated or made obsolete.
This may point to other schema elements that can be used in lieu of the given node.
This statement MUST only be used as a substatement of the status statement, and MUST
only be used when the status is deprecated or obsolete. Zero or more status-description
statements are allowed per parent statement. NO substatements are allowed.";
reference "I-D.clacla-netmod-yang-model-update : Deprecated and Obsolete Reasons";
}
augment "/yanglib:yang-library/yanglib:module-set/yanglib:module" {
description
"Augmentations for the ietf-yang-library module to support semantic versioning.";
leaf version {
type string {
pattern '[0-9]+\.[0-9]+\.[0-9]+';
}
description
"The semantic version for this module in MAJOR.MINOR.PATCH format. This version
must match the semver:module-version value in specific revision of the module
loaded in this module-set.";
}
leaf deprecated-nodes-present {
type boolean;
default "true";
description
"A boolean that indicates whether or not this server implements deprecated nodes.
The value of this leaf SHOULD be true; and if so, the server MUST implement nodes
within this module as they are documented. If specific deprecated nodes are not
implemented as document, then they MUST be listed as deviations. If a module does
not currently contain any deprecated nodes, then this leaf SHOULD be set to true.";
}
leaf obsolete-nodes-present {
type boolean;
default "false";
description
"A boolean that indicates whether or not this server implements obsolete nodes.
The value of this leaf SHOULD be false; and if so, the server MUST NOT implement
nodes within this module. If this leaf is true, then all nodes in this module MUST
be implemented as documented in the module. Any variation of this MUST be listed as
deviations. If a module does not currently contain any obsolete nodes, then this
leaf SHOULD be set to true.";
}
}
}