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