Bump yangtools to 2.1.10
[netconf.git] / netconf / sal-netconf-connector / src / test / resources / schemas / config-test-rpc.yang
1 module config-test-rpc {
2     namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:test:rpc:config:defs";
3     prefix "rpc";
4
5     organization
6     "Cisco Systems, Inc.";
7
8     contact
9     "lsedlak@cisco.com";
10
11     description "Test model containing hacked definition of rpc edit-config and definitions for
12         get and get-config rpc operations.
13         The rpc definition is copied from rfc 6241 Appendix C: http://tools.ietf.org/html/rfc6241#appendix-C";
14
15     revision 2014-07-21 {
16         description "Initial revision.";
17     }
18
19     extension get-filter-element-attributes {
20           description
21             "If this extension is present within an 'anyxml'
22              statement named 'filter', which must be conceptually
23              defined within the RPC input section for the <get>
24              and <get-config> protocol operations, then the
25              following unqualified XML attribute is supported
26              within the <filter> element, within a <get> or
27              <get-config> protocol operation:
28
29                type : optional attribute with allowed
30                       value strings 'subtree' and 'xpath'.
31                       If missing, the default value is 'subtree'.
32
33              If the 'xpath' feature is supported, then the
34              following unqualified XML attribute is
35              also supported:
36
37                select: optional attribute containing a
38                        string representing an XPath expression.
39                        The 'type' attribute must be equal to 'xpath'
40                        if this attribute is present.";
41     }
42
43     feature candidate;
44     feature startup;
45     feature writable-running;
46     feature url;
47
48     rpc edit-config {
49         description "The <edit-config> operation loads all or part of a specified
50              configuration to the specified target configuration.";
51
52         reference "RFC 6241, Section 7.2";
53
54         input {
55             container target {
56                 description "Particular configuration to edit.";
57
58                 choice config-target {
59                     mandatory true;
60                     description "The configuration target.";
61
62                     leaf candidate {
63                         if-feature candidate;
64                         type empty;
65                         description "The candidate configuration is the config target.";
66                     }
67
68                     leaf running {
69                         if-feature writable-running;
70                         type empty;
71                         description "The running configuration is the config source.";
72                     }
73                 }
74             }
75
76             choice edit-content {
77                 mandatory true;
78                 description "The content for the edit operation.";
79
80                 anyxml config {
81                     description
82                       "Inline Config content.";
83                 }
84
85                 leaf url {
86                     if-feature url;
87                     type string;
88                     description
89                       "URL-based config content.";
90                 }
91             }
92         }
93     }
94
95     rpc get-config {
96       description
97         "Retrieve all or part of a specified configuration.";
98
99       reference "RFC 6241, Section 7.1";
100
101       input {
102         container source {
103           description "Particular configuration to retrieve.";
104
105             choice config-source {
106                 mandatory true;
107                 description
108                   "The configuration to retrieve.";
109                 leaf candidate {
110                   if-feature candidate;
111                   type empty;
112                   description
113                     "The candidate configuration is the config source.";
114                 }
115                 leaf running {
116                   type empty;
117                   description
118                     "The running configuration is the config source.";
119                 }
120                 leaf startup {
121                   if-feature startup;
122                   type empty;
123                   description
124                     "The startup configuration is the config source.
125                      This is optional-to-implement on the server because
126                      not all servers will support filtering for this
127                      datastore.";
128                 }
129             }
130         }
131
132         anyxml filter {
133             description "Subtree or XPath filter to use.";
134                 rpc:get-filter-element-attributes;
135             }
136         }
137
138         output {
139             anyxml data {
140               description
141                 "Copy of the source datastore subset that matched
142                  the filter criteria (if any).  An empty data container
143                  indicates that the request did not produce any results.";
144             }
145         }
146     }
147
148     rpc get {
149         description "Retrieve running configuration and device state information.";
150
151         reference "RFC 6241, Section 7.7";
152
153         input {
154             anyxml filter {
155               description
156                 "This parameter specifies the portion of the system
157                  configuration and state data to retrieve.";
158               rpc:get-filter-element-attributes;
159             }
160         }
161
162         output {
163             anyxml data {
164               description
165                 "Copy of the running datastore subset and/or state
166                  data that matched the filter criteria (if any).
167                  An empty data container indicates that the request did not
168                  produce any results.";
169             }
170         }
171     }
172
173       rpc discard-changes {
174         if-feature candidate;
175
176         description
177           "Revert the candidate configuration to the current
178            running configuration.";
179         reference "RFC 6241, Section 8.3.4.2";
180       }
181 }