blob: 7e596b122a32e2425daf3ec39e7f58201fdbef91 [file] [log] [blame]
Michal Vaskoe893ddd2020-06-23 13:35:20 +02001module yang {
2 namespace "urn:ietf:params:xml:ns:yang:1";
3 prefix yang;
4
5 import ietf-yang-metadata {
6 prefix md;
7 revision-date 2016-08-05;
8 }
9
10 organization
11 "libyang";
12
13 contact
14 "Web: <https://github.com/CESNET/libyang/>
15 Author: Radek Krejci <rkrejci@cesnet.cz>";
16
17 description
18 "This is a kind of fake model with no data, typedefs or anything
19 else. libyang uses this module to implement various YANG attributes
20 defined in RFC 6020.";
21
22 revision 2020-06-17 {
23 description
24 "Added metadata for diff.";
25 }
26
27 revision 2017-02-20 {
28 description
29 "Added metadata for NETCONF's edit-config manipulation with ordered
30 lists and leaf-lists.";
31 reference
32 "RFC 7950: The YANG 1.1 Data Modeling Language";
33 }
34
35 revision 2016-02-11 {
36 description
37 "Initial revision";
38 reference
39 "RFC 6020: YANG - A Data Modeling Language for
40 the Network Configuration Protocol (NETCONF)";
41 }
42
43 md:annotation insert {
44 type enumeration {
45 enum first;
46 enum last;
47 enum before;
48 enum after;
49 }
50 reference "RFC7950 section 7.8.6. and section 7.7.9.";
51 description
52 "In user ordered leaf-list, the attribute can be used to control
53 where in the leaf-list the entry is inserted. It can be used during
54 the NETCONF <edit-config> \"create\" operations to insert a new list or
55 leaf-list entry, or during \"merge\" or \"replace\" operations to insert
56 a new list or leaf-list entry or move an existing one.
57
58 If the value is \"before\" or \"after\", the \"value\"/\"key\" attribute
59 MUST also be used to specify an existing entry in the list or leaf-list.
60
61 If no \"insert\" attribute is present in the \"create\" operation, it
62 defaults to \"last\".";
63 }
64
65 md:annotation value {
66 type string;
67 reference "RFC7950 section 7.7.9.";
68 description
69 "In user ordered leaf-list, the attribute must be used if the attribute
70 insert is used and specifies before/after which existing instance the
71 new instance should be inserted.";
72 }
73
74 md:annotation key {
75 type string;
76 reference "RFC7950 section 7.8.6.";
77 description
78 "In user ordered list, the attribute must be used if the attribute
79 insert is used and specifies before/after which existing instance the
80 new instance should be inserted.";
81 }
82
83 md:annotation operation {
84 type enumeration {
85 enum none {
86 description
87 "The node existed in both data trees but there is a nested node
88 with another operation. In case of a leaf, only its default
89 flag changed.";
90 }
91 enum create {
92 description
93 "The node did not exist in the first tree and was created in the
94 second tree.";
95 }
96 enum delete {
97 description
98 "The node existed in the first tree and was deleted in the second
99 tree.";
100 }
101 enum replace {
102 description
103 "The node value was changed or the node was moved for
104 leaves/anyxml/anydata and user-ordered lists/leaf-lists,
105 respectively.";
106 }
107 }
108 reference "RFC6241 section 7.2.";
109 description
110 "Operation of a node in a diff. If a node has no operation,
111 it is inherited from its nearest parent with an operation.
112 Top-level nodes must always have an operation.
113
114 User-ordered lists/leaf-lists with operation 'create' and
115 'replace' MUST also have the 'key' or 'value' metadata defined.
116 It specifies the succeeding instance. In case the value of
117 this metadata is empty, the node was created/moved on the
118 last position.
119
120 All the operations keep the meaning of edit-config operations
121 with similar names but some are further restricted, meaning
122 they are used for only a subset of use-cases.";
123 }
124
125 md:annotation orig-default {
126 type boolean;
127 description
128 "Information about the previous default state of the node.";
129 }
130
131 md:annotation orig-value {
132 type string;
133 description
134 "Previous value of a changed leaf. Alternatly, its meaning
135 is the same as \"value\" attribute but identifies the original
136 leaf-list instance rather than the new one.";
137 }
138
139 md:annotation orig-key {
140 type string;
141 description
142 "Its meaning is the same as \"key\" attribute but identifies
143 the original list instance rather than the new one.";
144 }
145}