Bug-6346: Allow over-ride of non-module capabilities
[netconf.git] / netconf / netconf-console / src / test / resources / schemas / netconf-node-topology.yang
1 module netconf-node-topology {
2     namespace "urn:opendaylight:netconf-node-topology";
3     prefix "nettop";
4
5     import network-topology { prefix nt; revision-date 2013-10-21; }
6     import yang-ext { prefix ext; revision-date "2013-07-09";}
7     import ietf-inet-types { prefix inet; revision-date "2013-07-15"; }
8
9     revision "2015-01-14" {
10         description "Initial revision of Topology model";
11     }
12
13     augment "/nt:network-topology/nt:topology/nt:topology-types" {
14         container topology-netconf {
15         }
16     }
17
18     grouping netconf-node-credentials {
19
20         choice credentials {
21             config true;
22             case login-password {
23                 leaf username {
24                     type string;
25                 }
26
27                 leaf password {
28                     type string;
29                 }
30             }
31         }
32     }
33
34     grouping netconf-node-connection-parameters {
35
36         leaf host {
37             type inet:host;
38         }
39
40         leaf port {
41             type inet:port-number;
42         }
43
44         leaf tcp-only {
45             config true;
46             type boolean;
47         }
48
49         leaf schemaless {
50             type boolean;
51             default false;
52         }
53
54         container yang-module-capabilities {
55             config true;
56             leaf override {
57                 type boolean;
58                 default false;
59                 description "Whether to override or merge this list of capabilities with capabilities from device";
60             }
61
62             leaf-list capability {
63                 type string;
64                 description "Set a list of capabilities to override capabilities provided in device's hello message.
65                              Can be used for devices that do not report any yang modules in their hello message";
66             }
67         }
68
69         container non-module-capabilities {
70             config true;
71             leaf override {
72                 type boolean;
73                 default false;
74                 description "Whether to override or merge this list of non-module based capabilities with non-module
75                              based capabilities from device";
76             }
77
78             leaf-list capability {
79                 type string;
80                 description "Set a list of non-module based capabilities to override or merge non-module capabilities
81                              provided in device's hello message. Can be used for devices that do not report or
82                              incorrectly report non-module based capabilities in their hello message";
83             }
84         }
85
86         leaf reconnect-on-changed-schema {
87             config true;
88             type boolean;
89             default false;
90             description "If true, the connector would auto disconnect/reconnect when schemas are changed in the remote device.
91                          The connector subscribes (right after connect) to base netconf notifications and listens for netconf-capability-change notification";
92         }
93
94         leaf connection-timeout-millis {
95             description "Specifies timeout in milliseconds after which connection must be established.";
96             config true;
97             type uint32;
98             default 20000;
99         }
100
101         leaf default-request-timeout-millis {
102             description "Timeout for blocking operations within transactions.";
103             config true;
104             type uint32;
105             default 60000;
106         }
107
108         leaf max-connection-attempts {
109             description "Maximum number of connection retries. Non positive value or null is interpreted as infinity.";
110             config true;
111             type uint32;
112             default 0; // retry forever
113         }
114
115         leaf between-attempts-timeout-millis {
116             description "Initial timeout in milliseconds to wait between connection attempts. Will be multiplied by sleep-factor with every additional attempt";
117             config true;
118             type uint16;
119             default 2000;
120         }
121
122         leaf sleep-factor {
123             config true;
124             type decimal64 {
125                 fraction-digits 1;
126             }
127             default 1.5;
128         }
129
130         // Keepalive configuration
131         leaf keepalive-delay {
132             config true;
133             type uint32;
134             default 120;
135             description "Netconf connector sends keepalive RPCs while the session is idle, this delay specifies the delay between keepalive RPC in seconds
136                          If a value <1 is provided, no keepalives will be sent";
137         }
138
139         leaf concurrent-rpc-limit {
140             config true;
141             type uint16;
142             default 0;
143             description "Limit of concurrent messages that can be send before reply messages are received.
144                          If value <1 is provided, no limit will be enforced";
145         }
146     }
147
148     grouping netconf-node-connection-status {
149
150         leaf connection-status {
151             config false;
152             type enumeration {
153                 enum connecting;
154                 enum connected;
155                 enum unable-to-connect;
156             }
157         }
158
159         container clustered-connection-status {
160             config false;
161             list node-status {
162                 leaf node {
163                     type string;
164                 }
165                 leaf status {
166                     type enumeration {
167                         enum connected;
168                         enum unavailable;
169                         enum failed;
170                     }
171                 }
172             }
173             leaf netconf-master-node {
174                 config false;
175                 type string;
176             }
177         }
178
179         leaf connected-message {
180             config false;
181             type string;
182         }
183
184         container available-capabilities {
185             config false;
186             list available-capability {
187                 leaf capability {
188                     type string;
189                 }
190                 leaf capability-origin {
191                     type enumeration {
192                         enum user-defined;
193                         enum device-advertised;
194                     }
195                 }
196             }
197         }
198
199         container unavailable-capabilities {
200             config false;
201             list unavailable-capability {
202                 leaf capability {
203                     type string;
204                 }
205
206                 leaf failure-reason {
207                     type enumeration {
208                         enum missing-source;
209                         enum unable-to-resolve;
210                     }
211                 }
212             }
213         }
214
215         container pass-through {
216             when "../connection-status = connected";
217             description
218                 "When the underlying node is connected, its NETCONF context
219                 is available verbatim under this container through the
220                 mount extension.";
221         }
222
223     }
224
225     grouping netconf-schema-storage {
226         leaf schema-cache-directory {
227             config true;
228             type string;
229             default "schema";
230             description "The destination schema repository for yang files relative to the cache directory.  This may be specified per netconf mount
231                          so that the loaded yang files are stored to a distinct directory to avoid potential conflict.";
232         }
233
234         container yang-library {
235             leaf yang-library-url {
236                 config true;
237                 type inet:uri;
238                 description "Yang library to be plugged as additional source provider into the shared schema repository";
239             }
240
241             // credentials for basic http authentication
242             leaf username {
243                 config true;
244                 type string;
245             }
246
247             leaf password {
248                 config true;
249                 type string;
250             }
251         }
252     }
253
254     grouping netconf-node-fields {
255
256         uses netconf-node-credentials;
257
258         uses netconf-node-connection-parameters;
259
260         uses netconf-node-connection-status;
261
262         uses netconf-schema-storage;
263
264     }
265
266     augment "/nt:network-topology/nt:topology/nt:node" {
267         when "../../nt:topology-types/topology-netconf";
268         ext:augment-identifier "netconf-node";
269
270         uses netconf-node-fields;
271     }
272 }