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.";
53 "RFC 6241: Network Configuration Protocol";
56 extension get-filter-element-attributes {
58 "If this extension is present within an 'anyxml'
59 statement named 'filter', which must be conceptually
60 defined within the RPC input section for the <get>
61 and <get-config> protocol operations, then the
62 following unqualified XML attribute is supported
63 within the <filter> element, within a <get> or
64 <get-config> protocol operation:
66 type : optional attribute with allowed
67 value strings 'subtree' and 'xpath'.
68 If missing, the default value is 'subtree'.
70 If the 'xpath' feature is supported, then the
71 following unqualified XML attribute is
74 select: optional attribute containing a
75 string representing an XPath expression.
76 The 'type' attribute must be equal to 'xpath'
77 if this attribute is present.";
80 // NETCONF capabilities defined as features
81 feature writable-running {
83 "NETCONF :writable-running capability;
84 If the server advertises the :writable-running
85 capability for a session, then this feature must
86 also be enabled for that session. Otherwise,
87 this feature must not be enabled.";
88 reference "RFC 6241, Section 8.2";
93 "NETCONF :candidate capability;
94 If the server advertises the :candidate
95 capability for a session, then this feature must
96 also be enabled for that session. Otherwise,
97 this feature must not be enabled.";
98 reference "RFC 6241, Section 8.3";
101 feature confirmed-commit {
102 if-feature candidate;
104 "NETCONF :confirmed-commit:1.1 capability;
105 If the server advertises the :confirmed-commit:1.1
106 capability for a session, then this feature must
107 also be enabled for that session. Otherwise,
108 this feature must not be enabled.";
110 reference "RFC 6241, Section 8.4";
113 feature rollback-on-error {
115 "NETCONF :rollback-on-error capability;
116 If the server advertises the :rollback-on-error
117 capability for a session, then this feature must
118 also be enabled for that session. Otherwise,
119 this feature must not be enabled.";
120 reference "RFC 6241, Section 8.5";
125 "NETCONF :validate:1.1 capability;
126 If the server advertises the :validate:1.1
127 capability for a session, then this feature must
128 also be enabled for that session. Otherwise,
129 this feature must not be enabled.";
130 reference "RFC 6241, Section 8.6";
135 "NETCONF :startup capability;
136 If the server advertises the :startup
137 capability for a session, then this feature must
138 also be enabled for that session. Otherwise,
139 this feature must not be enabled.";
140 reference "RFC 6241, Section 8.7";
145 "NETCONF :url capability;
146 If the server advertises the :url
147 capability for a session, then this feature must
148 also be enabled for that session. Otherwise,
149 this feature must not be enabled.";
150 reference "RFC 6241, Section 8.8";
155 "NETCONF :xpath capability;
156 If the server advertises the :xpath
157 capability for a session, then this feature must
158 also be enabled for that session. Otherwise,
159 this feature must not be enabled.";
160 reference "RFC 6241, Section 8.9";
163 // NETCONF Simple Types
165 typedef session-id-type {
170 "NETCONF Session Id";
173 typedef session-id-or-zero-type {
176 "NETCONF Session Id or Zero to indicate none";
178 typedef error-tag-type {
182 "The request requires a resource that
187 "The request specifies an unacceptable value for one
188 or more parameters.";
192 "The request or response (that would be generated) is
193 too large for the implementation to handle.";
195 enum missing-attribute {
197 "An expected attribute is missing.";
201 "An attribute value is not correct; e.g., wrong type,
202 out of range, pattern mismatch.";
204 enum unknown-attribute {
206 "An unexpected attribute is present.";
208 enum missing-element {
210 "An expected element is missing.";
214 "An element value is not correct; e.g., wrong type,
215 out of range, pattern mismatch.";
217 enum unknown-element {
219 "An unexpected element is present.";
221 enum unknown-namespace {
223 "An unexpected namespace is present.";
227 "Access to the requested protocol operation or
228 data model is denied because authorization failed.";
232 "Access to the requested lock is denied because the
233 lock is currently held by another entity.";
235 enum resource-denied {
237 "Request could not be completed because of
238 insufficient resources.";
240 enum rollback-failed {
242 "Request to roll back some configuration change (via
243 rollback-on-error or <discard-changes> operations)
244 was not completed for some reason.";
249 "Request could not be completed because the relevant
250 data model content already exists. For example,
251 a 'create' operation was attempted on data that
256 "Request could not be completed because the relevant
257 data model content does not exist. For example,
258 a 'delete' operation was attempted on
259 data that does not exist.";
261 enum operation-not-supported {
263 "Request could not be completed because the requested
264 operation is not supported by this implementation.";
266 enum operation-failed {
268 "Request could not be completed because the requested
269 operation failed for some reason not covered by
270 any other error condition.";
272 enum partial-operation {
274 "This error-tag is obsolete, and SHOULD NOT be sent
275 by servers conforming to this document.";
277 enum malformed-message {
279 "A message could not be handled because it failed to
280 be parsed correctly. For example, the message is not
281 well-formed XML or it uses an invalid character set.";
284 description "NETCONF Error Tag";
285 reference "RFC 6241, Appendix A";
288 typedef error-severity-type {
291 description "Error severity";
294 description "Warning severity";
297 description "NETCONF Error Severity";
298 reference "RFC 6241, Section 4.3";
301 typedef edit-operation-type {
305 "The configuration data identified by the
306 element containing this attribute is merged
307 with the configuration at the corresponding
308 level in the configuration datastore identified
309 by the target parameter.";
313 "The configuration data identified by the element
314 containing this attribute replaces any related
315 configuration in the configuration datastore
316 identified by the target parameter. If no such
317 configuration data exists in the configuration
318 datastore, it is created. Unlike a
319 <copy-config> operation, which replaces the
320 entire target configuration, only the configuration
321 actually present in the config parameter is affected.";
325 "The configuration data identified by the element
326 containing this attribute is added to the
327 configuration if and only if the configuration
328 data does not already exist in the configuration
329 datastore. If the configuration data exists, an
330 <rpc-error> element is returned with an
331 <error-tag> value of 'data-exists'.";
335 "The configuration data identified by the element
336 containing this attribute is deleted from the
337 configuration if and only if the configuration
338 data currently exists in the configuration
339 datastore. If the configuration data does not
340 exist, an <rpc-error> element is returned with
341 an <error-tag> value of 'data-missing'.";
345 "The configuration data identified by the element
346 containing this attribute is deleted from the
347 configuration if the configuration
348 data currently exists in the configuration
349 datastore. If the configuration data does not
350 exist, the 'remove' operation is silently ignored
355 description "NETCONF 'operation' attribute values";
356 reference "RFC 6241, Section 7.2";
359 // NETCONF Standard Protocol Operations
363 "Retrieve all or part of a specified configuration.";
365 reference "RFC 6241, Section 7.1";
370 "Particular configuration to retrieve.";
372 choice config-source {
375 "The configuration to retrieve.";
377 if-feature candidate;
380 "The candidate configuration is the config source.";
385 "The running configuration is the config source.";
391 "The startup configuration is the config source.
392 This is optional-to-implement on the server because
393 not all servers will support filtering for this
401 "Subtree or XPath filter to use.";
402 nc:get-filter-element-attributes;
409 "Copy of the source datastore subset that matched
410 the filter criteria (if any). An empty data container
411 indicates that the request did not produce any results.";
418 "The <edit-config> operation loads all or part of a specified
419 configuration to the specified target configuration.";
421 reference "RFC 6241, Section 7.2";
426 "Particular configuration to edit.";
428 choice config-target {
431 "The configuration target.";
434 if-feature candidate;
437 "The candidate configuration is the config target.";
440 if-feature writable-running;
443 "The running configuration is the config source.";
448 leaf default-operation {
452 "The default operation is merge.";
456 "The default operation is replace.";
460 "There is no default operation.";
465 "The default operation to use.";
473 "The server will test and then set if no errors.";
477 "The server will set without a test first.";
482 "The server will only test and not set, even
483 if there are no errors.";
486 default "test-then-set";
488 "The test option to use.";
495 "The server will stop on errors.";
497 enum continue-on-error {
499 "The server may continue on errors.";
501 enum rollback-on-error {
503 "The server will roll back on errors.
504 This value can only be used if the 'rollback-on-error'
505 feature is supported.";
508 default "stop-on-error";
510 "The error option to use.";
513 choice edit-content {
516 "The content for the edit operation.";
520 "Inline Config content.";
526 "URL-based config content.";
534 "Create or replace an entire configuration datastore with the
535 contents of another complete configuration datastore.";
537 reference "RFC 6241, Section 7.3";
542 "Particular configuration to copy to.";
544 choice config-target {
547 "The configuration target of the copy operation.";
550 if-feature candidate;
553 "The candidate configuration is the config target.";
556 if-feature writable-running;
559 "The running configuration is the config target.
560 This is optional-to-implement on the server.";
566 "The startup configuration is the config target.";
572 "The URL-based configuration is the config target.";
579 "Particular configuration to copy from.";
581 choice config-source {
584 "The configuration source for the copy operation.";
587 if-feature candidate;
590 "The candidate configuration is the config source.";
595 "The running configuration is the config source.";
601 "The startup configuration is the config source.";
607 "The URL-based configuration is the config source.";
611 "Inline Config content: <config> element. Represents
612 an entire configuration datastore, not
613 a subset of the running datastore.";
622 "Delete a configuration datastore.";
624 reference "RFC 6241, Section 7.4";
629 "Particular configuration to delete.";
631 choice config-target {
634 "The configuration target to delete.";
640 "The startup configuration is the config target.";
646 "The URL-based configuration is the config target.";
655 "The lock operation allows the client to lock the configuration
656 system of a device.";
658 reference "RFC 6241, Section 7.5";
663 "Particular configuration to lock.";
665 choice config-target {
668 "The configuration target to lock.";
671 if-feature candidate;
674 "The candidate configuration is the config target.";
679 "The running configuration is the config target.";
685 "The startup configuration is the config target.";
694 "The unlock operation is used to release a configuration lock,
695 previously obtained with the 'lock' operation.";
697 reference "RFC 6241, Section 7.6";
702 "Particular configuration to unlock.";
704 choice config-target {
707 "The configuration target to unlock.";
710 if-feature candidate;
713 "The candidate configuration is the config target.";
718 "The running configuration is the config target.";
724 "The startup configuration is the config target.";
733 "Retrieve running configuration and device state information.";
735 reference "RFC 6241, Section 7.7";
740 "This parameter specifies the portion of the system
741 configuration and state data to retrieve.";
742 nc:get-filter-element-attributes;
749 "Copy of the running datastore subset and/or state
750 data that matched the filter criteria (if any).
751 An empty data container indicates that the request did not
752 produce any results.";
759 "Request graceful termination of a NETCONF session.";
761 reference "RFC 6241, Section 7.8";
766 "Force the termination of a NETCONF session.";
768 reference "RFC 6241, Section 7.9";
772 type session-id-type;
775 "Particular session to kill.";
781 if-feature candidate;
784 "Commit the candidate configuration as the device's new
785 current configuration.";
787 reference "RFC 6241, Section 8.3.4.1";
791 if-feature confirmed-commit;
794 "Requests a confirmed commit.";
795 reference "RFC 6241, Section 8.3.4.1";
798 leaf confirm-timeout {
799 if-feature confirmed-commit;
804 default "600"; // 10 minutes
806 "The timeout interval for a confirmed commit.";
807 reference "RFC 6241, Section 8.3.4.1";
811 if-feature confirmed-commit;
814 "This parameter is used to make a confirmed commit
815 persistent. A persistent confirmed commit is not aborted
816 if the NETCONF session terminates. The only way to abort
817 a persistent confirmed commit is to let the timer expire,
818 or to use the <cancel-commit> operation.
820 The value of this parameter is a token that must be given
821 in the 'persist-id' parameter of <commit> or
822 <cancel-commit> operations in order to confirm or cancel
823 the persistent confirmed commit.
825 The token should be a random string.";
826 reference "RFC 6241, Section 8.3.4.1";
830 if-feature confirmed-commit;
833 "This parameter is given in order to commit a persistent
834 confirmed commit. The value must be equal to the value
835 given in the 'persist' parameter to the <commit> operation.
836 If it does not match, the operation fails with an
837 'invalid-value' error.";
838 reference "RFC 6241, Section 8.3.4.1";
844 rpc discard-changes {
845 if-feature candidate;
848 "Revert the candidate configuration to the current
849 running configuration.";
850 reference "RFC 6241, Section 8.3.4.2";
854 if-feature confirmed-commit;
856 "This operation is used to cancel an ongoing confirmed commit.
857 If the confirmed commit is persistent, the parameter
858 'persist-id' must be given, and it must match the value of the
859 'persist' parameter.";
860 reference "RFC 6241, Section 8.4.4.1";
866 "This parameter is given in order to cancel a persistent
867 confirmed commit. The value must be equal to the value
868 given in the 'persist' parameter to the <commit> operation.
869 If it does not match, the operation fails with an
870 'invalid-value' error.";
879 "Validates the contents of the specified configuration.";
881 reference "RFC 6241, Section 8.6.4.1";
886 "Particular configuration to validate.";
888 choice config-source {
891 "The configuration source to validate.";
894 if-feature candidate;
897 "The candidate configuration is the config source.";
902 "The running configuration is the config source.";
908 "The startup configuration is the config source.";
914 "The URL-based configuration is the config source.";
918 "Inline Config content: <config> element. Represents
919 an entire configuration datastore, not
920 a subset of the running datastore.";