1 module ietf-netconf-nmda {
3 namespace "urn:ietf:params:xml:ns:yang:ietf-netconf-nmda";
6 import ietf-yang-types {
9 "RFC 6991: Common YANG Data Types";
11 import ietf-inet-types {
14 "RFC 6991: Common YANG Data Types";
16 import ietf-datastores {
19 "RFC 8342: Network Management Datastore Architecture
25 "RFC 8342: Network Management Datastore Architecture
31 "RFC 6241: Network Configuration Protocol (NETCONF)";
33 import ietf-netconf-with-defaults {
36 "RFC 6243: With-defaults Capability for NETCONF";
40 "IETF NETCONF Working Group";
43 "WG Web: <https://datatracker.ietf.org/wg/netconf/>
45 WG List: <mailto:netconf@ietf.org>
47 Author: Martin Bjorklund
48 <mailto:mbj@tail-f.com>
50 Author: Juergen Schoenwaelder
51 <mailto:j.schoenwaelder@jacobs-university.de>
54 <mailto:phil@juniper.net>
57 <mailto:kent+ietf@watsen.net>
60 <mailto:rwilton@cisco.com>";
62 "This YANG module defines a set of NETCONF operations to support
63 the Network Management Datastore Architecture (NMDA).
65 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL
66 NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED',
67 'MAY', and 'OPTIONAL' in this document are to be interpreted as
68 described in BCP 14 (RFC 2119) (RFC 8174) when, and only when,
69 they appear in all capitals, as shown here.
71 Copyright (c) 2019 IETF Trust and the persons identified as
72 authors of the code. All rights reserved.
74 Redistribution and use in source and binary forms, with or
75 without modification, is permitted pursuant to, and subject to
76 the license terms contained in, the Simplified BSD License set
77 forth in Section 4.c of the IETF Trust's Legal Provisions
78 Relating to IETF Documents
79 (https://trustee.ietf.org/license-info).
81 This version of this YANG module is part of RFC 8526; see
82 the RFC itself for full legal notices.";
88 "RFC 8526: NETCONF Extensions to Support the Network Management
89 Datastore Architecture";
94 "Indicates that the server supports the 'origin' annotation.";
96 "RFC 8342: Network Management Datastore Architecture (NMDA)";
99 feature with-defaults {
101 "NETCONF :with-defaults capability. If the server advertises
102 the :with-defaults capability for a session, then this
103 feature must also be enabled for that session. Otherwise,
104 this feature must not be enabled.";
106 "RFC 6243: With-defaults Capability for NETCONF, Section 4; and
107 RFC 8526: NETCONF Extensions to Support the Network Management
108 Datastore Architecture, Section 3.1.1.2";
113 "Retrieve data from an NMDA datastore. The content returned
114 by get-data must satisfy all filters, i.e., the filter
115 criteria are logically ANDed.
117 Any ancestor nodes (including list keys) of nodes selected by
118 the filters are included in the response.
120 The 'with-origin' parameter is only valid for an operational
121 datastore. If 'with-origin' is used with an invalid
122 datastore, then the server MUST return an <rpc-error> element
123 with an <error-tag> value of 'invalid-value'.
125 The 'with-defaults' parameter only applies to the operational
126 datastore if the NETCONF :with-defaults and
127 :with-operational-defaults capabilities are both advertised.
128 If the 'with-defaults' parameter is present in a request for
129 which it is not supported, then the server MUST return an
130 <rpc-error> element with an <error-tag> value of
134 type ds:datastore-ref;
138 "Datastore from which to retrieve data.
140 If the datastore is not supported by the server, then the
141 server MUST return an <rpc-error> element with an
142 <error-tag> value of 'invalid-value'.";
146 "The content filter specification for this request.";
147 anydata subtree-filter {
149 "This parameter identifies the portions of the
150 target datastore to retrieve.";
152 "RFC 6241: Network Configuration Protocol (NETCONF),
156 if-feature "nc:xpath";
159 "This parameter contains an XPath expression identifying
160 the portions of the target datastore to retrieve.
162 If the expression returns a node-set, all nodes in the
163 node-set are selected by the filter. Otherwise, if the
164 expression does not return a node-set, then the
165 <get-data> operation fails.
167 The expression is evaluated in the following XPath
170 o The set of namespace declarations are those in
171 scope on the 'xpath-filter' leaf element.
173 o The set of variable bindings is empty.
175 o The function library is the core function library,
176 and the XPath functions are defined in Section 10
179 o The context node is the root node of the target
186 "Filter for nodes with the given value for their 'config'
187 property. When this leaf is set to 'true', only 'config
188 true' nodes are selected, and when set to 'false', only
189 'config false' nodes are selected. If this leaf is not
190 present, no nodes are filtered.";
192 choice origin-filters {
193 when 'derived-from-or-self(datastore, "ds:operational")';
196 "Filters configuration nodes based on the 'origin'
197 annotation. Configuration nodes that do not have an
198 'origin' annotation are treated as if they have the
199 'origin' annotation 'or:unknown'.
201 System state nodes are not affected by origin-filters and
202 thus not filtered. Note that system state nodes can be
203 filtered with the 'config-filter' leaf.";
205 leaf-list origin-filter {
208 "Filter based on the 'origin' annotation. A
209 configuration node matches the filter if its 'origin'
210 annotation is derived from or equal to any of the given
213 leaf-list negated-origin-filter {
216 "Filter based on the 'origin' annotation. A
217 configuration node matches the filter if its 'origin'
218 annotation is neither derived from nor equal to any of
219 the given filter values.";
230 "All descendant nodes are included.";
236 "For each node selected by the filters, this parameter
237 selects how many conceptual subtree levels should be
238 returned in the reply. If the depth is 1, the reply
239 includes just the selected nodes but no children. If the
240 depth is 'unbounded', all descendant nodes are included.";
243 when 'derived-from-or-self(../datastore, "ds:operational")';
247 "If this parameter is present, the server will return
248 the 'origin' annotation for the nodes that have one.";
250 uses ncwd:with-defaults-parameters {
251 if-feature "with-defaults";
257 "Copy of the source datastore subset that matched
258 the filter criteria (if any). An empty data
259 container indicates that the request did not
260 produce any results.";
267 "Edit data in an NMDA datastore.
269 If an error condition occurs such that an error severity
270 <rpc-error> element is generated, the server will stop
271 processing the <edit-data> operation and restore the
272 specified configuration to its complete state at
273 the start of this <edit-data> operation.";
276 type ds:datastore-ref;
280 "Datastore that is the target of the <edit-data> operation.
282 If the target datastore is not writable, or is not
283 supported by the server, then the server MUST return an
284 <rpc-error> element with an <error-tag> value of
287 leaf default-operation {
291 "The default operation is merge.";
295 "The default operation is replace.";
299 "There is no default operation.";
304 "The default operation to use.";
306 choice edit-content {
309 "The content for the edit operation.";
312 "Inline config content.";
318 "URL-based config content.";
325 * Augment the <lock> and <unlock> operations with a
326 * "datastore" parameter.
329 augment "/nc:lock/nc:input/nc:target/nc:config-target" {
331 "Add NMDA datastore as target.";
333 type ds:datastore-ref;
337 The <lock> operation is only supported on writable
340 If the <lock> operation is not supported by the server on
341 the specified target datastore, then the server MUST return
342 an <rpc-error> element with an <error-tag> value of
347 augment "/nc:unlock/nc:input/nc:target/nc:config-target" {
349 "Add NMDA datastore as target.";
351 type ds:datastore-ref;
353 "Datastore to unlock.
355 The <unlock> operation is only supported on writable
358 If the <unlock> operation is not supported by the server on
359 the specified target datastore, then the server MUST return
360 an <rpc-error> element with an <error-tag> value of
366 * Augment the <validate> operation with a
367 * "datastore" parameter.
370 augment "/nc:validate/nc:input/nc:source/nc:config-source" {
372 "Add NMDA datastore as source.";
374 type ds:datastore-ref;
376 "Datastore to validate.
378 The <validate> operation is supported only on configuration
381 If the <validate> operation is not supported by the server
382 on the specified target datastore, then the server MUST
383 return an <rpc-error> element with an <error-tag> value of