Add interface SslHandlerFactory
[netconf.git] / netconf / sal-netconf-connector / src / main / yang / 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 username-password {
19         leaf username {
20             type string;
21         }
22
23         leaf password {
24             type string;
25         }
26     }
27
28     grouping netconf-node-credentials {
29         choice credentials {
30             config true;
31             case login-password {
32                 description "Deprecated way of storing credentials, unencrypted.";
33
34                 status deprecated;
35                 uses username-password;
36             }
37             case login-pw {
38                 description "login-password credentials, encrypted.";
39
40                 container login-password {
41                     uses username-password;
42                 }
43             }
44             case login-pw-unencrypted {
45                 description "login-password credentials, not encrypted.";
46
47                 container login-password-unencrypted {
48                     uses username-password;
49                 }
50             }
51             case key-auth {
52                 description "key-based authentication, use the id for the pair thats stored in the keystore.";
53
54                 container key-based {
55                     leaf key-id {
56                         type string;
57                     }
58
59                     leaf username {
60                         type string;
61                     }
62                 }
63             }
64         }
65     }
66
67     grouping netconf-node-connection-parameters {
68
69         leaf host {
70             type inet:host;
71         }
72
73         leaf port {
74             type inet:port-number;
75         }
76
77         leaf tcp-only {
78             config true;
79             type boolean;
80         }
81
82         container protocol {
83             config true;
84             leaf name {
85                 type enumeration {
86                     enum SSH;
87                     enum TLS;
88                 }
89                 default SSH;
90             }
91
92             choice specification {
93                 case tls-case {
94                    container tls {
95                        leaf-list excluded-versions {
96                            type string;
97                            description "A list of TLS version names provided in JDK that are not supported by the
98                                         target netconf device, eg, the netopeer2 simulator does not support the
99                                         SSLv2Hello. Most of the time, this list need not be set";
100                        }
101                    }
102                 }
103             }
104         }
105
106         leaf schemaless {
107             type boolean;
108             default false;
109         }
110
111         container yang-module-capabilities {
112             config true;
113             leaf override {
114                 type boolean;
115                 default false;
116                 description "Whether to override or merge this list of capabilities with capabilities from device";
117             }
118
119             leaf-list capability {
120                 type string;
121                 description "Set a list of capabilities to override capabilities provided in device's hello message.
122                              Can be used for devices that do not report any yang modules in their hello message";
123             }
124         }
125
126         container non-module-capabilities {
127             config true;
128             leaf override {
129                 type boolean;
130                 default false;
131                 description "Whether to override or merge this list of non-module based capabilities with non-module
132                              based capabilities from device";
133             }
134
135             leaf-list capability {
136                 type string;
137                 description "Set a list of non-module based capabilities to override or merge non-module capabilities
138                              provided in device's hello message. Can be used for devices that do not report or
139                              incorrectly report non-module based capabilities in their hello message";
140             }
141         }
142
143         leaf reconnect-on-changed-schema {
144             config true;
145             type boolean;
146             default false;
147             description "If true, the connector would auto disconnect/reconnect when schemas are changed in the remote device.
148                          The connector subscribes (right after connect) to base netconf notifications and listens for netconf-capability-change notification";
149         }
150
151         leaf connection-timeout-millis {
152             description "Specifies timeout in milliseconds after which connection must be established.";
153             config true;
154             type uint32;
155             default 20000;
156         }
157
158         leaf default-request-timeout-millis {
159             description "Timeout for blocking operations within transactions.";
160             config true;
161             type uint32;
162             default 60000;
163         }
164
165         leaf max-connection-attempts {
166             description "Maximum number of connection retries. Non positive value or null is interpreted as infinity.";
167             config true;
168             type uint32;
169             default 0; // retry forever
170         }
171
172         leaf between-attempts-timeout-millis {
173             description "Initial timeout in milliseconds to wait between connection attempts. Will be multiplied by sleep-factor with every additional attempt";
174             config true;
175             type uint16;
176             default 2000;
177         }
178
179         leaf sleep-factor {
180             config true;
181             type decimal64 {
182                 fraction-digits 1;
183             }
184             default 1.5;
185         }
186
187         // Keepalive configuration
188         leaf keepalive-delay {
189             config true;
190             type uint32;
191             default 120;
192             description "Netconf connector sends keepalive RPCs while the session is idle, this delay specifies the delay between keepalive RPC in seconds
193                          If a value <1 is provided, no keepalives will be sent";
194         }
195
196         leaf concurrent-rpc-limit {
197             config true;
198             type uint16;
199             default 0;
200             description "Limit of concurrent messages that can be send before reply messages are received.
201                          If value <1 is provided, no limit will be enforced";
202         }
203
204         leaf actor-response-wait-time {
205                     config true;
206                     type uint16 {
207                       range "1..max";
208                     }
209                     default 5;
210                     description "Time that slave actor will wait for response from master.";
211         }
212     }
213
214     grouping netconf-node-connection-status {
215
216         leaf connection-status {
217             config false;
218             type enumeration {
219                 enum connecting;
220                 enum connected;
221                 enum unable-to-connect;
222             }
223         }
224
225         container clustered-connection-status {
226             config false;
227             list node-status {
228                 leaf node {
229                     type string;
230                 }
231                 leaf status {
232                     type enumeration {
233                         enum connected;
234                         enum unavailable;
235                         enum failed;
236                     }
237                 }
238             }
239             leaf netconf-master-node {
240                 config false;
241                 type string;
242             }
243         }
244
245         leaf connected-message {
246             config false;
247             type string;
248         }
249
250         container available-capabilities {
251             config false;
252             list available-capability {
253                 leaf capability {
254                     type string;
255                 }
256                 leaf capability-origin {
257                     type enumeration {
258                         enum user-defined;
259                         enum device-advertised;
260                     }
261                 }
262             }
263         }
264
265         container unavailable-capabilities {
266             config false;
267             list unavailable-capability {
268                 leaf capability {
269                     type string;
270                 }
271
272                 leaf failure-reason {
273                     type enumeration {
274                         enum missing-source;
275                         enum unable-to-resolve;
276                     }
277                 }
278             }
279         }
280
281         container pass-through {
282             when "../connection-status = connected";
283             description
284                 "When the underlying node is connected, its NETCONF context
285                 is available verbatim under this container through the
286                 mount extension.";
287         }
288
289     }
290
291     grouping netconf-schema-storage {
292         leaf schema-cache-directory {
293             config true;
294             type string;
295             default "schema";
296             description "The destination schema repository for yang files relative to the cache directory.  This may be specified per netconf mount
297                          so that the loaded yang files are stored to a distinct directory to avoid potential conflict.";
298         }
299
300         container yang-library {
301             leaf yang-library-url {
302                 config true;
303                 type inet:uri;
304                 description "Yang library to be plugged as additional source provider into the shared schema repository";
305             }
306
307             // credentials for basic http authentication
308             leaf username {
309                 config true;
310                 type string;
311             }
312
313             leaf password {
314                 config true;
315                 type string;
316             }
317         }
318     }
319
320     grouping netconf-node-fields {
321
322         uses netconf-node-credentials;
323
324         uses netconf-node-connection-parameters;
325
326         uses netconf-node-connection-status;
327
328         uses netconf-schema-storage;
329
330     }
331
332     rpc create-device {
333         input {
334             uses netconf-node-fields;
335             leaf node-id {
336                 type string;
337             }
338         }
339     }
340
341     rpc delete-device {
342         input {
343             leaf node-id {
344                 type string;
345             }
346         }
347     }
348
349     augment "/nt:network-topology/nt:topology/nt:node" {
350         when "../../nt:topology-types/topology-netconf";
351         ext:augment-identifier "netconf-node";
352
353         uses netconf-node-fields;
354     }
355
356 }