CDS: Add stress test RPC to the cars model
[controller.git] / opendaylight / netconf / netconf-cli / src / main / resources / schema / remote / ietf-netconf.yang
1 module 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 netconf-cli-ext { prefix cliext; revision-date 2014-05-26; }
14
15
16   organization
17     "IETF NETCONF (Network Configuration) Working Group";
18
19   contact
20     "WG Web:   <http://tools.ietf.org/wg/netconf/>
21      WG List:  <netconf@ietf.org>
22
23      WG Chair: Bert Wijnen
24                <bertietf@bwijnen.net>
25
26      WG Chair: Mehmet Ersue
27                <mehmet.ersue@nsn.com>
28
29      Editor:   Martin Bjorklund
30                <mbj@tail-f.com>
31
32      Editor:   Juergen Schoenwaelder
33                <j.schoenwaelder@jacobs-university.de>
34
35      Editor:   Andy Bierman
36                <andy.bierman@brocade.com>";
37   description
38     "NETCONF Protocol Data Types and Protocol Operations.
39
40      Copyright (c) 2011 IETF Trust and the persons identified as
41      the document authors.  All rights reserved.
42
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).
49
50      This version of this YANG module is part of RFC 6241; see
51      the RFC itself for full legal notices.";
52   revision 2011-06-01 {
53     description
54       "Initial revision";
55     reference
56       "RFC 6241: Network Configuration Protocol";
57   }
58
59   extension get-filter-element-attributes {
60     description
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:
68
69          type : optional attribute with allowed
70                 value strings 'subtree' and 'xpath'.
71                 If missing, the default value is 'subtree'.
72
73        If the 'xpath' feature is supported, then the
74        following unqualified XML attribute is
75        also supported:
76
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.";
81   }
82
83   // NETCONF capabilities defined as features
84   feature writable-running {
85     description
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";
92   }
93
94   feature candidate {
95     description
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";
102   }
103
104   feature confirmed-commit {
105     if-feature candidate;
106     description
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.";
112
113     reference "RFC 6241, Section 8.4";
114   }
115
116   feature rollback-on-error {
117     description
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";
124   }
125
126   feature validate {
127     description
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";
134   }
135
136   feature startup {
137     description
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";
144   }
145
146   feature url {
147     description
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";
154   }
155
156   feature xpath {
157     description
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";
164   }
165
166   // NETCONF Simple Types
167
168   typedef session-id-type {
169     type uint32 {
170       range "1..max";
171     }
172     description
173       "NETCONF Session Id";
174   }
175
176   typedef session-id-or-zero-type {
177     type uint32;
178     description
179       "NETCONF Session Id or Zero to indicate none";
180   }
181   typedef error-tag-type {
182     type enumeration {
183        enum in-use {
184          description
185            "The request requires a resource that
186             already is in use.";
187        }
188        enum invalid-value {
189          description
190            "The request specifies an unacceptable value for one
191             or more parameters.";
192        }
193        enum too-big {
194          description
195            "The request or response (that would be generated) is
196             too large for the implementation to handle.";
197        }
198        enum missing-attribute {
199          description
200            "An expected attribute is missing.";
201        }
202        enum bad-attribute {
203          description
204            "An attribute value is not correct; e.g., wrong type,
205             out of range, pattern mismatch.";
206        }
207        enum unknown-attribute {
208          description
209            "An unexpected attribute is present.";
210        }
211        enum missing-element {
212          description
213            "An expected element is missing.";
214        }
215        enum bad-element {
216          description
217            "An element value is not correct; e.g., wrong type,
218             out of range, pattern mismatch.";
219        }
220        enum unknown-element {
221          description
222            "An unexpected element is present.";
223        }
224        enum unknown-namespace {
225          description
226            "An unexpected namespace is present.";
227        }
228        enum access-denied {
229          description
230            "Access to the requested protocol operation or
231             data model is denied because authorization failed.";
232        }
233        enum lock-denied {
234          description
235            "Access to the requested lock is denied because the
236             lock is currently held by another entity.";
237        }
238        enum resource-denied {
239          description
240            "Request could not be completed because of
241             insufficient resources.";
242        }
243        enum rollback-failed {
244          description
245            "Request to roll back some configuration change (via
246             rollback-on-error or <discard-changes> operations)
247             was not completed for some reason.";
248
249        }
250        enum data-exists {
251          description
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
255             already exists.";
256        }
257        enum data-missing {
258          description
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.";
263        }
264        enum operation-not-supported {
265          description
266            "Request could not be completed because the requested
267             operation is not supported by this implementation.";
268        }
269        enum operation-failed {
270          description
271            "Request could not be completed because the requested
272             operation failed for some reason not covered by
273             any other error condition.";
274        }
275        enum partial-operation {
276          description
277            "This error-tag is obsolete, and SHOULD NOT be sent
278             by servers conforming to this document.";
279        }
280        enum malformed-message {
281          description
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.";
285        }
286      }
287      description "NETCONF Error Tag";
288      reference "RFC 6241, Appendix A";
289   }
290
291   typedef error-severity-type {
292     type enumeration {
293       enum error {
294         description "Error severity";
295       }
296       enum warning {
297         description "Warning severity";
298       }
299     }
300     description "NETCONF Error Severity";
301     reference "RFC 6241, Section 4.3";
302   }
303
304   typedef edit-operation-type {
305     type enumeration {
306       enum merge {
307         description
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.";
313       }
314       enum replace {
315         description
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.";
325       }
326       enum create {
327         description
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'.";
335       }
336       enum delete {
337         description
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'.";
345       }
346       enum remove {
347         description
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
354            by the server.";
355       }
356     }
357     default "merge";
358     description "NETCONF 'operation' attribute values";
359     reference "RFC 6241, Section 7.2";
360   }
361
362   // NETCONF Standard Protocol Operations
363
364   rpc get-config {
365     description
366       "Retrieve all or part of a specified configuration.";
367
368     reference "RFC 6241, Section 7.1";
369
370     input {
371       container source {
372         description
373           "Particular configuration to retrieve.";
374
375         choice config-source {
376           mandatory true;
377           description
378             "The configuration to retrieve.";
379           leaf candidate {
380             if-feature candidate;
381             type empty;
382             description
383               "The candidate configuration is the config source.";
384           }
385           leaf running {
386             type empty;
387             description
388               "The running configuration is the config source.";
389           }
390           leaf startup {
391             if-feature startup;
392             type empty;
393             description
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
397                datastore.";
398           }
399         }
400       }
401
402       anyxml filter {
403         description
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;
409       }
410     }
411
412     output {
413       anyxml data {
414         description
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;
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
440           leaf candidate {
441             if-feature candidate;
442             type empty;
443             description
444               "The candidate configuration is the config target.";
445           }
446           leaf running {
447             if-feature writable-running;
448             type empty;
449             description
450               "The running configuration is the config source.";
451           }
452         }
453       }
454
455       leaf default-operation {
456         type enumeration {
457           enum merge {
458             description
459               "The default operation is merge.";
460           }
461           enum replace {
462             description
463               "The default operation is replace.";
464           }
465           enum none {
466             description
467               "There is no default operation.";
468           }
469         }
470         default "merge";
471         description
472           "The default operation to use.";
473       }
474
475       leaf test-option {
476         if-feature validate;
477         type enumeration {
478           enum test-then-set {
479             description
480               "The server will test and then set if no errors.";
481           }
482           enum set {
483             description
484               "The server will set without a test first.";
485           }
486
487           enum test-only {
488             description
489               "The server will only test and not set, even
490                if there are no errors.";
491           }
492         }
493         default "test-then-set";
494         description
495           "The test option to use.";
496       }
497
498       leaf error-option {
499         type enumeration {
500           enum stop-on-error {
501             description
502               "The server will stop on errors.";
503           }
504           enum continue-on-error {
505             description
506               "The server may continue on errors.";
507           }
508           enum rollback-on-error {
509             description
510               "The server will roll back on errors.
511                This value can only be used if the 'rollback-on-error'
512                feature is supported.";
513           }
514         }
515         default "stop-on-error";
516         description
517           "The error option to use.";
518       }
519
520       choice edit-content {
521         mandatory true;
522         description
523           "The content for the edit operation.";
524
525         cliext:argument-handler org.opendaylight.controller.netconf.cli.reader.custom.EditContentReader;
526
527         anyxml config {
528           description
529             "Inline Config content.";
530           cliext:argument-handler org.opendaylight.controller.netconf.cli.reader.custom.ConfigReader;
531         }
532
533         leaf url {
534           if-feature url;
535           type inet:uri;
536           description
537             "URL-based config content.";
538         }
539       }
540     }
541   }
542
543   rpc copy-config {
544     description
545       "Create or replace an entire configuration datastore with the
546        contents of another complete configuration datastore.";
547
548     reference "RFC 6241, Section 7.3";
549
550     input {
551       container target {
552         description
553           "Particular configuration to copy to.";
554
555         choice config-target {
556           mandatory true;
557           description
558             "The configuration target of the copy operation.";
559
560           leaf candidate {
561             if-feature candidate;
562             type empty;
563             description
564               "The candidate configuration is the config target.";
565           }
566           leaf running {
567             if-feature writable-running;
568             type empty;
569             description
570               "The running configuration is the config target.
571                This is optional-to-implement on the server.";
572           }
573           leaf startup {
574             if-feature startup;
575             type empty;
576             description
577               "The startup configuration is the config target.";
578           }
579           leaf url {
580             if-feature url;
581             type inet:uri;
582             description
583               "The URL-based configuration is the config target.";
584           }
585         }
586       }
587
588       container source {
589         description
590           "Particular configuration to copy from.";
591
592         choice config-source {
593           mandatory true;
594           description
595             "The configuration source for the copy operation.";
596
597           leaf candidate {
598             if-feature candidate;
599             type empty;
600             description
601               "The candidate configuration is the config source.";
602           }
603           leaf running {
604             type empty;
605             description
606               "The running configuration is the config source.";
607           }
608           leaf startup {
609             if-feature startup;
610             type empty;
611             description
612               "The startup configuration is the config source.";
613           }
614           leaf url {
615             if-feature url;
616             type inet:uri;
617             description
618               "The URL-based configuration is the config source.";
619           }
620           anyxml config {
621             description
622               "Inline Config content: <config> element.  Represents
623                an entire configuration datastore, not
624                a subset of the running datastore.";
625           }
626         }
627       }
628     }
629   }
630
631   rpc delete-config {
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         // TODO this extension should be augmented (anyxml nodes cannot be augmented)
755         cliext:argument-handler org.opendaylight.controller.netconf.cli.reader.custom.FilterReader;
756       }
757     }
758
759     output {
760       anyxml data {
761         description
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.";
766
767        cliext:argument-handler org.opendaylight.controller.netconf.cli.writer.custom.DataWriter;
768
769       }
770     }
771   }
772
773   rpc close-session {
774     description
775       "Request graceful termination of a NETCONF session.";
776
777     reference "RFC 6241, Section 7.8";
778   }
779
780   rpc kill-session {
781     description
782       "Force the termination of a NETCONF session.";
783
784     reference "RFC 6241, Section 7.9";
785
786     input {
787       leaf session-id {
788         type session-id-type;
789         mandatory true;
790         description
791           "Particular session to kill.";
792       }
793     }
794   }
795
796   rpc commit {
797     if-feature candidate;
798
799     description
800       "Commit the candidate configuration as the device's new
801        current configuration.";
802
803     reference "RFC 6241, Section 8.3.4.1";
804
805     input {
806       leaf confirmed {
807         if-feature confirmed-commit;
808         type empty;
809         description
810           "Requests a confirmed commit.";
811         reference "RFC 6241, Section 8.3.4.1";
812       }
813
814       leaf confirm-timeout {
815         if-feature confirmed-commit;
816         type uint32 {
817           range "1..max";
818         }
819         units "seconds";
820         default "600";   // 10 minutes
821         description
822           "The timeout interval for a confirmed commit.";
823         reference "RFC 6241, Section 8.3.4.1";
824       }
825
826       leaf persist {
827         if-feature confirmed-commit;
828         type string;
829         description
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.
835
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.
840
841            The token should be a random string.";
842         reference "RFC 6241, Section 8.3.4.1";
843       }
844
845       leaf persist-id {
846         if-feature confirmed-commit;
847         type string;
848         description
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";
855       }
856
857     }
858   }
859
860   rpc discard-changes {
861     if-feature candidate;
862
863     description
864       "Revert the candidate configuration to the current
865        running configuration.";
866     reference "RFC 6241, Section 8.3.4.2";
867   }
868
869   rpc cancel-commit {
870     if-feature confirmed-commit;
871     description
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";
877
878     input {
879       leaf persist-id {
880         type string;
881         description
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.";
887       }
888     }
889   }
890
891   rpc validate {
892     if-feature validate;
893
894     description
895       "Validates the contents of the specified configuration.";
896
897     reference "RFC 6241, Section 8.6.4.1";
898
899     input {
900       container source {
901         description
902           "Particular configuration to validate.";
903
904         choice config-source {
905           mandatory true;
906           description
907             "The configuration source to validate.";
908
909           leaf candidate {
910             if-feature candidate;
911             type empty;
912             description
913               "The candidate configuration is the config source.";
914           }
915           leaf running {
916             type empty;
917             description
918               "The running configuration is the config source.";
919           }
920           leaf startup {
921             if-feature startup;
922             type empty;
923             description
924               "The startup configuration is the config source.";
925           }
926           leaf url {
927             if-feature url;
928             type inet:uri;
929             description
930               "The URL-based configuration is the config source.";
931           }
932           anyxml config {
933             description
934               "Inline Config content: <config> element.  Represents
935                an entire configuration datastore, not
936                a subset of the running datastore.";
937           }
938         }
939       }
940     }
941   }
942
943 }