BUG-2314 Migrate netconf-connector to NormalizedNode
[controller.git] / opendaylight / md-sal / 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     rpc edit-config {
44         description "The <edit-config> operation loads all or part of a specified
45              configuration to the specified target configuration.";
46
47         reference "RFC 6241, Section 7.2";
48
49         input {
50             container target {
51                 description "Particular configuration to edit.";
52
53                 choice config-target {
54                     mandatory true;
55                     description "The configuration target.";
56
57                     leaf candidate {
58                         if-feature candidate;
59                         type empty;
60                         description "The candidate configuration is the config target.";
61                     }
62
63                     leaf running {
64                         if-feature writable-running;
65                         type empty;
66                         description "The running configuration is the config source.";
67                     }
68                 }
69             }
70
71             choice edit-content {
72                 mandatory true;
73                 description "The content for the edit operation.";
74
75                 anyxml config {
76                     description
77                       "Inline Config content.";
78                 }
79
80                 leaf url {
81                     if-feature url;
82                     type string;
83                     description
84                       "URL-based config content.";
85                 }
86             }
87         }
88     }
89
90     rpc get-config {
91       description
92         "Retrieve all or part of a specified configuration.";
93
94       reference "RFC 6241, Section 7.1";
95
96       input {
97         container source {
98           description "Particular configuration to retrieve.";
99
100             choice config-source {
101                 mandatory true;
102                 description
103                   "The configuration to retrieve.";
104                 leaf candidate {
105                   if-feature candidate;
106                   type empty;
107                   description
108                     "The candidate configuration is the config source.";
109                 }
110                 leaf running {
111                   type empty;
112                   description
113                     "The running configuration is the config source.";
114                 }
115                 leaf startup {
116                   if-feature startup;
117                   type empty;
118                   description
119                     "The startup configuration is the config source.
120                      This is optional-to-implement on the server because
121                      not all servers will support filtering for this
122                      datastore.";
123                 }
124             }
125         }
126
127         anyxml filter {
128             description "Subtree or XPath filter to use.";
129                 get-filter-element-attributes;
130             }
131         }
132
133         output {
134             anyxml data {
135               description
136                 "Copy of the source datastore subset that matched
137                  the filter criteria (if any).  An empty data container
138                  indicates that the request did not produce any results.";
139             }
140         }
141     }
142
143     rpc get {
144         description "Retrieve running configuration and device state information.";
145
146         reference "RFC 6241, Section 7.7";
147
148         input {
149             anyxml filter {
150               description
151                 "This parameter specifies the portion of the system
152                  configuration and state data to retrieve.";
153               get-filter-element-attributes;
154             }
155         }
156
157         output {
158             anyxml data {
159               description
160                 "Copy of the running datastore subset and/or state
161                  data that matched the filter criteria (if any).
162                  An empty data container indicates that the request did not
163                  produce any results.";
164             }
165         }
166     }
167
168       rpc discard-changes {
169         if-feature candidate;
170
171         description
172           "Revert the candidate configuration to the current
173            running configuration.";
174         reference "RFC 6241, Section 8.3.4.2";
175       }
176 }