blob: 638b42d5173b298ef41e84101a0353ab058a184e [file] [log] [blame]
Michal Vasko8a4e1462020-05-07 11:32:31 +02001module ietf-netconf {
2
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";
6
7 prefix nc;
8
9 import ietf-inet-types {
10 prefix inet;
11 }
12
13 import ietf-netconf-acm { prefix nacm; }
14
15 organization
16 "IETF NETCONF (Network Configuration) Working Group";
17
18 contact
19 "WG Web: <http://tools.ietf.org/wg/netconf/>
20 WG List: <netconf@ietf.org>
21
22 WG Chair: Bert Wijnen
23 <bertietf@bwijnen.net>
24
25 WG Chair: Mehmet Ersue
26 <mehmet.ersue@nsn.com>
27
28 Editor: Martin Bjorklund
29 <mbj@tail-f.com>
30
31 Editor: Juergen Schoenwaelder
32 <j.schoenwaelder@jacobs-university.de>
33
34 Editor: Andy Bierman
35 <andy.bierman@brocade.com>";
36 description
37 "NETCONF Protocol Data Types and Protocol Operations.
38
39 Copyright (c) 2011 IETF Trust and the persons identified as
40 the document authors. All rights reserved.
41
42 Redistribution and use in source and binary forms, with or
43 without modification, is permitted pursuant to, and subject
44 to the license terms contained in, the Simplified BSD License
45 set forth in Section 4.c of the IETF Trust's Legal Provisions
46 Relating to IETF Documents
47 (http://trustee.ietf.org/license-info).
48
49 This version of this YANG module is part of RFC 6241; see
50 the RFC itself for full legal notices.";
51
52 revision 2013-09-29 {
53 description
54 "Updated to include NACM attributes";
55 reference
56 "RFC 6536: sec 3.2.5 and 3.2.8";
57 }
58
59 revision 2011-06-01 {
60 description
61 "Initial revision";
62 reference
63 "RFC 6241: Network Configuration Protocol";
64 }
65
66 extension get-filter-element-attributes {
67 description
68 "If this extension is present within an 'anyxml'
69 statement named 'filter', which must be conceptually
70 defined within the RPC input section for the <get>
71 and <get-config> protocol operations, then the
72 following unqualified XML attribute is supported
73 within the <filter> element, within a <get> or
74 <get-config> protocol operation:
75
76 type : optional attribute with allowed
77 value strings 'subtree' and 'xpath'.
78 If missing, the default value is 'subtree'.
79
80 If the 'xpath' feature is supported, then the
81 following unqualified XML attribute is
82 also supported:
83
84 select: optional attribute containing a
85 string representing an XPath expression.
86 The 'type' attribute must be equal to 'xpath'
87 if this attribute is present.";
88 }
89
90 // NETCONF capabilities defined as features
91 feature writable-running {
92 description
93 "NETCONF :writable-running capability;
94 If the server advertises the :writable-running
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.2";
99 }
100
101 feature candidate {
102 description
103 "NETCONF :candidate capability;
104 If the server advertises the :candidate
105 capability for a session, then this feature must
106 also be enabled for that session. Otherwise,
107 this feature must not be enabled.";
108 reference "RFC 6241, Section 8.3";
109 }
110
111 feature confirmed-commit {
112 if-feature candidate;
113 description
114 "NETCONF :confirmed-commit:1.1 capability;
115 If the server advertises the :confirmed-commit:1.1
116 capability for a session, then this feature must
117 also be enabled for that session. Otherwise,
118 this feature must not be enabled.";
119
120 reference "RFC 6241, Section 8.4";
121 }
122
123 feature rollback-on-error {
124 description
125 "NETCONF :rollback-on-error capability;
126 If the server advertises the :rollback-on-error
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.5";
131 }
132
133 feature validate {
134 description
135 "NETCONF :validate:1.1 capability;
136 If the server advertises the :validate:1.1
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.6";
141 }
142
143 feature startup {
144 description
145 "NETCONF :startup capability;
146 If the server advertises the :startup
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.7";
151 }
152
153 feature url {
154 description
155 "NETCONF :url capability;
156 If the server advertises the :url
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.8";
161 }
162
163 feature xpath {
164 description
165 "NETCONF :xpath capability;
166 If the server advertises the :xpath
167 capability for a session, then this feature must
168 also be enabled for that session. Otherwise,
169 this feature must not be enabled.";
170 reference "RFC 6241, Section 8.9";
171 }
172
173 // NETCONF Simple Types
174
175 typedef session-id-type {
176 type uint32 {
177 range "1..max";
178 }
179 description
180 "NETCONF Session Id";
181 }
182
183 typedef session-id-or-zero-type {
184 type uint32;
185 description
186 "NETCONF Session Id or Zero to indicate none";
187 }
188 typedef error-tag-type {
189 type enumeration {
190 enum in-use {
191 description
192 "The request requires a resource that
193 already is in use.";
194 }
195 enum invalid-value {
196 description
197 "The request specifies an unacceptable value for one
198 or more parameters.";
199 }
200 enum too-big {
201 description
202 "The request or response (that would be generated) is
203 too large for the implementation to handle.";
204 }
205 enum missing-attribute {
206 description
207 "An expected attribute is missing.";
208 }
209 enum bad-attribute {
210 description
211 "An attribute value is not correct; e.g., wrong type,
212 out of range, pattern mismatch.";
213 }
214 enum unknown-attribute {
215 description
216 "An unexpected attribute is present.";
217 }
218 enum missing-element {
219 description
220 "An expected element is missing.";
221 }
222 enum bad-element {
223 description
224 "An element value is not correct; e.g., wrong type,
225 out of range, pattern mismatch.";
226 }
227 enum unknown-element {
228 description
229 "An unexpected element is present.";
230 }
231 enum unknown-namespace {
232 description
233 "An unexpected namespace is present.";
234 }
235 enum access-denied {
236 description
237 "Access to the requested protocol operation or
238 data model is denied because authorization failed.";
239 }
240 enum lock-denied {
241 description
242 "Access to the requested lock is denied because the
243 lock is currently held by another entity.";
244 }
245 enum resource-denied {
246 description
247 "Request could not be completed because of
248 insufficient resources.";
249 }
250 enum rollback-failed {
251 description
252 "Request to roll back some configuration change (via
253 rollback-on-error or <discard-changes> operations)
254 was not completed for some reason.";
255
256 }
257 enum data-exists {
258 description
259 "Request could not be completed because the relevant
260 data model content already exists. For example,
261 a 'create' operation was attempted on data that
262 already exists.";
263 }
264 enum data-missing {
265 description
266 "Request could not be completed because the relevant
267 data model content does not exist. For example,
268 a 'delete' operation was attempted on
269 data that does not exist.";
270 }
271 enum operation-not-supported {
272 description
273 "Request could not be completed because the requested
274 operation is not supported by this implementation.";
275 }
276 enum operation-failed {
277 description
278 "Request could not be completed because the requested
279 operation failed for some reason not covered by
280 any other error condition.";
281 }
282 enum partial-operation {
283 description
284 "This error-tag is obsolete, and SHOULD NOT be sent
285 by servers conforming to this document.";
286 }
287 enum malformed-message {
288 description
289 "A message could not be handled because it failed to
290 be parsed correctly. For example, the message is not
291 well-formed XML or it uses an invalid character set.";
292 }
293 }
294 description "NETCONF Error Tag";
295 reference "RFC 6241, Appendix A";
296 }
297
298 typedef error-severity-type {
299 type enumeration {
300 enum error {
301 description "Error severity";
302 }
303 enum warning {
304 description "Warning severity";
305 }
306 }
307 description "NETCONF Error Severity";
308 reference "RFC 6241, Section 4.3";
309 }
310
311 typedef edit-operation-type {
312 type enumeration {
313 enum merge {
314 description
315 "The configuration data identified by the
316 element containing this attribute is merged
317 with the configuration at the corresponding
318 level in the configuration datastore identified
319 by the target parameter.";
320 }
321 enum replace {
322 description
323 "The configuration data identified by the element
324 containing this attribute replaces any related
325 configuration in the configuration datastore
326 identified by the target parameter. If no such
327 configuration data exists in the configuration
328 datastore, it is created. Unlike a
329 <copy-config> operation, which replaces the
330 entire target configuration, only the configuration
331 actually present in the config parameter is affected.";
332 }
333 enum create {
334 description
335 "The configuration data identified by the element
336 containing this attribute is added to the
337 configuration if and only if the configuration
338 data does not already exist in the configuration
339 datastore. If the configuration data exists, an
340 <rpc-error> element is returned with an
341 <error-tag> value of 'data-exists'.";
342 }
343 enum delete {
344 description
345 "The configuration data identified by the element
346 containing this attribute is deleted from the
347 configuration if and only if the configuration
348 data currently exists in the configuration
349 datastore. If the configuration data does not
350 exist, an <rpc-error> element is returned with
351 an <error-tag> value of 'data-missing'.";
352 }
353 enum remove {
354 description
355 "The configuration data identified by the element
356 containing this attribute is deleted from the
357 configuration if the configuration
358 data currently exists in the configuration
359 datastore. If the configuration data does not
360 exist, the 'remove' operation is silently ignored
361 by the server.";
362 }
363 }
364 default "merge";
365 description "NETCONF 'operation' attribute values";
366 reference "RFC 6241, Section 7.2";
367 }
368
369 // NETCONF Standard Protocol Operations
370
371 rpc get-config {
372 description
373 "Retrieve all or part of a specified configuration.";
374
375 reference "RFC 6241, Section 7.1";
376
377 input {
378 container source {
379 description
380 "Particular configuration to retrieve.";
381
382 choice config-source {
383 mandatory true;
384 description
385 "The configuration to retrieve.";
386 leaf candidate {
387 if-feature candidate;
388 type empty;
389 description
390 "The candidate configuration is the config source.";
391 }
392 leaf running {
393 type empty;
394 description
395 "The running configuration is the config source.";
396 }
397 leaf startup {
398 if-feature startup;
399 type empty;
400 description
401 "The startup configuration is the config source.
402 This is optional-to-implement on the server because
403 not all servers will support filtering for this
404 datastore.";
405 }
406 }
407 }
408
409 anyxml filter {
410 description
411 "Subtree or XPath filter to use.";
412 nc:get-filter-element-attributes;
413 }
414 }
415
416 output {
417 anyxml data {
418 description
419 "Copy of the source datastore subset that matched
420 the filter criteria (if any). An empty data container
421 indicates that the request did not produce any results.";
422 }
423 }
424 }
425
426 rpc edit-config {
427 description
428 "The <edit-config> operation loads all or part of a specified
429 configuration to the specified target configuration.";
430
431 reference "RFC 6241, Section 7.2";
432
433 input {
434 container target {
435 description
436 "Particular configuration to edit.";
437
438 choice config-target {
439 mandatory true;
440 description
441 "The configuration target.";
442
443 leaf candidate {
444 if-feature candidate;
445 type empty;
446 description
447 "The candidate configuration is the config target.";
448 }
449 leaf running {
450 if-feature writable-running;
451 type empty;
452 description
453 "The running configuration is the config source.";
454 }
455 }
456 }
457
458 leaf default-operation {
459 type enumeration {
460 enum merge {
461 description
462 "The default operation is merge.";
463 }
464 enum replace {
465 description
466 "The default operation is replace.";
467 }
468 enum none {
469 description
470 "There is no default operation.";
471 }
472 }
473 default "merge";
474 description
475 "The default operation to use.";
476 }
477
478 leaf test-option {
479 if-feature validate;
480 type enumeration {
481 enum test-then-set {
482 description
483 "The server will test and then set if no errors.";
484 }
485 enum set {
486 description
487 "The server will set without a test first.";
488 }
489
490 enum test-only {
491 description
492 "The server will only test and not set, even
493 if there are no errors.";
494 }
495 }
496 default "test-then-set";
497 description
498 "The test option to use.";
499 }
500
501 leaf error-option {
502 type enumeration {
503 enum stop-on-error {
504 description
505 "The server will stop on errors.";
506 }
507 enum continue-on-error {
508 description
509 "The server may continue on errors.";
510 }
511 enum rollback-on-error {
512 description
513 "The server will roll back on errors.
514 This value can only be used if the 'rollback-on-error'
515 feature is supported.";
516 }
517 }
518 default "stop-on-error";
519 description
520 "The error option to use.";
521 }
522
523 choice edit-content {
524 mandatory true;
525 description
526 "The content for the edit operation.";
527
528 anyxml config {
529 description
530 "Inline Config content.";
531 }
532 leaf url {
533 if-feature url;
534 type inet:uri;
535 description
536 "URL-based config content.";
537 }
538 }
539 }
540 }
541
542 rpc copy-config {
543 description
544 "Create or replace an entire configuration datastore with the
545 contents of another complete configuration datastore.";
546
547 reference "RFC 6241, Section 7.3";
548
549 input {
550 container target {
551 description
552 "Particular configuration to copy to.";
553
554 choice config-target {
555 mandatory true;
556 description
557 "The configuration target of the copy operation.";
558
559 leaf candidate {
560 if-feature candidate;
561 type empty;
562 description
563 "The candidate configuration is the config target.";
564 }
565 leaf running {
566 if-feature writable-running;
567 type empty;
568 description
569 "The running configuration is the config target.
570 This is optional-to-implement on the server.";
571 }
572 leaf startup {
573 if-feature startup;
574 type empty;
575 description
576 "The startup configuration is the config target.";
577 }
578 leaf url {
579 if-feature url;
580 type inet:uri;
581 description
582 "The URL-based configuration is the config target.";
583 }
584 }
585 }
586
587 container source {
588 description
589 "Particular configuration to copy from.";
590
591 choice config-source {
592 mandatory true;
593 description
594 "The configuration source for the copy operation.";
595
596 leaf candidate {
597 if-feature candidate;
598 type empty;
599 description
600 "The candidate configuration is the config source.";
601 }
602 leaf running {
603 type empty;
604 description
605 "The running configuration is the config source.";
606 }
607 leaf startup {
608 if-feature startup;
609 type empty;
610 description
611 "The startup configuration is the config source.";
612 }
613 leaf url {
614 if-feature url;
615 type inet:uri;
616 description
617 "The URL-based configuration is the config source.";
618 }
619 anyxml config {
620 description
621 "Inline Config content: <config> element. Represents
622 an entire configuration datastore, not
623 a subset of the running datastore.";
624 }
625 }
626 }
627 }
628 }
629
630 rpc delete-config {
631 nacm:default-deny-all;
632 description
633 "Delete a configuration datastore.";
634
635 reference "RFC 6241, Section 7.4";
636
637 input {
638 container target {
639 description
640 "Particular configuration to delete.";
641
642 choice config-target {
643 mandatory true;
644 description
645 "The configuration target to delete.";
646
647 leaf startup {
648 if-feature startup;
649 type empty;
650 description
651 "The startup configuration is the config target.";
652 }
653 leaf url {
654 if-feature url;
655 type inet:uri;
656 description
657 "The URL-based configuration is the config target.";
658 }
659 }
660 }
661 }
662 }
663
664 rpc lock {
665 description
666 "The lock operation allows the client to lock the configuration
667 system of a device.";
668
669 reference "RFC 6241, Section 7.5";
670
671 input {
672 container target {
673 description
674 "Particular configuration to lock.";
675
676 choice config-target {
677 mandatory true;
678 description
679 "The configuration target to lock.";
680
681 leaf candidate {
682 if-feature candidate;
683 type empty;
684 description
685 "The candidate configuration is the config target.";
686 }
687 leaf running {
688 type empty;
689 description
690 "The running configuration is the config target.";
691 }
692 leaf startup {
693 if-feature startup;
694 type empty;
695 description
696 "The startup configuration is the config target.";
697 }
698 }
699 }
700 }
701 }
702
703 rpc unlock {
704 description
705 "The unlock operation is used to release a configuration lock,
706 previously obtained with the 'lock' operation.";
707
708 reference "RFC 6241, Section 7.6";
709
710 input {
711 container target {
712 description
713 "Particular configuration to unlock.";
714
715 choice config-target {
716 mandatory true;
717 description
718 "The configuration target to unlock.";
719
720 leaf candidate {
721 if-feature candidate;
722 type empty;
723 description
724 "The candidate configuration is the config target.";
725 }
726 leaf running {
727 type empty;
728 description
729 "The running configuration is the config target.";
730 }
731 leaf startup {
732 if-feature startup;
733 type empty;
734 description
735 "The startup configuration is the config target.";
736 }
737 }
738 }
739 }
740 }
741
742 rpc get {
743 description
744 "Retrieve running configuration and device state information.";
745
746 reference "RFC 6241, Section 7.7";
747
748 input {
749 anyxml filter {
750 description
751 "This parameter specifies the portion of the system
752 configuration and state data to retrieve.";
753 nc:get-filter-element-attributes;
754 }
755 }
756
757 output {
758 anyxml data {
759 description
760 "Copy of the running datastore subset and/or state
761 data that matched the filter criteria (if any).
762 An empty data container indicates that the request did not
763 produce any results.";
764 }
765 }
766 }
767
768 rpc close-session {
769 description
770 "Request graceful termination of a NETCONF session.";
771
772 reference "RFC 6241, Section 7.8";
773 }
774
775 rpc kill-session {
776 nacm:default-deny-all;
777 description
778 "Force the termination of a NETCONF session.";
779
780 reference "RFC 6241, Section 7.9";
781
782 input {
783 leaf session-id {
784 type session-id-type;
785 mandatory true;
786 description
787 "Particular session to kill.";
788 }
789 }
790 }
791
792 rpc commit {
793 if-feature candidate;
794
795 description
796 "Commit the candidate configuration as the device's new
797 current configuration.";
798
799 reference "RFC 6241, Section 8.3.4.1";
800
801 input {
802 leaf confirmed {
803 if-feature confirmed-commit;
804 type empty;
805 description
806 "Requests a confirmed commit.";
807 reference "RFC 6241, Section 8.3.4.1";
808 }
809
810 leaf confirm-timeout {
811 if-feature confirmed-commit;
812 type uint32 {
813 range "1..max";
814 }
815 units "seconds";
816 default "600"; // 10 minutes
817 description
818 "The timeout interval for a confirmed commit.";
819 reference "RFC 6241, Section 8.3.4.1";
820 }
821
822 leaf persist {
823 if-feature confirmed-commit;
824 type string;
825 description
826 "This parameter is used to make a confirmed commit
827 persistent. A persistent confirmed commit is not aborted
828 if the NETCONF session terminates. The only way to abort
829 a persistent confirmed commit is to let the timer expire,
830 or to use the <cancel-commit> operation.
831
832 The value of this parameter is a token that must be given
833 in the 'persist-id' parameter of <commit> or
834 <cancel-commit> operations in order to confirm or cancel
835 the persistent confirmed commit.
836
837 The token should be a random string.";
838 reference "RFC 6241, Section 8.3.4.1";
839 }
840
841 leaf persist-id {
842 if-feature confirmed-commit;
843 type string;
844 description
845 "This parameter is given in order to commit a persistent
846 confirmed commit. The value must be equal to the value
847 given in the 'persist' parameter to the <commit> operation.
848 If it does not match, the operation fails with an
849 'invalid-value' error.";
850 reference "RFC 6241, Section 8.3.4.1";
851 }
852
853 }
854 }
855
856 rpc discard-changes {
857 if-feature candidate;
858
859 description
860 "Revert the candidate configuration to the current
861 running configuration.";
862 reference "RFC 6241, Section 8.3.4.2";
863 }
864
865 rpc cancel-commit {
866 if-feature confirmed-commit;
867 description
868 "This operation is used to cancel an ongoing confirmed commit.
869 If the confirmed commit is persistent, the parameter
870 'persist-id' must be given, and it must match the value of the
871 'persist' parameter.";
872 reference "RFC 6241, Section 8.4.4.1";
873
874 input {
875 leaf persist-id {
876 type string;
877 description
878 "This parameter is given in order to cancel a persistent
879 confirmed commit. The value must be equal to the value
880 given in the 'persist' parameter to the <commit> operation.
881 If it does not match, the operation fails with an
882 'invalid-value' error.";
883 }
884 }
885 }
886
887 rpc validate {
888 if-feature validate;
889
890 description
891 "Validates the contents of the specified configuration.";
892
893 reference "RFC 6241, Section 8.6.4.1";
894
895 input {
896 container source {
897 description
898 "Particular configuration to validate.";
899
900 choice config-source {
901 mandatory true;
902 description
903 "The configuration source to validate.";
904
905 leaf candidate {
906 if-feature candidate;
907 type empty;
908 description
909 "The candidate configuration is the config source.";
910 }
911 leaf running {
912 type empty;
913 description
914 "The running configuration is the config source.";
915 }
916 leaf startup {
917 if-feature startup;
918 type empty;
919 description
920 "The startup configuration is the config source.";
921 }
922 leaf url {
923 if-feature url;
924 type inet:uri;
925 description
926 "The URL-based configuration is the config source.";
927 }
928 anyxml config {
929 description
930 "Inline Config content: <config> element. Represents
931 an entire configuration datastore, not
932 a subset of the running datastore.";
933 }
934 }
935 }
936 }
937 }
938
939}