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