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 {
13 import netconf-cli-ext { prefix cliext; revision-date 2014-05-26; }
17 "IETF NETCONF (Network Configuration) Working Group";
20 "WG Web: <http://tools.ietf.org/wg/netconf/>
21 WG List: <netconf@ietf.org>
24 <bertietf@bwijnen.net>
26 WG Chair: Mehmet Ersue
27 <mehmet.ersue@nsn.com>
29 Editor: Martin Bjorklund
32 Editor: Juergen Schoenwaelder
33 <j.schoenwaelder@jacobs-university.de>
36 <andy.bierman@brocade.com>";
38 "NETCONF Protocol Data Types and Protocol Operations.
40 Copyright (c) 2011 IETF Trust and the persons identified as
41 the document authors. All rights reserved.
43 Redistribution and use in source and binary forms, with or
44 without modification, is permitted pursuant to, and subject
45 to the license terms contained in, the Simplified BSD License
46 set forth in Section 4.c of the IETF Trust's Legal Provisions
47 Relating to IETF Documents
48 (http://trustee.ietf.org/license-info).
50 This version of this YANG module is part of RFC 6241; see
51 the RFC itself for full legal notices.";
56 "RFC 6241: Network Configuration Protocol";
59 extension get-filter-element-attributes {
61 "If this extension is present within an 'anyxml'
62 statement named 'filter', which must be conceptually
63 defined within the RPC input section for the <get>
64 and <get-config> protocol operations, then the
65 following unqualified XML attribute is supported
66 within the <filter> element, within a <get> or
67 <get-config> protocol operation:
69 type : optional attribute with allowed
70 value strings 'subtree' and 'xpath'.
71 If missing, the default value is 'subtree'.
73 If the 'xpath' feature is supported, then the
74 following unqualified XML attribute is
77 select: optional attribute containing a
78 string representing an XPath expression.
79 The 'type' attribute must be equal to 'xpath'
80 if this attribute is present.";
83 // NETCONF capabilities defined as features
84 feature writable-running {
86 "NETCONF :writable-running capability;
87 If the server advertises the :writable-running
88 capability for a session, then this feature must
89 also be enabled for that session. Otherwise,
90 this feature must not be enabled.";
91 reference "RFC 6241, Section 8.2";
96 "NETCONF :candidate capability;
97 If the server advertises the :candidate
98 capability for a session, then this feature must
99 also be enabled for that session. Otherwise,
100 this feature must not be enabled.";
101 reference "RFC 6241, Section 8.3";
104 feature confirmed-commit {
105 if-feature candidate;
107 "NETCONF :confirmed-commit:1.1 capability;
108 If the server advertises the :confirmed-commit:1.1
109 capability for a session, then this feature must
110 also be enabled for that session. Otherwise,
111 this feature must not be enabled.";
113 reference "RFC 6241, Section 8.4";
116 feature rollback-on-error {
118 "NETCONF :rollback-on-error capability;
119 If the server advertises the :rollback-on-error
120 capability for a session, then this feature must
121 also be enabled for that session. Otherwise,
122 this feature must not be enabled.";
123 reference "RFC 6241, Section 8.5";
128 "NETCONF :validate:1.1 capability;
129 If the server advertises the :validate:1.1
130 capability for a session, then this feature must
131 also be enabled for that session. Otherwise,
132 this feature must not be enabled.";
133 reference "RFC 6241, Section 8.6";
138 "NETCONF :startup capability;
139 If the server advertises the :startup
140 capability for a session, then this feature must
141 also be enabled for that session. Otherwise,
142 this feature must not be enabled.";
143 reference "RFC 6241, Section 8.7";
148 "NETCONF :url capability;
149 If the server advertises the :url
150 capability for a session, then this feature must
151 also be enabled for that session. Otherwise,
152 this feature must not be enabled.";
153 reference "RFC 6241, Section 8.8";
158 "NETCONF :xpath capability;
159 If the server advertises the :xpath
160 capability for a session, then this feature must
161 also be enabled for that session. Otherwise,
162 this feature must not be enabled.";
163 reference "RFC 6241, Section 8.9";
166 // NETCONF Simple Types
168 typedef session-id-type {
173 "NETCONF Session Id";
176 typedef session-id-or-zero-type {
179 "NETCONF Session Id or Zero to indicate none";
181 typedef error-tag-type {
185 "The request requires a resource that
190 "The request specifies an unacceptable value for one
191 or more parameters.";
195 "The request or response (that would be generated) is
196 too large for the implementation to handle.";
198 enum missing-attribute {
200 "An expected attribute is missing.";
204 "An attribute value is not correct; e.g., wrong type,
205 out of range, pattern mismatch.";
207 enum unknown-attribute {
209 "An unexpected attribute is present.";
211 enum missing-element {
213 "An expected element is missing.";
217 "An element value is not correct; e.g., wrong type,
218 out of range, pattern mismatch.";
220 enum unknown-element {
222 "An unexpected element is present.";
224 enum unknown-namespace {
226 "An unexpected namespace is present.";
230 "Access to the requested protocol operation or
231 data model is denied because authorization failed.";
235 "Access to the requested lock is denied because the
236 lock is currently held by another entity.";
238 enum resource-denied {
240 "Request could not be completed because of
241 insufficient resources.";
243 enum rollback-failed {
245 "Request to roll back some configuration change (via
246 rollback-on-error or <discard-changes> operations)
247 was not completed for some reason.";
252 "Request could not be completed because the relevant
253 data model content already exists. For example,
254 a 'create' operation was attempted on data that
259 "Request could not be completed because the relevant
260 data model content does not exist. For example,
261 a 'delete' operation was attempted on
262 data that does not exist.";
264 enum operation-not-supported {
266 "Request could not be completed because the requested
267 operation is not supported by this implementation.";
269 enum operation-failed {
271 "Request could not be completed because the requested
272 operation failed for some reason not covered by
273 any other error condition.";
275 enum partial-operation {
277 "This error-tag is obsolete, and SHOULD NOT be sent
278 by servers conforming to this document.";
280 enum malformed-message {
282 "A message could not be handled because it failed to
283 be parsed correctly. For example, the message is not
284 well-formed XML or it uses an invalid character set.";
287 description "NETCONF Error Tag";
288 reference "RFC 6241, Appendix A";
291 typedef error-severity-type {
294 description "Error severity";
297 description "Warning severity";
300 description "NETCONF Error Severity";
301 reference "RFC 6241, Section 4.3";
304 typedef edit-operation-type {
308 "The configuration data identified by the
309 element containing this attribute is merged
310 with the configuration at the corresponding
311 level in the configuration datastore identified
312 by the target parameter.";
316 "The configuration data identified by the element
317 containing this attribute replaces any related
318 configuration in the configuration datastore
319 identified by the target parameter. If no such
320 configuration data exists in the configuration
321 datastore, it is created. Unlike a
322 <copy-config> operation, which replaces the
323 entire target configuration, only the configuration
324 actually present in the config parameter is affected.";
328 "The configuration data identified by the element
329 containing this attribute is added to the
330 configuration if and only if the configuration
331 data does not already exist in the configuration
332 datastore. If the configuration data exists, an
333 <rpc-error> element is returned with an
334 <error-tag> value of 'data-exists'.";
338 "The configuration data identified by the element
339 containing this attribute is deleted from the
340 configuration if and only if the configuration
341 data currently exists in the configuration
342 datastore. If the configuration data does not
343 exist, an <rpc-error> element is returned with
344 an <error-tag> value of 'data-missing'.";
348 "The configuration data identified by the element
349 containing this attribute is deleted from the
350 configuration if the configuration
351 data currently exists in the configuration
352 datastore. If the configuration data does not
353 exist, the 'remove' operation is silently ignored
358 description "NETCONF 'operation' attribute values";
359 reference "RFC 6241, Section 7.2";
362 // NETCONF Standard Protocol Operations
366 "Retrieve all or part of a specified configuration.";
368 reference "RFC 6241, Section 7.1";
373 "Particular configuration to retrieve.";
375 choice config-source {
378 "The configuration to retrieve.";
380 if-feature candidate;
383 "The candidate configuration is the config source.";
388 "The running configuration is the config source.";
394 "The startup configuration is the config source.
395 This is optional-to-implement on the server because
396 not all servers will support filtering for this
404 "Subtree or XPath filter to use.";
405 nc:get-filter-element-attributes;
406 // TODO this extension should be augmented (anyxml nodes cannot be augmented)
407 // or we can identify custom input/output arguments by schemaPath defined for custom handlers
408 cliext:argument-handler org.opendaylight.controller.netconf.cli.reader.custom.FilterReader;
415 "Copy of the source datastore subset that matched
416 the filter criteria (if any). An empty data container
417 indicates that the request did not produce any results.";
418 cliext:argument-handler org.opendaylight.controller.netconf.cli.writer.custom.DataWriter;
425 "The <edit-config> operation loads all or part of a specified
426 configuration to the specified target configuration.";
428 reference "RFC 6241, Section 7.2";
433 "Particular configuration to edit.";
435 choice config-target {
438 "The configuration target.";
441 if-feature candidate;
444 "The candidate configuration is the config target.";
447 if-feature writable-running;
450 "The running configuration is the config source.";
455 leaf default-operation {
459 "The default operation is merge.";
463 "The default operation is replace.";
467 "There is no default operation.";
472 "The default operation to use.";
480 "The server will test and then set if no errors.";
484 "The server will set without a test first.";
489 "The server will only test and not set, even
490 if there are no errors.";
493 default "test-then-set";
495 "The test option to use.";
502 "The server will stop on errors.";
504 enum continue-on-error {
506 "The server may continue on errors.";
508 enum rollback-on-error {
510 "The server will roll back on errors.
511 This value can only be used if the 'rollback-on-error'
512 feature is supported.";
515 default "stop-on-error";
517 "The error option to use.";
520 choice edit-content {
523 "The content for the edit operation.";
525 cliext:argument-handler org.opendaylight.controller.netconf.cli.reader.custom.EditContentReader;
529 "Inline Config content.";
530 cliext:argument-handler org.opendaylight.controller.netconf.cli.reader.custom.ConfigReader;
537 "URL-based config content.";
545 "Create or replace an entire configuration datastore with the
546 contents of another complete configuration datastore.";
548 reference "RFC 6241, Section 7.3";
553 "Particular configuration to copy to.";
555 choice config-target {
558 "The configuration target of the copy operation.";
561 if-feature candidate;
564 "The candidate configuration is the config target.";
567 if-feature writable-running;
570 "The running configuration is the config target.
571 This is optional-to-implement on the server.";
577 "The startup configuration is the config target.";
583 "The URL-based configuration is the config target.";
590 "Particular configuration to copy from.";
592 choice config-source {
595 "The configuration source for the copy operation.";
598 if-feature candidate;
601 "The candidate configuration is the config source.";
606 "The running configuration is the config source.";
612 "The startup configuration is the config source.";
618 "The URL-based configuration is the config source.";
622 "Inline Config content: <config> element. Represents
623 an entire configuration datastore, not
624 a subset of the running datastore.";
633 "Delete a configuration datastore.";
635 reference "RFC 6241, Section 7.4";
640 "Particular configuration to delete.";
642 choice config-target {
645 "The configuration target to delete.";
651 "The startup configuration is the config target.";
657 "The URL-based configuration is the config target.";
666 "The lock operation allows the client to lock the configuration
667 system of a device.";
669 reference "RFC 6241, Section 7.5";
674 "Particular configuration to lock.";
676 choice config-target {
679 "The configuration target to lock.";
682 if-feature candidate;
685 "The candidate configuration is the config target.";
690 "The running configuration is the config target.";
696 "The startup configuration is the config target.";
705 "The unlock operation is used to release a configuration lock,
706 previously obtained with the 'lock' operation.";
708 reference "RFC 6241, Section 7.6";
713 "Particular configuration to unlock.";
715 choice config-target {
718 "The configuration target to unlock.";
721 if-feature candidate;
724 "The candidate configuration is the config target.";
729 "The running configuration is the config target.";
735 "The startup configuration is the config target.";
744 "Retrieve running configuration and device state information.";
746 reference "RFC 6241, Section 7.7";
751 "This parameter specifies the portion of the system
752 configuration and state data to retrieve.";
753 nc:get-filter-element-attributes;
754 // TODO this extension should be augmented (anyxml nodes cannot be augmented)
755 cliext:argument-handler org.opendaylight.controller.netconf.cli.reader.custom.FilterReader;
762 "Copy of the running datastore subset and/or state
763 data that matched the filter criteria (if any).
764 An empty data container indicates that the request did not
765 produce any results.";
767 cliext:argument-handler org.opendaylight.controller.netconf.cli.writer.custom.DataWriter;
775 "Request graceful termination of a NETCONF session.";
777 reference "RFC 6241, Section 7.8";
782 "Force the termination of a NETCONF session.";
784 reference "RFC 6241, Section 7.9";
788 type session-id-type;
791 "Particular session to kill.";
797 if-feature candidate;
800 "Commit the candidate configuration as the device's new
801 current configuration.";
803 reference "RFC 6241, Section 8.3.4.1";
807 if-feature confirmed-commit;
810 "Requests a confirmed commit.";
811 reference "RFC 6241, Section 8.3.4.1";
814 leaf confirm-timeout {
815 if-feature confirmed-commit;
820 default "600"; // 10 minutes
822 "The timeout interval for a confirmed commit.";
823 reference "RFC 6241, Section 8.3.4.1";
827 if-feature confirmed-commit;
830 "This parameter is used to make a confirmed commit
831 persistent. A persistent confirmed commit is not aborted
832 if the NETCONF session terminates. The only way to abort
833 a persistent confirmed commit is to let the timer expire,
834 or to use the <cancel-commit> operation.
836 The value of this parameter is a token that must be given
837 in the 'persist-id' parameter of <commit> or
838 <cancel-commit> operations in order to confirm or cancel
839 the persistent confirmed commit.
841 The token should be a random string.";
842 reference "RFC 6241, Section 8.3.4.1";
846 if-feature confirmed-commit;
849 "This parameter is given in order to commit a persistent
850 confirmed commit. The value must be equal to the value
851 given in the 'persist' parameter to the <commit> operation.
852 If it does not match, the operation fails with an
853 'invalid-value' error.";
854 reference "RFC 6241, Section 8.3.4.1";
860 rpc discard-changes {
861 if-feature candidate;
864 "Revert the candidate configuration to the current
865 running configuration.";
866 reference "RFC 6241, Section 8.3.4.2";
870 if-feature confirmed-commit;
872 "This operation is used to cancel an ongoing confirmed commit.
873 If the confirmed commit is persistent, the parameter
874 'persist-id' must be given, and it must match the value of the
875 'persist' parameter.";
876 reference "RFC 6241, Section 8.4.4.1";
882 "This parameter is given in order to cancel a persistent
883 confirmed commit. The value must be equal to the value
884 given in the 'persist' parameter to the <commit> operation.
885 If it does not match, the operation fails with an
886 'invalid-value' error.";
895 "Validates the contents of the specified configuration.";
897 reference "RFC 6241, Section 8.6.4.1";
902 "Particular configuration to validate.";
904 choice config-source {
907 "The configuration source to validate.";
910 if-feature candidate;
913 "The candidate configuration is the config source.";
918 "The running configuration is the config source.";
924 "The startup configuration is the config source.";
930 "The URL-based configuration is the config source.";
934 "Inline Config content: <config> element. Represents
935 an entire configuration datastore, not
936 a subset of the running datastore.";