blob: 2595a1258c55f61dc4d63973221ccbaeab46f881 [file] [log] [blame]
Sean Condonfae8e662016-12-15 10:25:13 +00001module 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 organization
14 "IETF NETCONF (Network Configuration) Working Group";
15
16 contact
17 "WG Web: <http://tools.ietf.org/wg/netconf/>
18 WG List: <netconf@ietf.org>
19
20 WG Chair: Bert Wijnen
21 <bertietf@bwijnen.net>
22
23 WG Chair: Mehmet Ersue
24 <mehmet.ersue@nsn.com>
25
26 Editor: Martin Bjorklund
27 <mbj@tail-f.com>
28
29 Editor: Juergen Schoenwaelder
30 <j.schoenwaelder@jacobs-university.de>
31
32 Editor: Andy Bierman
33 <andy.bierman@brocade.com>";
34 description
35 "NETCONF Protocol Data Types and Protocol Operations.
36
37 Copyright (c) 2011 IETF Trust and the persons identified as
38 the document authors. All rights reserved.
39
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).
46
47 This version of this YANG module is part of RFC 6241; see
48 the RFC itself for full legal notices.";
49
50 revision 2011-06-01 {
51 description
52 "Initial revision;";
53 reference
54 "RFC 6241: Network Configuration Protocol";
55 }
56
57 extension get-filter-element-attributes {
58 description
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:
66
67 type : optional attribute with allowed
68 value strings 'subtree' and 'xpath'.
69 If missing, the default value is 'subtree'.
70
71 If the 'xpath' feature is supported, then the
72 following unqualified XML attribute is
73 also supported:
74
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.";
79 }
80
81 // NETCONF capabilities defined as features
82 feature writable-running {
83 description
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";
90 }
91
92 feature candidate {
93 description
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";
100 }
101
102 feature confirmed-commit {
103 if-feature candidate;
104 description
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.";
110
111 reference "RFC 6241, Section 8.4";
112 }
113
114 feature rollback-on-error {
115 description
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";
122 }
123
124 feature validate {
125 description
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";
132 }
133
134 feature startup {
135 description
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";
142 }
143
144 feature url {
145 description
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";
152 }
153
154 feature xpath {
155 description
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";
162 }
163
164 // NETCONF Simple Types
165
166 typedef session-id-type {
167 type uint32 {
168 range "1..max";
169 }
170 description
171 "NETCONF Session Id";
172 }
173
174 typedef session-id-or-zero-type {
175 type uint32;
176 description
177 "NETCONF Session Id or Zero to indicate none";
178 }
179 typedef error-tag-type {
180 type enumeration {
181 enum in-use {
182 description
183 "The request requires a resource that
184 already is in use.";
185 }
186 enum invalid-value {
187 description
188 "The request specifies an unacceptable value for one
189 or more parameters.";
190 }
191 enum too-big {
192 description
193 "The request or response (that would be generated) is
194 too large for the implementation to handle.";
195 }
196 enum missing-attribute {
197 description
198 "An expected attribute is missing.";
199 }
200 enum bad-attribute {
201 description
202 "An attribute value is not correct; e.g., wrong type,
203 out of range, pattern mismatch.";
204 }
205 enum unknown-attribute {
206 description
207 "An unexpected attribute is present.";
208 }
209 enum missing-element {
210 description
211 "An expected element is missing.";
212 }
213 enum bad-element {
214 description
215 "An element value is not correct; e.g., wrong type,
216 out of range, pattern mismatch.";
217 }
218 enum unknown-element {
219 description
220 "An unexpected element is present.";
221 }
222 enum unknown-namespace {
223 description
224 "An unexpected namespace is present.";
225 }
226 enum access-denied {
227 description
228 "Access to the requested protocol operation or
229 data model is denied because authorization failed.";
230 }
231 enum lock-denied {
232 description
233 "Access to the requested lock is denied because the
234 lock is currently held by another entity.";
235 }
236 enum resource-denied {
237 description
238 "Request could not be completed because of
239 insufficient resources.";
240 }
241 enum rollback-failed {
242 description
243 "Request to roll back some configuration change (via
244 rollback-on-error or <discard-changes> operations)
245 was not completed for some reason.";
246
247 }
248 enum data-exists {
249 description
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
253 already exists.";
254 }
255 enum data-missing {
256 description
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.";
261 }
262 enum operation-not-supported {
263 description
264 "Request could not be completed because the requested
265 operation is not supported by this implementation.";
266 }
267 enum operation-failed {
268 description
269 "Request could not be completed because the requested
270 operation failed for some reason not covered by
271 any other error condition.";
272 }
273 enum partial-operation {
274 description
275 "This error-tag is obsolete, and SHOULD NOT be sent
276 by servers conforming to this document.";
277 }
278 enum malformed-message {
279 description
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.";
283 }
284 }
285 description "NETCONF Error Tag";
286 reference "RFC 6241, Appendix A";
287 }
288
289 typedef error-severity-type {
290 type enumeration {
291 enum error {
292 description "Error severity";
293 }
294 enum warning {
295 description "Warning severity";
296 }
297 }
298 description "NETCONF Error Severity";
299 reference "RFC 6241, Section 4.3";
300 }
301
302 typedef edit-operation-type {
303 type enumeration {
304 enum merge {
305 description
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.";
311 }
312 enum replace {
313 description
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.";
323 }
324 enum create {
325 description
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'.";
333 }
334 enum delete {
335 description
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'.";
343 }
344 enum remove {
345 description
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
352 by the server.";
353 }
354 }
355 default "merge";
356 description "NETCONF 'operation' attribute values";
357 reference "RFC 6241, Section 7.2";
358 }
359
360 // NETCONF Standard Protocol Operations
361
362 rpc get-config {
363 description
364 "Retrieve all or part of a specified configuration.";
365
366 reference "RFC 6241, Section 7.1";
367
368 input {
369 container source {
370 description
371 "Particular configuration to retrieve.";
372
373 choice config-source {
374 mandatory true;
375 description
376 "The configuration to retrieve.";
377 case candidate {
378 leaf candidate {
379 if-feature candidate;
380 type empty;
381 description
382 "The candidate configuration is the config source.";
383 }
384 }
385 case running {
386 leaf running {
387 type empty;
388 description
389 "The running configuration is the config source.";
390 }
391 }
392 case startup {
393 leaf startup {
394 if-feature startup;
395 type empty;
396 description
397 "The startup configuration is the config source.
398 This is optional-to-implement on the server because
399 not all servers will support filtering for this
400 datastore.";
401 }
402 }
403 }
404 }
405
406 anyxml filter {
407 description
408 "Subtree or XPath filter to use.";
409// nc:get-filter-element-attributes;
410 }
411 }
412
413 output {
414 anyxml data {
415 description
416 "Copy of the source datastore subset that matched
417 the filter criteria (if any). An empty data container
418 indicates that the request did not produce any results.";
419 }
420 }
421 }
422
423 rpc edit-config {
424 description
425 "The <edit-config> operation loads all or part of a specified
426 configuration to the specified target configuration.";
427
428 reference "RFC 6241, Section 7.2";
429
430 input {
431 container target {
432 description
433 "Particular configuration to edit.";
434
435 choice config-target {
436 mandatory true;
437 description
438 "The configuration target.";
439 case candidate {
440 leaf candidate {
441 if-feature candidate;
442 type empty;
443 description
444 "The candidate configuration is the config target.";
445 }
446 }
447 case running {
448 leaf running {
449 if-feature writable-running;
450 type empty;
451 description
452 "The running configuration is the config source.";
453 }
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 case config {
528 anyxml config {
529 description
530 "Inline Config content.";
531 }
532 }
533 case url {
534 leaf url {
535 if-feature url;
536 type inet:uri;
537 description
538 "URL-based config content.";
539 }
540 }
541 }
542 }
543 }
544
545 rpc copy-config {
546 description
547 "Create or replace an entire configuration datastore with the
548 contents of another complete configuration datastore.";
549
550 reference "RFC 6241, Section 7.3";
551
552 input {
553 container target {
554 description
555 "Particular configuration to copy to.";
556
557 choice config-target {
558 mandatory true;
559 description
560 "The configuration target of the copy operation.";
561 case candidate {
562 leaf candidate {
563 if-feature candidate;
564 type empty;
565 description
566 "The candidate configuration is the config target.";
567 }
568 }
569 case running {
570 leaf running {
571 if-feature writable-running;
572 type empty;
573 description
574 "The running configuration is the config target.
575 This is optional-to-implement on the server.";
576 }
577 }
578 case startup {
579 leaf startup {
580 if-feature startup;
581 type empty;
582 description
583 "The startup configuration is the config target.";
584 }
585 }
586 case url {
587 leaf url {
588 if-feature url;
589 type inet:uri;
590 description
591 "The URL-based configuration is the config target.";
592 }
593 }
594 }
595 }
596
597 container source {
598 description
599 "Particular configuration to copy from.";
600
601 choice config-source {
602 mandatory true;
603 description
604 "The configuration source for the copy operation.";
605
606 case candidate {
607 leaf candidate {
608 if-feature candidate;
609 type empty;
610 description
611 "The candidate configuration is the config source.";
612 }
613 }
614 case running {
615 leaf running {
616 type empty;
617 description
618 "The running configuration is the config source.";
619 }
620 }
621 case startup {
622 leaf startup {
623 if-feature startup;
624 type empty;
625 description
626 "The startup configuration is the config source.";
627 }
628 }
629 case url {
630 leaf url {
631 if-feature url;
632 type inet:uri;
633 description
634 "The URL-based configuration is the config source.";
635 }
636 }
637 case config {
638 anyxml config {
639 description
640 "Inline Config content: <config> element. Represents
641 an entire configuration datastore, not
642 a subset of the running datastore.";
643 }
644 }
645 }
646 }
647 }
648 }
649
650 rpc delete-config {
651 description
652 "Delete a configuration datastore.";
653
654 reference "RFC 6241, Section 7.4";
655
656 input {
657 container target {
658 description
659 "Particular configuration to delete.";
660
661 choice config-target {
662 mandatory true;
663 description
664 "The configuration target to delete.";
665 case startup {
666 leaf startup {
667 if-feature startup;
668 type empty;
669 description
670 "The startup configuration is the config target.";
671 }
672 }
673 case url {
674 leaf url {
675 if-feature url;
676 type inet:uri;
677 description
678 "The URL-based configuration is the config target.";
679 }
680 }
681 }
682 }
683 }
684 }
685
686 rpc lock {
687 description
688 "The lock operation allows the client to lock the configuration
689 system of a device.";
690
691 reference "RFC 6241, Section 7.5";
692
693 input {
694 container target {
695 description
696 "Particular configuration to lock.";
697
698 choice config-target {
699 mandatory true;
700 description
701 "The configuration target to lock.";
702 case candidate {
703 leaf candidate {
704 if-feature candidate;
705 type empty;
706 description
707 "The candidate configuration is the config target.";
708 }
709 }
710 case running {
711 leaf running {
712 type empty;
713 description
714 "The running configuration is the config target.";
715 }
716 }
717 case startup {
718 leaf startup {
719 if-feature startup;
720 type empty;
721 description
722 "The startup configuration is the config target.";
723 }
724 }
725 }
726 }
727 }
728 }
729
730 rpc unlock {
731 description
732 "The unlock operation is used to release a configuration lock,
733 previously obtained with the 'lock' operation.";
734
735 reference "RFC 6241, Section 7.6";
736
737 input {
738 container target {
739 description
740 "Particular configuration to unlock.";
741
742 choice config-target {
743 mandatory true;
744 description
745 "The configuration target to unlock.";
746 case candidate {
747 leaf candidate {
748 if-feature candidate;
749 type empty;
750 description
751 "The candidate configuration is the config target.";
752 }
753 }
754 case running {
755 leaf running {
756 type empty;
757 description
758 "The running configuration is the config target.";
759 }
760 }
761 case startup {
762 leaf startup {
763 if-feature startup;
764 type empty;
765 description
766 "The startup configuration is the config target.";
767 }
768 }
769 }
770 }
771 }
772 }
773
774 rpc get {
775 description
776 "Retrieve running configuration and device state information.";
777
778 reference "RFC 6241, Section 7.7";
779
780 input {
781 anyxml filter {
782 description
783 "This parameter specifies the portion of the system
784 configuration and state data to retrieve.";
785// nc:get-filter-element-attributes;
786 }
787 }
788
789 output {
790 anyxml data {
791 description
792 "Copy of the running datastore subset and/or state
793 data that matched the filter criteria (if any).
794 An empty data container indicates that the request did not
795 produce any results.";
796 }
797 }
798 }
799
800 rpc close-session {
801 description
802 "Request graceful termination of a NETCONF session.";
803
804 reference "RFC 6241, Section 7.8";
805 }
806
807 rpc kill-session {
808 description
809 "Force the termination of a NETCONF session.";
810
811 reference "RFC 6241, Section 7.9";
812
813 input {
814 leaf session-id {
815 type session-id-type;
816 mandatory true;
817 description
818 "Particular session to kill.";
819 }
820 }
821 }
822
823 rpc commit {
824 if-feature candidate;
825
826 description
827 "Commit the candidate configuration as the device's new
828 current configuration.";
829
830 reference "RFC 6241, Section 8.3.4.1";
831
832 input {
833 leaf confirmed {
834 if-feature confirmed-commit;
835 type empty;
836 description
837 "Requests a confirmed commit.";
838 reference "RFC 6241, Section 8.3.4.1";
839 }
840
841 leaf confirm-timeout {
842 if-feature confirmed-commit;
843 type uint32 {
844 range "1..max";
845 }
846 units "seconds";
847 default "600"; // 10 minutes
848 description
849 "The timeout interval for a confirmed commit.";
850 reference "RFC 6241, Section 8.3.4.1";
851 }
852
853 leaf persist {
854 if-feature confirmed-commit;
855 type string;
856 description
857 "This parameter is used to make a confirmed commit
858 persistent. A persistent confirmed commit is not aborted
859 if the NETCONF session terminates. The only way to abort
860 a persistent confirmed commit is to let the timer expire,
861 or to use the <cancel-commit> operation.
862
863 The value of this parameter is a token that must be given
864 in the 'persist-id' parameter of <commit> or
865 <cancel-commit> operations in order to confirm or cancel
866 the persistent confirmed commit.
867
868 The token should be a random string.";
869 reference "RFC 6241, Section 8.3.4.1";
870 }
871
872 leaf persist-id {
873 if-feature confirmed-commit;
874 type string;
875 description
876 "This parameter is given in order to commit a persistent
877 confirmed commit. The value must be equal to the value
878 given in the 'persist' parameter to the <commit> operation.
879 If it does not match, the operation fails with an
880 'invalid-value' error.";
881 reference "RFC 6241, Section 8.3.4.1";
882 }
883
884 }
885 }
886
887 rpc discard-changes {
888 if-feature candidate;
889
890 description
891 "Revert the candidate configuration to the current
892 running configuration.";
893 reference "RFC 6241, Section 8.3.4.2";
894 }
895
896 rpc cancel-commit {
897 if-feature confirmed-commit;
898 description
899 "This operation is used to cancel an ongoing confirmed commit.
900 If the confirmed commit is persistent, the parameter
901 'persist-id' must be given, and it must match the value of the
902 'persist' parameter.";
903 reference "RFC 6241, Section 8.4.4.1";
904
905 input {
906 leaf persist-id {
907 type string;
908 description
909 "This parameter is given in order to cancel a persistent
910 confirmed commit. The value must be equal to the value
911 given in the 'persist' parameter to the <commit> operation.
912 If it does not match, the operation fails with an
913 'invalid-value' error.";
914 }
915 }
916 }
917
918 rpc validate {
919 if-feature validate;
920
921 description
922 "Validates the contents of the specified configuration.";
923
924 reference "RFC 6241, Section 8.6.4.1";
925
926 input {
927 container source {
928 description
929 "Particular configuration to validate.";
930
931 choice config-source {
932 mandatory true;
933 description
934 "The configuration source to validate.";
935
936 case candidate {
937 leaf candidate {
938 if-feature candidate;
939 type empty;
940 description
941 "The candidate configuration is the config source.";
942 }
943 }
944 case running {
945 leaf running {
946 type empty;
947 description
948 "The running configuration is the config source.";
949 }
950 }
951 case startup {
952 leaf startup {
953 if-feature startup;
954 type empty;
955 description
956 "The startup configuration is the config source.";
957 }
958 }
959 case url {
960 leaf url {
961 if-feature url;
962 type inet:uri;
963 description
964 "The URL-based configuration is the config source.";
965 }
966 }
967 case config {
968 anyxml config {
969 description
970 "Inline Config content: <config> element. Represents
971 an entire configuration datastore, not
972 a subset of the running datastore.";
973 }
974 }
975 }
976 }
977 }
978 }
979
980}