blob: c49458a11c36f34ad664ff7cfb0dd305559bb9e6 [file] [log] [blame]
tadeas-vintrlik2aa36b42021-11-03 13:07:34 +01001module ietf-yang-schema-mount {
2 yang-version 1.1;
3 namespace "urn:ietf:params:xml:ns:yang:ietf-yang-schema-mount";
4 prefix yangmnt;
5
6 import ietf-inet-types {
7 prefix inet;
8 reference
9 "RFC 6991: Common YANG Data Types";
10 }
11
12 import ietf-yang-types {
13 prefix yang;
14 reference
15 "RFC 6991: Common YANG Data Types";
16 }
17
18 organization
19 "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
20
21 contact
22 "WG Web: <https://datatracker.ietf.org/wg/netmod/>
23 WG List: <mailto:netmod@ietf.org>
24
25 Editor: Martin Bjorklund
26 <mailto:mbj@tail-f.com>
27
28 Editor: Ladislav Lhotka
29 <mailto:lhotka@nic.cz>";
30
31 description
32 "This module defines a YANG extension statement that can be used
33 to incorporate data models defined in other YANG modules in a
34 module. It also defines operational state data that specify the
35 overall structure of the data model.
36
37 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL
38 NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED',
39 'MAY', and 'OPTIONAL' in this document are to be interpreted as
40 described in BCP 14 (RFC 2119) (RFC 8174) when, and only when,
41 they appear in all capitals, as shown here.
42
43 Copyright (c) 2019 IETF Trust and the persons identified as
44 authors of the code. All rights reserved.
45
46 Redistribution and use in source and binary forms, with or
47 without modification, is permitted pursuant to, and subject to
48 the license terms contained in, the Simplified BSD License set
49 forth in Section 4.c of the IETF Trust's Legal Provisions
50 Relating to IETF Documents
51 (https://trustee.ietf.org/license-info).
52
53 This version of this YANG module is part of RFC 8528;
54 see the RFC itself for full legal notices.";
55
56 revision 2019-01-14 {
57 description
58 "Initial revision.";
59 reference
60 "RFC 8528: YANG Schema Mount";
61 }
62
63 /*
64 * Extensions
65 */
66
67 extension mount-point {
68 argument label;
69 description
70 "The argument 'label' is a YANG identifier, i.e., it is of the
71 type 'yang:yang-identifier'.
72
73 The 'mount-point' statement MUST NOT be used in a YANG
74 version 1 module, neither explicitly nor via a 'uses'
75 statement.
76 The 'mount-point' statement MAY be present as a substatement
77 of 'container' and 'list' and MUST NOT be present elsewhere.
78 There MUST NOT be more than one 'mount-point' statement in a
79 given 'container' or 'list' statement.
80
81 If a mount point is defined within a grouping, its label is
82 bound to the module where the grouping is used.
83
84 A mount point defines a place in the node hierarchy where
85 other data models may be attached. A server that implements a
86 module with a mount point populates the
87 '/schema-mounts/mount-point' list with detailed information on
88 which data models are mounted at each mount point.
89
90 Note that the 'mount-point' statement does not define a new
91 data node.";
92 }
93
94 /*
95 * State data nodes
96 */
97
98 container schema-mounts {
99 config false;
100 description
101 "Contains information about the structure of the overall
102 mounted data model implemented in the server.";
103 list namespace {
104 key "prefix";
105 description
106 "This list provides a mapping of namespace prefixes that are
107 used in XPath expressions of 'parent-reference' leafs to the
108 corresponding namespace URI references.";
109 leaf prefix {
110 type yang:yang-identifier;
111 description
112 "Namespace prefix.";
113 }
114 leaf uri {
115 type inet:uri;
116 description
117 "Namespace URI reference.";
118 }
119 }
120 list mount-point {
121 key "module label";
122
123 description
124 "Each entry of this list specifies a schema for a particular
125 mount point.
126
127 Each mount point MUST be defined using the 'mount-point'
128 extension in one of the modules listed in the server's
129 YANG library instance with conformance type 'implement'.";
130 leaf module {
131 type yang:yang-identifier;
132 description
133 "Name of a module containing the mount point.";
134 }
135 leaf label {
136 type yang:yang-identifier;
137 description
138 "Label of the mount point defined using the 'mount-point'
139 extension.";
140 }
141 leaf config {
142 type boolean;
143 default "true";
144 description
145 "If this leaf is set to 'false', then all data nodes in the
146 mounted schema are read-only ('config false'), regardless
147 of their 'config' property.";
148 }
149 choice schema-ref {
150 mandatory true;
151 description
152 "Alternatives for specifying the schema.";
153 container inline {
154 presence
155 "A complete self-contained schema is mounted at the
156 mount point.";
157 description
158 "This node indicates that the server has mounted at least
159 the module 'ietf-yang-library' at the mount point, and
160 its instantiation provides the information about the
161 mounted schema.
162
163 Different instances of the mount point may have
164 different schemas mounted.";
165 }
166 container shared-schema {
167 presence
168 "The mounted schema together with the 'parent-reference'
169 make up the schema for this mount point.";
170
171 description
172 "This node indicates that the server has mounted at least
173 the module 'ietf-yang-library' at the mount point, and
174 its instantiation provides the information about the
175 mounted schema. When XPath expressions in the mounted
176 schema are evaluated, the 'parent-reference' leaf-list
177 is taken into account.
178
179 Different instances of the mount point MUST have the
180 same schema mounted.";
181 leaf-list parent-reference {
182 type yang:xpath1.0;
183 description
184 "Entries of this leaf-list are XPath 1.0 expressions
185 that are evaluated in the following context:
186
187 - The context node is the node in the parent data tree
188 where the mount-point is defined.
189
190 - The accessible tree is the parent data tree
191 *without* any nodes defined in modules that are
192 mounted inside the parent schema.
193
194 - The context position and context size are both equal
195 to 1.
196
197 - The set of variable bindings is empty.
198
199 - The function library is the core function library
200 defined in the W3C XPath 1.0 document
201 (http://www.w3.org/TR/1999/REC-xpath-19991116) and
202 the functions defined in Section 10 of RFC 7950.
203
204 - The set of namespace declarations is defined by the
205 'namespace' list under 'schema-mounts'.
206
207 Each XPath expression MUST evaluate to a node-set
208 (possibly empty). For the purposes of evaluating
209 XPath expressions whose context nodes are defined in
210 the mounted schema, the union of all these node-sets
211 together with ancestor nodes are added to the
212 accessible data tree.
213
214 Note that in the case 'ietf-yang-schema-mount' is
215 itself mounted, a 'parent-reference' in the mounted
216 module may refer to nodes that were brought into the
217 accessible tree through a 'parent-reference' in the
218 parent schema.";
219 }
220 }
221 }
222 }
223 }
224}