3 // the namespace for NETCONF XML definitions is unchanged
4 // from RFC 4741, which this document replaces
5 namespace "urn:ietf:params:xml:ns:netconf:base:1.0";
9 import ietf-inet-types {
14 "IETF NETCONF (Network Configuration) Working Group";
17 "WG Web: <http://tools.ietf.org/wg/netconf/>
18 WG List: <netconf@ietf.org>
21 <bertietf@bwijnen.net>
23 WG Chair: Mehmet Ersue
24 <mehmet.ersue@nsn.com>
26 Editor: Martin Bjorklund
29 Editor: Juergen Schoenwaelder
30 <j.schoenwaelder@jacobs-university.de>
33 <andy.bierman@brocade.com>";
35 "NETCONF Protocol Data Types and Protocol Operations.
37 Copyright (c) 2011 IETF Trust and the persons identified as
38 the document authors. All rights reserved.
40 Redistribution and use in source and binary forms, with or
41 without modification, is permitted pursuant to, and subject
42 to the license terms contained in, the Simplified BSD License
43 set forth in Section 4.c of the IETF Trust's Legal Provisions
44 Relating to IETF Documents
45 (http://trustee.ietf.org/license-info).
47 This version of this YANG module is part of RFC 6241; see
48 the RFC itself for full legal notices.";
54 "RFC 6241: Network Configuration Protocol";
57 extension get-filter-element-attributes {
59 "If this extension is present within an 'anyxml'
60 statement named 'filter', which must be conceptually
61 defined within the RPC input section for the <get>
62 and <get-config> protocol operations, then the
63 following unqualified XML attribute is supported
64 within the <filter> element, within a <get> or
65 <get-config> protocol operation:
67 type : optional attribute with allowed
68 value strings 'subtree' and 'xpath'.
69 If missing, the default value is 'subtree'.
71 If the 'xpath' feature is supported, then the
72 following unqualified XML attribute is
75 select: optional attribute containing a
76 string representing an XPath expression.
77 The 'type' attribute must be equal to 'xpath'
78 if this attribute is present.";
81 // NETCONF capabilities defined as features
82 feature writable-running {
84 "NETCONF :writable-running capability;
85 If the server advertises the :writable-running
86 capability for a session, then this feature must
87 also be enabled for that session. Otherwise,
88 this feature must not be enabled.";
89 reference "RFC 6241, Section 8.2";
94 "NETCONF :candidate capability;
95 If the server advertises the :candidate
96 capability for a session, then this feature must
97 also be enabled for that session. Otherwise,
98 this feature must not be enabled.";
99 reference "RFC 6241, Section 8.3";
102 feature confirmed-commit {
103 if-feature candidate;
105 "NETCONF :confirmed-commit:1.1 capability;
106 If the server advertises the :confirmed-commit:1.1
107 capability for a session, then this feature must
108 also be enabled for that session. Otherwise,
109 this feature must not be enabled.";
111 reference "RFC 6241, Section 8.4";
114 feature rollback-on-error {
116 "NETCONF :rollback-on-error capability;
117 If the server advertises the :rollback-on-error
118 capability for a session, then this feature must
119 also be enabled for that session. Otherwise,
120 this feature must not be enabled.";
121 reference "RFC 6241, Section 8.5";
126 "NETCONF :validate:1.1 capability;
127 If the server advertises the :validate:1.1
128 capability for a session, then this feature must
129 also be enabled for that session. Otherwise,
130 this feature must not be enabled.";
131 reference "RFC 6241, Section 8.6";
136 "NETCONF :startup capability;
137 If the server advertises the :startup
138 capability for a session, then this feature must
139 also be enabled for that session. Otherwise,
140 this feature must not be enabled.";
141 reference "RFC 6241, Section 8.7";
146 "NETCONF :url capability;
147 If the server advertises the :url
148 capability for a session, then this feature must
149 also be enabled for that session. Otherwise,
150 this feature must not be enabled.";
151 reference "RFC 6241, Section 8.8";
156 "NETCONF :xpath capability;
157 If the server advertises the :xpath
158 capability for a session, then this feature must
159 also be enabled for that session. Otherwise,
160 this feature must not be enabled.";
161 reference "RFC 6241, Section 8.9";
164 // NETCONF Simple Types
166 typedef session-id-type {
171 "NETCONF Session Id";
174 typedef session-id-or-zero-type {
177 "NETCONF Session Id or Zero to indicate none";
179 typedef error-tag-type {
183 "The request requires a resource that
188 "The request specifies an unacceptable value for one
189 or more parameters.";
193 "The request or response (that would be generated) is
194 too large for the implementation to handle.";
196 enum missing-attribute {
198 "An expected attribute is missing.";
202 "An attribute value is not correct; e.g., wrong type,
203 out of range, pattern mismatch.";
205 enum unknown-attribute {
207 "An unexpected attribute is present.";
209 enum missing-element {
211 "An expected element is missing.";
215 "An element value is not correct; e.g., wrong type,
216 out of range, pattern mismatch.";
218 enum unknown-element {
220 "An unexpected element is present.";
222 enum unknown-namespace {
224 "An unexpected namespace is present.";
228 "Access to the requested protocol operation or
229 data model is denied because authorization failed.";
233 "Access to the requested lock is denied because the
234 lock is currently held by another entity.";
236 enum resource-denied {
238 "Request could not be completed because of
239 insufficient resources.";
241 enum rollback-failed {
243 "Request to roll back some configuration change (via
244 rollback-on-error or <discard-changes> operations)
245 was not completed for some reason.";
250 "Request could not be completed because the relevant
251 data model content already exists. For example,
252 a 'create' operation was attempted on data that
257 "Request could not be completed because the relevant
258 data model content does not exist. For example,
259 a 'delete' operation was attempted on
260 data that does not exist.";
262 enum operation-not-supported {
264 "Request could not be completed because the requested
265 operation is not supported by this implementation.";
267 enum operation-failed {
269 "Request could not be completed because the requested
270 operation failed for some reason not covered by
271 any other error condition.";
273 enum partial-operation {
275 "This error-tag is obsolete, and SHOULD NOT be sent
276 by servers conforming to this document.";
278 enum malformed-message {
280 "A message could not be handled because it failed to
281 be parsed correctly. For example, the message is not
282 well-formed XML or it uses an invalid character set.";
285 description "NETCONF Error Tag";
286 reference "RFC 6241, Appendix A";
289 typedef error-severity-type {
292 description "Error severity";
295 description "Warning severity";
298 description "NETCONF Error Severity";
299 reference "RFC 6241, Section 4.3";
302 typedef edit-operation-type {
306 "The configuration data identified by the
307 element containing this attribute is merged
308 with the configuration at the corresponding
309 level in the configuration datastore identified
310 by the target parameter.";
314 "The configuration data identified by the element
315 containing this attribute replaces any related
316 configuration in the configuration datastore
317 identified by the target parameter. If no such
318 configuration data exists in the configuration
319 datastore, it is created. Unlike a
320 <copy-config> operation, which replaces the
321 entire target configuration, only the configuration
322 actually present in the config parameter is affected.";
326 "The configuration data identified by the element
327 containing this attribute is added to the
328 configuration if and only if the configuration
329 data does not already exist in the configuration
330 datastore. If the configuration data exists, an
331 <rpc-error> element is returned with an
332 <error-tag> value of 'data-exists'.";
336 "The configuration data identified by the element
337 containing this attribute is deleted from the
338 configuration if and only if the configuration
339 data currently exists in the configuration
340 datastore. If the configuration data does not
341 exist, an <rpc-error> element is returned with
342 an <error-tag> value of 'data-missing'.";
346 "The configuration data identified by the element
347 containing this attribute is deleted from the
348 configuration if the configuration
349 data currently exists in the configuration
350 datastore. If the configuration data does not
351 exist, the 'remove' operation is silently ignored
356 description "NETCONF 'operation' attribute values";
357 reference "RFC 6241, Section 7.2";
360 // NETCONF Standard Protocol Operations
364 "Retrieve all or part of a specified configuration.";
366 reference "RFC 6241, Section 7.1";
371 "Particular configuration to retrieve.";
373 choice config-source {
376 "The configuration to retrieve.";
378 if-feature candidate;
381 "The candidate configuration is the config source.";
386 "The running configuration is the config source.";
392 "The startup configuration is the config source.
393 This is optional-to-implement on the server because
394 not all servers will support filtering for this
402 "Subtree or XPath filter to use.";
403 nc:get-filter-element-attributes;
410 "Copy of the source datastore subset that matched
411 the filter criteria (if any). An empty data container
412 indicates that the request did not produce any results.";
419 "The <edit-config> operation loads all or part of a specified
420 configuration to the specified target configuration.";
422 reference "RFC 6241, Section 7.2";
427 "Particular configuration to edit.";
429 choice config-target {
432 "The configuration target.";
435 if-feature candidate;
438 "The candidate configuration is the config target.";
441 if-feature writable-running;
444 "The running configuration is the config source.";
449 leaf default-operation {
453 "The default operation is merge.";
457 "The default operation is replace.";
461 "There is no default operation.";
466 "The default operation to use.";
474 "The server will test and then set if no errors.";
478 "The server will set without a test first.";
483 "The server will only test and not set, even
484 if there are no errors.";
487 default "test-then-set";
489 "The test option to use.";
496 "The server will stop on errors.";
498 enum continue-on-error {
500 "The server may continue on errors.";
502 enum rollback-on-error {
504 "The server will roll back on errors.
505 This value can only be used if the 'rollback-on-error'
506 feature is supported.";
509 default "stop-on-error";
511 "The error option to use.";
514 choice edit-content {
517 "The content for the edit operation.";
521 "Inline Config content.";
527 "URL-based config content.";
535 "Create or replace an entire configuration datastore with the
536 contents of another complete configuration datastore.";
538 reference "RFC 6241, Section 7.3";
543 "Particular configuration to copy to.";
545 choice config-target {
548 "The configuration target of the copy operation.";
551 if-feature candidate;
554 "The candidate configuration is the config target.";
557 if-feature writable-running;
560 "The running configuration is the config target.
561 This is optional-to-implement on the server.";
567 "The startup configuration is the config target.";
573 "The URL-based configuration is the config target.";
580 "Particular configuration to copy from.";
582 choice config-source {
585 "The configuration source for the copy operation.";
588 if-feature candidate;
591 "The candidate configuration is the config source.";
596 "The running configuration is the config source.";
602 "The startup configuration is the config source.";
608 "The URL-based configuration is the config source.";
612 "Inline Config content: <config> element. Represents
613 an entire configuration datastore, not
614 a subset of the running datastore.";
623 "Delete a configuration datastore.";
625 reference "RFC 6241, Section 7.4";
630 "Particular configuration to delete.";
632 choice config-target {
635 "The configuration target to delete.";
641 "The startup configuration is the config target.";
647 "The URL-based configuration is the config target.";
656 "The lock operation allows the client to lock the configuration
657 system of a device.";
659 reference "RFC 6241, Section 7.5";
664 "Particular configuration to lock.";
666 choice config-target {
669 "The configuration target to lock.";
672 if-feature candidate;
675 "The candidate configuration is the config target.";
680 "The running configuration is the config target.";
686 "The startup configuration is the config target.";
695 "The unlock operation is used to release a configuration lock,
696 previously obtained with the 'lock' operation.";
698 reference "RFC 6241, Section 7.6";
703 "Particular configuration to unlock.";
705 choice config-target {
708 "The configuration target to unlock.";
711 if-feature candidate;
714 "The candidate configuration is the config target.";
719 "The running configuration is the config target.";
725 "The startup configuration is the config target.";
734 "Retrieve running configuration and device state information.";
736 reference "RFC 6241, Section 7.7";
741 "This parameter specifies the portion of the system
742 configuration and state data to retrieve.";
743 nc:get-filter-element-attributes;
750 "Copy of the running datastore subset and/or state
751 data that matched the filter criteria (if any).
752 An empty data container indicates that the request did not
753 produce any results.";
760 "Request graceful termination of a NETCONF session.";
762 reference "RFC 6241, Section 7.8";
767 "Force the termination of a NETCONF session.";
769 reference "RFC 6241, Section 7.9";
773 type session-id-type;
776 "Particular session to kill.";
782 if-feature candidate;
785 "Commit the candidate configuration as the device's new
786 current configuration.";
788 reference "RFC 6241, Section 8.3.4.1";
792 if-feature confirmed-commit;
795 "Requests a confirmed commit.";
796 reference "RFC 6241, Section 8.3.4.1";
799 leaf confirm-timeout {
800 if-feature confirmed-commit;
805 default "600"; // 10 minutes
807 "The timeout interval for a confirmed commit.";
808 reference "RFC 6241, Section 8.3.4.1";
812 if-feature confirmed-commit;
815 "This parameter is used to make a confirmed commit
816 persistent. A persistent confirmed commit is not aborted
817 if the NETCONF session terminates. The only way to abort
818 a persistent confirmed commit is to let the timer expire,
819 or to use the <cancel-commit> operation.
821 The value of this parameter is a token that must be given
822 in the 'persist-id' parameter of <commit> or
823 <cancel-commit> operations in order to confirm or cancel
824 the persistent confirmed commit.
826 The token should be a random string.";
827 reference "RFC 6241, Section 8.3.4.1";
831 if-feature confirmed-commit;
834 "This parameter is given in order to commit a persistent
835 confirmed commit. The value must be equal to the value
836 given in the 'persist' parameter to the <commit> operation.
837 If it does not match, the operation fails with an
838 'invalid-value' error.";
839 reference "RFC 6241, Section 8.3.4.1";
845 rpc discard-changes {
846 if-feature candidate;
849 "Revert the candidate configuration to the current
850 running configuration.";
851 reference "RFC 6241, Section 8.3.4.2";
855 if-feature confirmed-commit;
857 "This operation is used to cancel an ongoing confirmed commit.
858 If the confirmed commit is persistent, the parameter
859 'persist-id' must be given, and it must match the value of the
860 'persist' parameter.";
861 reference "RFC 6241, Section 8.4.4.1";
867 "This parameter is given in order to cancel a persistent
868 confirmed commit. The value must be equal to the value
869 given in the 'persist' parameter to the <commit> operation.
870 If it does not match, the operation fails with an
871 'invalid-value' error.";
880 "Validates the contents of the specified configuration.";
882 reference "RFC 6241, Section 8.6.4.1";
887 "Particular configuration to validate.";
889 choice config-source {
892 "The configuration source to validate.";
895 if-feature candidate;
898 "The candidate configuration is the config source.";
903 "The running configuration is the config source.";
909 "The startup configuration is the config source.";
915 "The URL-based configuration is the config source.";
919 "Inline Config content: <config> element. Represents
920 an entire configuration datastore, not
921 a subset of the running datastore.";